From 9ae49713158709a4c5da425bb481c6cc2d9f05ae Mon Sep 17 00:00:00 2001 From: Jake Hillion Date: Sun, 4 Dec 2022 13:24:08 +0000 Subject: [PATCH] microserver.home: add hardware configuration --- .../default.nix | 7 ++++ .../hardware-configuration.nix | 36 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 hosts/microserver.home.ts.hillion.co.uk/hardware-configuration.nix diff --git a/hosts/microserver.home.ts.hillion.co.uk/default.nix b/hosts/microserver.home.ts.hillion.co.uk/default.nix index 2ff3f9e..774664f 100644 --- a/hosts/microserver.home.ts.hillion.co.uk/default.nix +++ b/hosts/microserver.home.ts.hillion.co.uk/default.nix @@ -7,9 +7,16 @@ config.networking.domain = "home.ts.hillion.co.uk"; imports = [ + ./hardware-configuration.nix ../../modules/common/default.nix ]; + config.boot.loader.grub.enable = false; + config.boot.loader.raspberryPi = { + enable = true; + version = 4; + }; + # Networking ## Tailscale config.tailscaleAdvertiseRoutes = "10.64.50.0/24,10.239.19.0/24"; diff --git a/hosts/microserver.home.ts.hillion.co.uk/hardware-configuration.nix b/hosts/microserver.home.ts.hillion.co.uk/hardware-configuration.nix new file mode 100644 index 0000000..6cb0846 --- /dev/null +++ b/hosts/microserver.home.ts.hillion.co.uk/hardware-configuration.nix @@ -0,0 +1,36 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eth0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + # networking.interfaces.vlan2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +}