From c9ac78a81a6695264eda8f06bcbbab701f907a5b Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Sun, 14 Jan 2024 15:58:21 +0100 Subject: [PATCH] Small refactor, try and mount the other drive on /boot for wheatley --- .../package-configs/pi-hole/configuration.nix | 35 +++++++++++++++++++ nixos/hosts/wheatley/configuration.nix | 29 +-------------- .../hosts/wheatley/hardware-configuration.nix | 19 ++++++++-- 3 files changed, 52 insertions(+), 31 deletions(-) create mode 100644 nixos/board/package-configs/pi-hole/configuration.nix diff --git a/nixos/board/package-configs/pi-hole/configuration.nix b/nixos/board/package-configs/pi-hole/configuration.nix new file mode 100644 index 0000000..7ce2716 --- /dev/null +++ b/nixos/board/package-configs/pi-hole/configuration.nix @@ -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"; + }; + }; +} diff --git a/nixos/hosts/wheatley/configuration.nix b/nixos/hosts/wheatley/configuration.nix index dd6adbd..1c45303 100644 --- a/nixos/hosts/wheatley/configuration.nix +++ b/nixos/hosts/wheatley/configuration.nix @@ -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.environmentFile = config.sops.secrets."wireless.env".path; networking.wireless.networks."KPNAA6306" = { @@ -158,7 +131,7 @@ networking.hostName = "wheatley"; # Define your hostname - networking.wireless.interfaces = ["wlan0"]; + networking.wireless.interfaces = ["enu1u1"]; # powerManagement.cpuFreqGovernor = "powersave"; powerManagement.cpufreq.max = 648000; diff --git a/nixos/hosts/wheatley/hardware-configuration.nix b/nixos/hosts/wheatley/hardware-configuration.nix index a96194a..466da96 100644 --- a/nixos/hosts/wheatley/hardware-configuration.nix +++ b/nixos/hosts/wheatley/hardware-configuration.nix @@ -17,9 +17,20 @@ boot.kernelModules = []; boot.extraModulePackages = []; - fileSystems."/" = { - device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; - fsType = "ext4"; + fileSystems = { + # Prior to 19.09, the boot partition was hosted on the smaller first partition + # 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";}]; @@ -35,4 +46,6 @@ # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "armv7l-linux"; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; }