mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Extract auto-gc into it's own module
This commit is contained in:
parent
2442658380
commit
b020faa8d2
5 changed files with 18 additions and 20 deletions
13
modules/system/auto-gc.nix
Normal file
13
modules/system/auto-gc.nix
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
options.myConfig.auto-gc.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.myConfig.auto-gc.enable {
|
||||
programs.nh.enable = true;
|
||||
programs.nh.clean = {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -14,6 +14,7 @@
|
|||
./printing.nix
|
||||
./syncthing.nix
|
||||
./nix-helper.nix
|
||||
./auto-gc.nix
|
||||
./night-light.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,8 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.myConfig.nix-helper;
|
||||
in
|
||||
{
|
||||
options.myConfig.nix-helper = {
|
||||
enable = lib.mkEnableOption "";
|
||||
auto-gc.enable = lib.mkEnableOption "";
|
||||
};
|
||||
options.myConfig.nix-helper.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
config = lib.mkIf config.myConfig.nix-helper.enable {
|
||||
environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config";
|
||||
programs.nh.enable = true;
|
||||
|
||||
|
|
@ -22,11 +16,5 @@ in
|
|||
nrb = "${rebuild} boot";
|
||||
nrrb = "nrb && reboot";
|
||||
};
|
||||
|
||||
programs.nh.clean = lib.mkIf cfg.auto-gc.enable {
|
||||
enable = true;
|
||||
dates = "daily";
|
||||
extraArgs = "--keep 10 --keep-since 3d";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue