Small refactor, try and mount the other drive on /boot for wheatley
This commit is contained in:
		
							parent
							
								
									00ab03d64d
								
							
						
					
					
						commit
						04bebfaebb
					
				
					 3 changed files with 52 additions and 31 deletions
				
			
		
							
								
								
									
										35
									
								
								nixos/board/package-configs/pi-hole/configuration.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								nixos/board/package-configs/pi-hole/configuration.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,35 @@
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  inputs,
 | 
				
			||||||
 | 
					  outputs,
 | 
				
			||||||
 | 
					  lib,
 | 
				
			||||||
 | 
					  config,
 | 
				
			||||||
 | 
					  pkgs,
 | 
				
			||||||
 | 
					  ...
 | 
				
			||||||
 | 
					}: {
 | 
				
			||||||
 | 
					  services.pihole = {
 | 
				
			||||||
 | 
					    enable = true;
 | 
				
			||||||
 | 
					    hostConfig = {
 | 
				
			||||||
 | 
					      # define the service user for running the rootless Pi-hole container
 | 
				
			||||||
 | 
					      user = "pihole";
 | 
				
			||||||
 | 
					      enableLingeringForUser = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # we want to persist change to the Pi-hole configuration & logs across service restarts
 | 
				
			||||||
 | 
					      # check the option descriptions for more information
 | 
				
			||||||
 | 
					      persistVolumes = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      # expose DNS & the web interface on unpriviledged ports on all IP addresses of the host
 | 
				
			||||||
 | 
					      # check the option descriptions for more information
 | 
				
			||||||
 | 
					      dnsPort = 5335;
 | 
				
			||||||
 | 
					      webProt = 8080;
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    piholeConfig.ftl = {
 | 
				
			||||||
 | 
					      # assuming that the host has this (fixed) IP and should resolve "pi.hole" to this address
 | 
				
			||||||
 | 
					      # check the option description & the FTLDNS documentation for more information
 | 
				
			||||||
 | 
					      LOCAL_IPV4 = "192.168.0.2";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					    piholeCOnfig.web = {
 | 
				
			||||||
 | 
					      virtualHost = "pi.hole";
 | 
				
			||||||
 | 
					      password = "password";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					  };
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -82,33 +82,6 @@
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  services.pihole = {
 | 
					 | 
				
			||||||
    enable = true;
 | 
					 | 
				
			||||||
    hostConfig = {
 | 
					 | 
				
			||||||
      # define the service user for running the rootless Pi-hole container
 | 
					 | 
				
			||||||
      user = "pihole";
 | 
					 | 
				
			||||||
      enableLingeringForUser = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      # we want to persist change to the Pi-hole configuration & logs across service restarts
 | 
					 | 
				
			||||||
      # check the option descriptions for more information
 | 
					 | 
				
			||||||
      persistVolumes = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      # expose DNS & the web interface on unpriviledged ports on all IP addresses of the host
 | 
					 | 
				
			||||||
      # check the option descriptions for more information
 | 
					 | 
				
			||||||
      dnsPort = 5335;
 | 
					 | 
				
			||||||
      webProt = 8080;
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    piholeConfig.ftl = {
 | 
					 | 
				
			||||||
      # assuming that the host has this (fixed) IP and should resolve "pi.hole" to this address
 | 
					 | 
				
			||||||
      # check the option description & the FTLDNS documentation for more information
 | 
					 | 
				
			||||||
      LOCAL_IPV4 = "192.168.0.2";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
    piholeCOnfig.web = {
 | 
					 | 
				
			||||||
      virtualHost = "pi.hole";
 | 
					 | 
				
			||||||
      password = "password";
 | 
					 | 
				
			||||||
    };
 | 
					 | 
				
			||||||
  };
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  networking.wireless.enable = true;
 | 
					  networking.wireless.enable = true;
 | 
				
			||||||
  networking.wireless.environmentFile = config.sops.secrets."wireless.env".path;
 | 
					  networking.wireless.environmentFile = config.sops.secrets."wireless.env".path;
 | 
				
			||||||
  networking.wireless.networks."KPNAA6306" = {
 | 
					  networking.wireless.networks."KPNAA6306" = {
 | 
				
			||||||
| 
						 | 
					@ -158,7 +131,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  networking.hostName = "wheatley"; # Define your hostname
 | 
					  networking.hostName = "wheatley"; # Define your hostname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  networking.wireless.interfaces = ["wlan0"];
 | 
					  networking.wireless.interfaces = ["enu1u1"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # powerManagement.cpuFreqGovernor = "powersave";
 | 
					  # powerManagement.cpuFreqGovernor = "powersave";
 | 
				
			||||||
  powerManagement.cpufreq.max = 648000;
 | 
					  powerManagement.cpufreq.max = 648000;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +17,20 @@
 | 
				
			||||||
  boot.kernelModules = [];
 | 
					  boot.kernelModules = [];
 | 
				
			||||||
  boot.extraModulePackages = [];
 | 
					  boot.extraModulePackages = [];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  fileSystems."/" = {
 | 
					  fileSystems = {
 | 
				
			||||||
    device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
 | 
					    # Prior to 19.09, the boot partition was hosted on the smaller first partition
 | 
				
			||||||
    fsType = "ext4";
 | 
					    # Starting with 19.09, the /boot folder is on the main bigger partition.
 | 
				
			||||||
 | 
					    # The following is to be used only with older images. Note such old images should not be considered supported anymore whatsoever, but if you installed back then, this might be needed
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    "/boot" = {
 | 
				
			||||||
 | 
					      device = "/dev/disk/by-label/FIRMWARE";
 | 
				
			||||||
 | 
					      fsType = "vfat";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    "/" = {
 | 
				
			||||||
 | 
					      device = "/dev/disk/by-label/NIXOS_SD";
 | 
				
			||||||
 | 
					      fsType = "ext4";
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  swapDevices = [{device = "/dev/disk/by-uuid/4c9c8850-5e2e-4b4b-8ebb-4d7306012535";}];
 | 
					  swapDevices = [{device = "/dev/disk/by-uuid/4c9c8850-5e2e-4b4b-8ebb-4d7306012535";}];
 | 
				
			||||||
| 
						 | 
					@ -35,4 +46,6 @@
 | 
				
			||||||
  # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
 | 
					  # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  nixpkgs.hostPlatform = lib.mkDefault "armv7l-linux";
 | 
					  nixpkgs.hostPlatform = lib.mkDefault "armv7l-linux";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue