From 7e58b6bb356165254f45f068649138c16d676c39 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 6 May 2017 00:35:36 +0200 Subject: [PATCH] home-environment: always link new and clean old generation Previously the home files were not linked if the generation hadn't changed. Unfortunately, this would mean that, if a file link was removed for some reason it would not be recreated by running a switch command. --- modules/home-environment.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 1e7a44730..b270b1cc3 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -300,14 +300,16 @@ in } if [[ ! -v oldGenPath || "$oldGenPath" != "$newGenPath" ]] ; then + echo "Creating profile generation $newGenNum" $DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenProfilePath" $DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenProfilePath" "$genProfilePath" $DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$newGenPath" "$newGenGcPath" - linkNewGen - cleanOldGen else - echo "Same home files as previous generation ... doing nothing" + echo "No change so reusing latest profile generation $oldGenNum" fi + + linkNewGen + cleanOldGen '' );