Unverified Commit 6ac3a69b authored by Arnout Engelen's avatar Arnout Engelen Committed by GitHub
Browse files

nixos: autoUpgrade: allow disabling flake upgrades (#409185)

parents 830349f3 0d14c3cc
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -61,6 +61,16 @@ in
        '';
      };

      upgrade = lib.mkOption {
        type = lib.types.bool;
        default = true;
        description = ''
          Disable adding the `--upgrade` parameter when `channel`
          is not set, such as when upgrading to the latest version
          of a flake honouring its lockfile.
        '';
      };

      flags = lib.mkOption {
        type = lib.types.listOf lib.types.str;
        default = [ ];
@@ -235,7 +245,7 @@ in
          date = "${pkgs.coreutils}/bin/date";
          readlink = "${pkgs.coreutils}/bin/readlink";
          shutdown = "${config.systemd.package}/bin/shutdown";
          upgradeFlag = lib.optional (cfg.channel == null) "--upgrade";
          upgradeFlag = lib.optional (cfg.channel == null && cfg.upgrade) "--upgrade";
        in
        if cfg.allowReboot then
          ''