From 9166a9915a079e9c7e1a202552f2237121103669 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 14 Nov 2022 09:51:51 -0800 Subject: feat(wpcarro/nixos): Support kyoko Yet Another NixOS System Change-Id: I29590c5e7c2a651f3ef56642018649dddd9f06b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7297 Reviewed-by: wpcarro Tested-by: BuildkiteCI Reviewed-by: tazjin Autosubmit: wpcarro --- users/wpcarro/nixos/modules/hadrian-cache.nix | 17 ++++++++ .../nixos/modules/hardware/dell-emc-egw-5200.nix | 47 ++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 users/wpcarro/nixos/modules/hadrian-cache.nix create mode 100644 users/wpcarro/nixos/modules/hardware/dell-emc-egw-5200.nix (limited to 'users/wpcarro/nixos/modules') diff --git a/users/wpcarro/nixos/modules/hadrian-cache.nix b/users/wpcarro/nixos/modules/hadrian-cache.nix new file mode 100644 index 000000000000..033c03c825b7 --- /dev/null +++ b/users/wpcarro/nixos/modules/hadrian-cache.nix @@ -0,0 +1,17 @@ +# If enabled, use Hadrian's Nix cache. +{ config, lib, pkgs, ... }: + +{ + options = { + hadrian.cache.enable = lib.mkEnableOption "Hadrian's binary cache"; + }; + + config = lib.mkIf config.hadrian.cache.enable { + nix.settings.trusted-public-keys = [ + "cache.hadrian.internal:XWdYSn5ZASj6IqZd4nnDBXJmahQEolBrtq9DvSe0UT0=" + ]; + nix.settings.substituters = [ + "http://cache.hadrian.internal" + ]; + }; +} diff --git a/users/wpcarro/nixos/modules/hardware/dell-emc-egw-5200.nix b/users/wpcarro/nixos/modules/hardware/dell-emc-egw-5200.nix new file mode 100644 index 000000000000..df46405629c7 --- /dev/null +++ b/users/wpcarro/nixos/modules/hardware/dell-emc-egw-5200.nix @@ -0,0 +1,47 @@ +# In a nutshell, this configuration defines the configuration required to run +# NixOS on the Dell EMC EGW 5200 (often the config that NixOS put in +# hardware.nix by default). +{ config, lib, modulesPath, ... }: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + fileSystems."/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + + swapDevices = [ ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + # Needed for Tailscale subnet routing + boot.kernel.sysctl."net.ipv4.ip_forward" = 1; + networking.useDHCP = false; + networking.interfaces.eno1.useDHCP = true; + networking.interfaces.enp3s0.useDHCP = true; + networking.interfaces.enp4s0.useDHCP = true; + + system.stateVersion = "21.11"; +} -- cgit 1.4.1