commit 4a918699614600b4d23a4476f97ab7d7003b587c parent d910d93c90fb8b6eee9121c671f309cefb6a6966 Author: Vincent Demeester <vincent@sbr.pm> Date: Sun, 26 Apr 2020 13:28:38 +0200 Bump to 20.03 Signed-off-by: Vincent Demeester <vincent@sbr.pm> Diffstat:
M | tmp/nixos-configuration/modules/profiles/nix-auto-update.nix | | | 61 | +++++++++++++++++++++++++++++++++---------------------------- |
1 file changed, 33 insertions(+), 28 deletions(-)
diff --git a/tmp/nixos-configuration/modules/profiles/nix-auto-update.nix b/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" ]; + }; + } + ) + ] + ); }