From c0d988fc89d12e1e57c36d1256bd1c0cef22e6a2 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Tue, 7 Mar 2023 15:44:46 +0100 Subject: [PATCH] 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. --- home/packages/custom/update-system/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/packages/custom/update-system/default.nix b/home/packages/custom/update-system/default.nix index 14fb344..79adcf6 100644 --- a/home/packages/custom/update-system/default.nix +++ b/home/packages/custom/update-system/default.nix @@ -7,8 +7,8 @@ writeShellApplication { nix-channel --update home-manager switch - oldVersion=$(home-manager generations | head -n 2 | tail -n 1 | cut -d' ' -f 7) - newVersion=$(home-manager generations | head -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; true) | head -n 1 | cut -d' ' -f 7) nvd diff "$oldVersion" "$newVersion" home-manager expire-generations '-12 days'