22
0
mirror of https://github.com/SuperSandro2000/nixos-modules.git synced 2024-06-02 06:19:22 +02:00

nix: don't fail if no channel or channel directories exist

This commit is contained in:
Sandro - 2023-05-02 21:50:05 +02:00
parent 985d81927a
commit e220c41cee
Signed by: sandro
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -60,12 +60,12 @@ in
system.activationScripts = {
deleteChannels = lib.mkIf cfg.deleteChannels ''
echo "Deleting all channels..."
rm -rf /root/.nix-channels /home/*/.nix-channels /nix/var/nix/profiles/per-user/*/channels*
rm -rf /root/.nix-channels /home/*/.nix-channels /nix/var/nix/profiles/per-user/*/channels* || true
'';
deleteUserProfiles = lib.mkIf cfg.deleteUserProfiles ''
echo "Deleting all user profiles..."
rm -rf /root/.nix-profile /home/*/.nix-profile /nix/var/nix/profiles/per-user/*/profile*
rm -rf /root/.nix-profile /home/*/.nix-profile /nix/var/nix/profiles/per-user/*/profile* || true
'';
};
};