modules/autoupgrade: init
This commit is contained in:
parent
fb30c14c91
commit
f905f051a0
5 changed files with 40 additions and 17 deletions
32
modules/nixos/common-settings/autoupgrade.nix
Normal file
32
modules/nixos/common-settings/autoupgrade.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./common-settings/auth.nix
|
||||
./common-settings/autoupgrade.nix
|
||||
./common-settings/nix-conf.nix
|
||||
./restic.nix
|
||||
./vaultwarden.nix
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue