]> git.scottworley.com Git - auto-upgrade-with-pinch/blobdiff - modules/auto-upgrade.nix
Allow more-gentle "boot" (instead of "switch") updates
[auto-upgrade-with-pinch] / modules / auto-upgrade.nix
index 7d2404cefb21183d7701854288d1c3b6fba35291..5f5fe3ad6dbc5918509c9762dd0368fb7e3329d2 100644 (file)
@@ -197,7 +197,7 @@ let
       sync
 
       # Install
       sync
 
       # Install
-      hydrate ${config.system.build.nixos-rebuild}/bin/nixos-rebuild switch
+      hydrate ${config.system.build.nixos-rebuild}/bin/nixos-rebuild ${cfg.operation}
       sync
       while read user;do
         remove_arg=-r
       sync
       while read user;do
         remove_arg=-r
@@ -237,6 +237,20 @@ in
         '';
       };
 
         '';
       };
 
+      operation = lib.mkOption {
+        type = lib.types.enum [
+          "switch"
+          "boot"
+        ];
+        default = "switch";
+        example = "boot";
+        description = ''
+          Whether to run
+          `nixos-rebuild switch --upgrade` or run
+          `nixos-rebuild boot --upgrade`
+        '';
+      };
+
       signingKeys = mkOption {
         type = types.listOf types.path;
         description = ''
       signingKeys = mkOption {
         type = types.listOf types.path;
         description = ''