From c795293f3690ca6d91e898b72edd0a20b9708450 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 29 Dec 2024 15:21:40 +0900 Subject: [PATCH] cmd/fpkg: clean up broken links before activation Signed-off-by: Ophestra --- cmd/fpkg/install.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/fpkg/install.go b/cmd/fpkg/install.go index 2ba2c22..793b953 100644 --- a/cmd/fpkg/install.go +++ b/cmd/fpkg/install.go @@ -171,7 +171,8 @@ func actionInstall(args []string) { activateConfig := &fst.Config{ ID: bundle.ID, - Command: []string{shell, "-lc", "nix-daemon --store / & " + // start nix-daemon + Command: []string{shell, "-lc", "mkdir -p .local/state/{nix,home-manager} && chmod -R +w .local/state/{nix,home-manager} && rm -rf .local/state/{nix,home-manager} && " + // clean up broken links + "nix-daemon --store / & " + // start nix-daemon "(while [ ! -S /nix/var/nix/daemon-socket/socket ]; do sleep 0.01; done) && " + // wait for socket to appear bundle.ActivationPackage + "/activate && " + // run activation script "pkill nix-daemon", // terminate nix-daemon