mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Switch garbage collection to nh
This commit is contained in:
parent
ee6393aa18
commit
55fc9b9f36
5 changed files with 22 additions and 23 deletions
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.auto-gc.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.auto-gc.enable {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
options = "--delete-older-than 7d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@
|
|||
./wlan.nix
|
||||
./vpn.nix
|
||||
./comma.nix
|
||||
./auto-gc.nix
|
||||
./sops.nix
|
||||
./bluetooth.nix
|
||||
./de.nix
|
||||
|
|
|
|||
|
|
@ -2,10 +2,15 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.myConfig.nix-helper.enable = lib.mkEnableOption "";
|
||||
}: let
|
||||
cfg = config.myConfig.nix-helper;
|
||||
in {
|
||||
options.myConfig.nix-helper = {
|
||||
enable = lib.mkEnableOption "";
|
||||
auto-gc.enable = lib.mkEnableOption "";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.myConfig.nix-helper.enable {
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.nh.enable = true;
|
||||
|
||||
environment.shellAliases = let
|
||||
|
|
@ -16,5 +21,11 @@
|
|||
nrb = "${rebuild} boot";
|
||||
nrrb = "nrb && reboot";
|
||||
};
|
||||
|
||||
programs.nh.clean = lib.mkIf cfg.auto-gc.enable {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 7d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue