1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 09:28:32 +02:00

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.
This commit is contained in:
Robert Helgesson 2017-05-06 00:35:36 +02:00
parent 8fab2a5d9b
commit 7e58b6bb35
No known key found for this signature in database
GPG Key ID: C3DB11069E65DC86

View File

@ -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
''
);