nixos-config/modules/nixos/common-settings/autoupgrade.nix

33 lines
491 B
Nix
Raw Normal View History

2024-09-24 02:53:51 +00:00
{
config,
lib,
...
}:
let
inherit (lib)
mkIf
mkEnableOption
mkOption
types
;
cfg = config.commonSettings.autoupgrade;
in
{
options.commonSettings.autoupgrade = {
enable = mkEnableOption "auto upgrade with nixos-rebuild";
flake = mkOption {
type = types.str;
default = "github:xinyangli/nixos-config/deploy";
};
};
config = mkIf cfg.enable {
system.autoUpgrade = {
enable = true;
flake = cfg.flake;
};
};
}