mirror of
https://github.com/SuperSandro2000/nixos-modules.git
synced 2024-06-14 03:46:57 +02:00
nix: add settings to cleanup legacy, none flake things
This commit is contained in:
parent
7e98f19f5d
commit
dd49629a06
23
modules/nix.nix
Normal file
23
modules/nix.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ config, lib, libS, ... }:
|
||||
|
||||
{
|
||||
options.nix = {
|
||||
deleteChannels = lib.mkEnableOption "" // { description = "Wether to delete all channels on a system switch."; };
|
||||
|
||||
deleteUserProfiles = lib.mkEnableOption "" // { description = "Wether to delete all channels on a system switch."; };
|
||||
};
|
||||
|
||||
config = {
|
||||
system.userActivationScripts = {
|
||||
deleteChannels = lib.mkIf config.nix.deleteChannels ''
|
||||
echo "Deleting all channels..."
|
||||
rm -rf /root/.nix-channels /home/*/.nix-channels /nix/var/nix/profiles/per-user/*/channels*
|
||||
'';
|
||||
|
||||
deleteUserProfiles = lib.mkIf config.nix.deleteUserProfiles ''
|
||||
echo "Deleting all user profiles..."
|
||||
rm -rf /root/.nix-profile /home/*/.nix-profile /nix/var/nix/profiles/per-user/*/profile*
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user