From 5f1bb9299dcf8fd948b696dae291303f40ef414e Mon Sep 17 00:00:00 2001 From: Updater Date: Wed, 20 Dec 2023 04:00:02 -0500 Subject: [PATCH] feat(oksys): add hw config --- devices/oksys/default.nix | 2 +- devices/oksys/hardware-configuration.nix | 45 ++++++++++++++++++++++++ devices/oksys/modules/caddy.nix | 1 + devices/oksys/modules/headscale.nix | 1 + 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 devices/oksys/hardware-configuration.nix diff --git a/devices/oksys/default.nix b/devices/oksys/default.nix index 49e2d61..4c7756a 100644 --- a/devices/oksys/default.nix +++ b/devices/oksys/default.nix @@ -1,6 +1,6 @@ {config, ...}: { imports = [ - #./hardware-configuration.nix + ./hardware-configuration.nix ../../modules/tailscale.nix diff --git a/devices/oksys/hardware-configuration.nix b/devices/oksys/hardware-configuration.nix new file mode 100644 index 0000000..da5a35e --- /dev/null +++ b/devices/oksys/hardware-configuration.nix @@ -0,0 +1,45 @@ +{ + config, + modulesPath, + ... +}: { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + + services.logind.lidSwitchExternalPower = "ignore"; + + boot = { + loader = { + timeout = 2; + + grub = { + enable = true; + device = "/dev/sda"; + }; + }; + initrd.availableKernelModules = [ + "uhci_hcd" + "ehci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + }; + + zramSwap.enable = true; + + hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; +} diff --git a/devices/oksys/modules/caddy.nix b/devices/oksys/modules/caddy.nix index 53c0bcf..fe2a595 100644 --- a/devices/oksys/modules/caddy.nix +++ b/devices/oksys/modules/caddy.nix @@ -6,6 +6,7 @@ }: let caddy = caddy-plugins.packages.${pkgs.system}.default; in { + # FIXME: doesn't close on shutdown imports = [caddy-plugins.nixosModules.default]; environment.systemPackages = [caddy]; users.users.${config.vars.user}.extraGroups = ["caddy"]; diff --git a/devices/oksys/modules/headscale.nix b/devices/oksys/modules/headscale.nix index 5ce30fe..eb9bddc 100644 --- a/devices/oksys/modules/headscale.nix +++ b/devices/oksys/modules/headscale.nix @@ -6,6 +6,7 @@ }: let headscale-flake = headscale.packages.${pkgs.system}.headscale; in { + # FIXME: no permissions environment.systemPackages = [headscale-flake]; users.users.${config.vars.user}.extraGroups = ["headscale"];