autoupdate flake
This commit is contained in:
		
							parent
							
								
									4892136fd3
								
							
						
					
					
						commit
						7f3fbb6077
					
				
					 2 changed files with 40 additions and 1 deletions
				
			
		
							
								
								
									
										33
									
								
								modules/nixos/system/autoUpgrade/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								modules/nixos/system/autoUpgrade/default.nix
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| { | ||||
|   options, | ||||
|   config, | ||||
|   pkgs, | ||||
|   lib, | ||||
|   inputs, | ||||
|   ... | ||||
| }: | ||||
| with lib; | ||||
| with lib.wyrdgard; | ||||
| let | ||||
|   cfg = config.wyrdgard.system.autoUpgrade; | ||||
| in | ||||
| { | ||||
|   options.wyrdgard.system.autoUpgrade = with types; { | ||||
|     enable = mkEnableOption "Enable auto-upgrade"; | ||||
|     time = mkOpt str "02:00" "Time to run auto-upgrade"; | ||||
|   }; | ||||
| 
 | ||||
|   config = mkIf cfg.enable { | ||||
|     system.autoUpgrade = { | ||||
|       enable = true; | ||||
|       flake = inputs.self.outPath; | ||||
|       flags = [ | ||||
|         "--update-input" | ||||
|         "nixpkgs" | ||||
|         "--print-build-logs" | ||||
|       ]; | ||||
|       dates = cfg.time; | ||||
|       randomizedDelaySec = "45min"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue