This commit is contained in:
parent
07552f3070
commit
8475d92314
|
@ -22,6 +22,10 @@ in
|
||||||
options.my.home.nix = with lib; {
|
options.my.home.nix = with lib; {
|
||||||
enable = my.mkDisableOption "nix configuration";
|
enable = my.mkDisableOption "nix configuration";
|
||||||
|
|
||||||
|
gc = {
|
||||||
|
enable = my.mkDisableOption "nix GC configuration";
|
||||||
|
};
|
||||||
|
|
||||||
cache = {
|
cache = {
|
||||||
selfHosted = my.mkDisableOption "self-hosted cache";
|
selfHosted = my.mkDisableOption "self-hosted cache";
|
||||||
};
|
};
|
||||||
|
@ -60,6 +64,22 @@ in
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(lib.mkIf cfg.gc.enable {
|
||||||
|
nix.gc = {
|
||||||
|
automatic = true;
|
||||||
|
|
||||||
|
# Every week, with some wiggle room
|
||||||
|
frequency = "weekly";
|
||||||
|
randomizedDelaySec = "10min";
|
||||||
|
|
||||||
|
# Use a persistent timer for e.g: laptops
|
||||||
|
persistent = true;
|
||||||
|
|
||||||
|
# Delete old profiles automatically after 15 days
|
||||||
|
options = "--delete-older-than 15d";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
(lib.mkIf cfg.cache.selfHosted {
|
(lib.mkIf cfg.cache.selfHosted {
|
||||||
nix = {
|
nix = {
|
||||||
settings = {
|
settings = {
|
||||||
|
|
Loading…
Reference in a new issue