cmd/fpkg: clean up broken links before activation
All checks were successful
Tests / Go tests (push) Successful in 35s
Nix / NixOS tests (push) Successful in 3m38s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
Ophestra 2024-12-29 15:21:40 +09:00
parent 42e1043300
commit c795293f36
Signed by: cat
SSH Key Fingerprint: SHA256:gQ67O0enBZ7UdZypgtspB2FDM1g3GVw8nX0XSdcFw8Q

View File

@ -171,7 +171,8 @@ func actionInstall(args []string) {
activateConfig := &fst.Config{ activateConfig := &fst.Config{
ID: bundle.ID, 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 "(while [ ! -S /nix/var/nix/daemon-socket/socket ]; do sleep 0.01; done) && " + // wait for socket to appear
bundle.ActivationPackage + "/activate && " + // run activation script bundle.ActivationPackage + "/activate && " + // run activation script
"pkill nix-daemon", // terminate nix-daemon "pkill nix-daemon", // terminate nix-daemon