create auto upgrade module
This commit is contained in:
		| @@ -79,18 +79,7 @@ | ||||
|     montserrat | ||||
|   ]; | ||||
|  | ||||
|   # Some programs need SUID wrappers, can be configured further or are | ||||
|   # started in user sessions. | ||||
|   # programs.mtr.enable = true; | ||||
|   # programs.gnupg.agent = { | ||||
|   #   enable = true; | ||||
|   #   enableSSHSupport = true; | ||||
|   # }; | ||||
|   programs.ssh.startAgent = true; | ||||
|   programs.nix-ld.enable = true; | ||||
|   programs.nix-ld.libraries = [ | ||||
|   ]; | ||||
|  | ||||
|   programs.zsh.enable = true; | ||||
|   programs.steam.enable = true; | ||||
|  | ||||
| @@ -144,9 +133,6 @@ | ||||
|       game-devices-udev-rules | ||||
|       android-udev-rules | ||||
|     ]; | ||||
|     extraRules = '' | ||||
|       ACTION=="add", KERNEL=="event[0-9]*", DEVPATH="/devices/platform/AMDI0010:02/i2c-2/i2c-ELAN2513:00/0018:04F3:2D9C.0001/input/input[0-9]*/event[0-9]*", SYMLINK+="touchscreen0" | ||||
|     ''; | ||||
|   }; | ||||
|  | ||||
|   services.pipewire = { | ||||
| @@ -156,43 +142,8 @@ | ||||
|     pulse.enable = true; | ||||
|   }; | ||||
|  | ||||
|   # Enable the OpenSSH daemon. | ||||
|   # services.openssh.enable = true; | ||||
|  | ||||
|   # Open ports in the firewall. | ||||
|   # networking.firewall.allowedTCPPorts = [ ... ]; | ||||
|   # networking.firewall.allowedUDPPorts = [ ... ]; | ||||
|   # Or disable the firewall altogether. | ||||
|   # networking.firewall.enable = false; | ||||
|  | ||||
|   system.autoUpgrade = { | ||||
|     enable = true; | ||||
|     flake = inputs.self.outPath; | ||||
|     flags = [ | ||||
|       "--update-input" | ||||
|       "nixpkgs" | ||||
|       "--update-input" | ||||
|       "home-manager" | ||||
|       "--update-input" | ||||
|       "sops-nix" | ||||
|       "--update-input" | ||||
|       "musnix" | ||||
|       "--commit-lock-file" | ||||
|       "-L" | ||||
|     ]; | ||||
|     dates = "daily"; | ||||
|     randomizedDelaySec = "45min"; | ||||
|   }; | ||||
|  | ||||
|   boot.binfmt.emulatedSystems = ["aarch64-linux"]; | ||||
|  | ||||
|   nix.gc = { | ||||
|     automatic = true; | ||||
|     dates = "10:00"; | ||||
|     randomizedDelaySec = "45min"; | ||||
|     options = "--delete-older-than 14d"; | ||||
|   }; | ||||
|  | ||||
|   # This value determines the NixOS release from which the default | ||||
|   # settings for stateful data, like file locations and database versions | ||||
|   # on your system were taken. It‘s perfectly fine and recommended to leave | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
| }: let | ||||
|   cfg = config.myConfig; | ||||
| in { | ||||
|   imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix]; | ||||
|   imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix]; | ||||
|  | ||||
|   options.myConfig = { | ||||
|     enable = lib.mkEnableOption "my custom config"; | ||||
| @@ -18,6 +18,7 @@ in { | ||||
|     locale.enable = true; | ||||
|     rebuild.enable = true; | ||||
|     cache.enable = true; | ||||
|     autoUpdate.enable = true; | ||||
|  | ||||
|     greetd.enable = lib.mkIf cfg.desktop true; | ||||
|     sway.enable = lib.mkIf cfg.desktop true; | ||||
|   | ||||
							
								
								
									
										33
									
								
								modules/nixos/update.nix
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								modules/nixos/update.nix
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,33 @@ | ||||
| { | ||||
|   lib, | ||||
|   config, | ||||
|   inputs, | ||||
|   ... | ||||
| }: let | ||||
|   cfg = config.myConfig.autoUpdate; | ||||
| in { | ||||
|   options.myConfig.autoUpdate = { | ||||
|     enable = lib.mkEnableOption "extra binary caches"; | ||||
|   }; | ||||
|  | ||||
|   config = lib.mkIf cfg.enable { | ||||
|     system.autoUpgrade = { | ||||
|       enable = true; | ||||
|       flake = inputs.self.outPath; | ||||
|       flags = [ | ||||
|         "--recreate-lock-file" | ||||
|         "--commit-lock-file" | ||||
|         "-L" | ||||
|       ]; | ||||
|       dates = "9:00"; | ||||
|       randomizedDelaySec = "45min"; | ||||
|     }; | ||||
|  | ||||
|     nix.gc = { | ||||
|       automatic = true; | ||||
|       dates = "10:00"; | ||||
|       randomizedDelaySec = "45min"; | ||||
|       options = "--delete-older-than 14d"; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user