Fix none working update script

Nix adds errexit and failpipe.
Using head will end in 141 SIGPIPE, see: https://unix.stackexchange.com/a/580119/185477

I apply the workaround / fix as suggested on StackExchange.

That way the script runs and can execute the cleanup and diff.
This commit is contained in:
Daniel Siepmann 2023-03-07 15:44:46 +01:00
parent 0b2ee9c1bf
commit c0d988fc89
Signed by: Daniel Siepmann
GPG Key ID: 33D6629915560EF4
1 changed files with 2 additions and 2 deletions

View File

@ -7,8 +7,8 @@ writeShellApplication {
nix-channel --update nix-channel --update
home-manager switch home-manager switch
oldVersion=$(home-manager generations | head -n 2 | tail -n 1 | cut -d' ' -f 7) oldVersion=$( (home-manager generations; true) | head -n 2 | tail -n 1 | cut -d' ' -f 7)
newVersion=$(home-manager generations | head -n 1 | cut -d' ' -f 7) newVersion=$( (home-manager generations; true) | head -n 1 | cut -d' ' -f 7)
nvd diff "$oldVersion" "$newVersion" nvd diff "$oldVersion" "$newVersion"
home-manager expire-generations '-12 days' home-manager expire-generations '-12 days'