mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 18:59:47 +01: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:
parent
8fab2a5d9b
commit
7e58b6bb35
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
''
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue