about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-29 16:36:43 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-11-29 16:36:43 +0100
commitd54b9d548fa8b1b702bbed73478f0948a2444ab4 (patch)
treeab446b58ffcf1e66c0059fe867c4f259ef16c447
parentbuild(treewide): Update (diff)
downloadnixos-config-d54b9d548fa8b1b702bbed73478f0948a2444ab4.tar.gz
nixos-config-d54b9d548fa8b1b702bbed73478f0948a2444ab4.zip
fix(modules/lf): Retry connecting to the server
It is possible that the config file is sourced, without a started
server. This is effectively a race condition, which can only be fixed
upstream, but we can at least try to connect to the server again.
-rw-r--r--modules/by-name/lf/lf/module.nix6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix
index 44b7af0e..1c02092d 100644
--- a/modules/by-name/lf/lf/module.nix
+++ b/modules/by-name/lf/lf/module.nix
@@ -82,7 +82,11 @@ in {
           &{{
             tmp="$(mktemp)"
             ${lib.getExe pkgs.lf-make-map} --depth 4 generate ~/media ~/repos ~/school >"$tmp"
-            lf -remote "send $id source $tmp"
+
+            until lf -remote "send $id source $tmp"; do
+              sleep 0.2
+            done
+
             rm "$tmp"
           }}
         '';