Commit 4a9186996146
Changed files (1)
tmp
nixos-configuration
modules
profiles
tmp/nixos-configuration/modules/profiles/nix-auto-update.nix
@@ -23,38 +23,43 @@ in
type = types.str;
};
version = mkOption {
- default = "19.09";
+ default = "20.03";
description = "System version (NixOS)";
type = types.str;
};
};
};
- config = mkIf cfg.enable (mkMerge [
- {
- system = {
- stateVersion = cfg.version;
- };
- }
- (mkIf cfg.autoUpgrade {
- systemd.services.nixos-update = {
- description = "NixOS Upgrade";
- unitConfig.X-StopOnRemoval = false;
- restartIfChanged = false;
- serviceConfig.Type = "oneshot";
- environment = config.nix.envVars //
- { inherit (config.environment.sessionVariables) NIX_PATH;
- HOME = "/root";
+ config = mkIf cfg.enable (
+ mkMerge [
+ {
+ system = {
+ stateVersion = cfg.version;
};
- path = [ pkgs.gnutar pkgs.xz pkgs.git pkgs.gnumake config.nix.package.out pkgs.commonsCompress ];
- script = ''
- export PATH=/run/current-system/sw/bin
- cd /etc/nixos/
- git pull --autostash --rebase
- /run/current-system/sw/bin/make update switch
- '';
- startAt = cfg.dates;
- onFailure = ["status-email-root@%n.service"];
- };
- })
- ]);
+ }
+ (
+ mkIf cfg.autoUpgrade {
+ systemd.services.nixos-update = {
+ description = "NixOS Upgrade";
+ unitConfig.X-StopOnRemoval = false;
+ restartIfChanged = false;
+ serviceConfig.Type = "oneshot";
+ environment = config.nix.envVars
+ // {
+ inherit (config.environment.sessionVariables) NIX_PATH;
+ HOME = "/root";
+ };
+ path = [ pkgs.gnutar pkgs.xz pkgs.git pkgs.gnumake config.nix.package.out pkgs.commonsCompress ];
+ script = ''
+ export PATH=/run/current-system/sw/bin
+ cd /etc/nixos/
+ git pull --autostash --rebase
+ /run/current-system/sw/bin/make update switch
+ '';
+ startAt = cfg.dates;
+ onFailure = [ "status-email-root@%n.service" ];
+ };
+ }
+ )
+ ]
+ );
}