rp5: finally working nix-sdcard, enableing remote build on the nix system now
This commit is contained in:
		
							parent
							
								
									c424ccbd07
								
							
						
					
					
						commit
						3703a46675
					
				
					 4 changed files with 73 additions and 23 deletions
				
			
		|  | @ -45,6 +45,10 @@ in | ||||||
|       nixfmt-rfc-style |       nixfmt-rfc-style | ||||||
|       nix-prefetch-git |       nix-prefetch-git | ||||||
|       nix-du |       nix-du | ||||||
|  | 
 | ||||||
|  |       nix-weather | ||||||
|  |       nix-index | ||||||
|  |       nix-output-monitor | ||||||
|     ]; |     ]; | ||||||
| 
 | 
 | ||||||
|     nix = |     nix = | ||||||
|  |  | ||||||
|  | @ -36,6 +36,9 @@ in | ||||||
|       nix = { |       nix = { | ||||||
|         enable = true; |         enable = true; | ||||||
|         extra-substituters = { |         extra-substituters = { | ||||||
|  |           "https://cache.lix.systems" = { | ||||||
|  |             key = "cache.lix.systems:aBnZUw8zA7H35Cz2RyKFVs3H4PlGTLawyY5KRbvJR8o="; | ||||||
|  |           }; | ||||||
|           "https://nix-community.cachix.org" = { |           "https://nix-community.cachix.org" = { | ||||||
|             key = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; |             key = "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; | ||||||
|           }; |           }; | ||||||
|  |  | ||||||
|  | @ -3,7 +3,6 @@ | ||||||
|   lib, |   lib, | ||||||
|   modulesPath, |   modulesPath, | ||||||
|   namespace, |   namespace, | ||||||
|   pkgs, |  | ||||||
|   ... |   ... | ||||||
| }: | }: | ||||||
| 
 | 
 | ||||||
|  | @ -17,8 +16,63 @@ in | ||||||
|     raspberry-pi-5 |     raspberry-pi-5 | ||||||
|   ]; |   ]; | ||||||
| 
 | 
 | ||||||
|   raspberry-pi-nix.board = "bcm2711"; |   users.users.remotebuild = { | ||||||
|  |     isNormalUser = true; | ||||||
|  |     createHome = false; | ||||||
|  |     group = "remotebuild"; | ||||||
| 
 | 
 | ||||||
|  |     openssh.authorizedKeys.keys = [ | ||||||
|  |       "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil" | ||||||
|  |     ]; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   users.groups.remotebuild = { }; | ||||||
|  | 
 | ||||||
|  |   nix = { | ||||||
|  |     nrBuildUsers = 64; | ||||||
|  |     settings = { | ||||||
|  |       trusted-users = [ "remotebuild" ]; | ||||||
|  | 
 | ||||||
|  |       min-free = 10 * 1024 * 1024; | ||||||
|  |       max-free = 200 * 1024 * 1024; | ||||||
|  | 
 | ||||||
|  |       max-jobs = "auto"; | ||||||
|  |       cores = 0; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   systemd.services.nix-daemon.serviceConfig = { | ||||||
|  |     MemoryAccounting = true; | ||||||
|  |     MemoryMax = "90%"; | ||||||
|  |     OOMScoreAdjust = 500; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   networking = { | ||||||
|  |     interfaces.wlan0 = { | ||||||
|  |       ipv4.addresses = [ | ||||||
|  |         { | ||||||
|  |           address = "192.168.178.2"; | ||||||
|  |           prefixLength = 24; | ||||||
|  |         } | ||||||
|  |       ]; | ||||||
|  |     }; | ||||||
|  |     defaultGateway = { | ||||||
|  |       address = "192.168.178.1"; | ||||||
|  |       interface = "wlan0"; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     wireless = { | ||||||
|  |       enable = true; | ||||||
|  |       networks = { | ||||||
|  |         "Slow Internet" = { | ||||||
|  |           pskRaw = "521b6d766b27276c29c7b6bec5b495b1c52bf88b0682277e65b37dc649b630de"; | ||||||
|  |         }; | ||||||
|  |       }; | ||||||
|  |     }; | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   # Pi specific stuff   | ||||||
|  |   raspberry-pi-nix.board = "bcm2712"; | ||||||
|   hardware = { |   hardware = { | ||||||
|     raspberry-pi = { |     raspberry-pi = { | ||||||
|       config = { |       config = { | ||||||
|  | @ -53,19 +107,14 @@ in | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   ${namespace} = { |   ${namespace} = { | ||||||
|     submodules = { |     submodules.basics = enabled; | ||||||
|       basics = enabled; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     apps.cli-apps.helix = { |  | ||||||
|       pkg = pkgs.helix; |  | ||||||
|     }; |  | ||||||
| 
 | 
 | ||||||
|     system = { |     system = { | ||||||
|       boot = { |       # cachemiss for webkit gtk | ||||||
|         # Raspberry Pi requires a specific bootloader. |       hardware.networking.enable = mkForce false; | ||||||
|         enable = mkForce false; | 
 | ||||||
|       }; |       # rasberry pi uses alternative boot settings | ||||||
|  |       boot.enable = mkForce false; | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     user.trustedPublicKeys = [ |     user.trustedPublicKeys = [ | ||||||
|  |  | ||||||
|  | @ -33,9 +33,11 @@ in | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   nix = { |   nix = { | ||||||
|  |     distributedBuilds = true; | ||||||
|  |     settings.builders-use-substitutes = true; | ||||||
|     buildMachines = [ |     buildMachines = [ | ||||||
|       { |       { | ||||||
|         hostName = "pi"; |         hostName = "nixberry"; | ||||||
|         sshUser = "remotebuild"; |         sshUser = "remotebuild"; | ||||||
|         sshKey = "/root/.ssh/remotebuild"; |         sshKey = "/root/.ssh/remotebuild"; | ||||||
|         systems = [ "aarch64-linux" ]; |         systems = [ "aarch64-linux" ]; | ||||||
|  | @ -44,18 +46,10 @@ in | ||||||
|         supportedFeatures = [ |         supportedFeatures = [ | ||||||
|           "nixos-test" |           "nixos-test" | ||||||
|           "big-parallel" |           "big-parallel" | ||||||
|  |           "kvm" | ||||||
|         ]; |         ]; | ||||||
|       } |       } | ||||||
|     ]; |     ]; | ||||||
| 
 |  | ||||||
|     distributedBuilds = true; |  | ||||||
|     settings = { |  | ||||||
|       trusted-users = [ |  | ||||||
|         "@wheel" |  | ||||||
|         "remotebuild" |  | ||||||
|       ]; |  | ||||||
|       trusted-public-keys = [ "nixberry:25s8/rxsolAXg4skjnecCeqcfkxYE9FGCPG5UcXsFlw=" ]; |  | ||||||
|     }; |  | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   ${namespace} = { |   ${namespace} = { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue