From 5b8e02a0dc48d26b12a3749272212a755b7b6298 Mon Sep 17 00:00:00 2001 From: serenity-F Date: Tue, 19 Nov 2024 19:34:20 +1000 Subject: [PATCH] updated hosts/hades --- hosts/hades/modules/extra.nix | 47 +++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 hosts/hades/modules/extra.nix diff --git a/hosts/hades/modules/extra.nix b/hosts/hades/modules/extra.nix new file mode 100644 index 0000000..af2d02e --- /dev/null +++ b/hosts/hades/modules/extra.nix @@ -0,0 +1,47 @@ +{ lib, config, modulesPath, pkgs, ... }: + +{ + ## Enable swap on luks + boot = { + initrd = { + systemd.enable = true; + secrets = { "/boot/crypto_keyfile.bin" = null; }; + luks = { + devices = { + "luks-b964f685-be70-4f87-9bd2-00cb7ba0e756" = { + device = "/dev/disk/by-uuid/b964f685-be70-4f87-9bd2-00cb7ba0e756"; + keyFile = "/boot/crypto_keyfile.bin"; + }; + "luks-6779ede9-16e6-42f4-a13e-6da0627f8d45" = { + device = "/dev/disk/by-uuid/6779ede9-16e6-42f4-a13e-6da0627f8d45"; + keyFile = "/boot/crypto_keyfile.bin"; + }; + }; + }; + }; + + loader = { + efi = { canTouchEfiVariables = true; }; + ## For some reason GPT/UEFI didn't work, so neither does systemd-boot + ## stuck using MBR/DOS and GRUB instead + grub = { + enable = true; + device = "/dev/nvme0n1"; + useOSProber = true; + enableCryptodisk = true; + }; + }; + + }; + ## 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.enp0s31f6.useDHCP = lib.mkDefault true; + #networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = + lib.mkDefault config.hardware.enableRedistributableFirmware; +}