nix-config/modules/update.nix
2020-12-30 19:51:37 +01:00

27 lines
489 B
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.dadada.autoUpgrade;
in {
options.dadada.autoUpgrade = {
enable = mkEnableOption "Enable automatic upgrades";
};
config = mkIf cfg.enable {
nix = {
autoOptimiseStore = true;
useSandbox = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
system.autoUpgrade = {
enable = true;
dates = "daily";
};
};
}