mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-22 00:21: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
|
|
@ -27,10 +27,8 @@
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
nix-helper = {
|
nix-helper.enable = true;
|
||||||
enable = true;
|
|
||||||
auto-gc.enable = true;
|
auto-gc.enable = true;
|
||||||
};
|
|
||||||
night-light.enable = true;
|
night-light.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,8 @@
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
syncthing.enable = true;
|
syncthing.enable = true;
|
||||||
nix-helper = {
|
nix-helper.enable = true;
|
||||||
enable = true;
|
|
||||||
auto-gc.enable = true;
|
auto-gc.enable = true;
|
||||||
};
|
|
||||||
night-light.enable = true;
|
night-light.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
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
|
./printing.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./nix-helper.nix
|
./nix-helper.nix
|
||||||
|
./auto-gc.nix
|
||||||
./night-light.nix
|
./night-light.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
|
||||||
cfg = config.myConfig.nix-helper;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options.myConfig.nix-helper = {
|
options.myConfig.nix-helper.enable = lib.mkEnableOption "";
|
||||||
enable = lib.mkEnableOption "";
|
|
||||||
auto-gc.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";
|
environment.sessionVariables.FLAKE = "/home/seb/Projects/nixos/my-config";
|
||||||
programs.nh.enable = true;
|
programs.nh.enable = true;
|
||||||
|
|
||||||
|
|
@ -22,11 +16,5 @@ in
|
||||||
nrb = "${rebuild} boot";
|
nrb = "${rebuild} boot";
|
||||||
nrrb = "nrb && reboot";
|
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