diff --git a/flake.nix b/flake.nix index bdbfd55..538dc62 100644 --- a/flake.nix +++ b/flake.nix @@ -170,6 +170,8 @@ system = "x86_64-linux"; modules = [ ./hostconfig/ZeNixComputa/extra_info.nix + ./hostconfig/ZeNixComputa/hardware-configuration.nix + ./hostconfig/ZeNixComputa/nixos.nix self.nixosModules.minimal self.nixosModules.personal-cli self.nixosModules.personal-gui diff --git a/hostconfig/ZeNixComputa/hardware-configuration.nix b/hostconfig/ZeNixComputa/hardware-configuration.nix new file mode 100644 index 0000000..b4eaed2 --- /dev/null +++ b/hostconfig/ZeNixComputa/hardware-configuration.nix @@ -0,0 +1,47 @@ +# 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" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = ["dm-snapshot"]; + boot.kernelModules = ["kvm-amd"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/62ddc566-fac0-4461-be44-0deb96c40b34"; + fsType = "btrfs"; + }; + + fileSystems."/home" = { + device = "/dev/disk/by-uuid/2f50d18f-1efd-4cc4-aae9-9f64f15585e3"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/564B-4D0E"; + fsType = "vfat"; + }; + fileSystems."/longstorage" = { + device = "/dev/disk/by-uuid/15a593ec-7197-46f8-aeeb-004f1f3322e2"; + fsType = "btrfs"; + }; + + fileSystems."/oldhome" = { + device = "/dev/disk/by-uuid/611ae8bc-1f5a-4be8-86b6-fae42d183c0f"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/91c2f707-02a2-4b0b-a683-42d70751e5b9";} + ]; +} diff --git a/hostconfig/ZeNixComputa/nixos.nix b/hostconfig/ZeNixComputa/nixos.nix new file mode 100644 index 0000000..509572c --- /dev/null +++ b/hostconfig/ZeNixComputa/nixos.nix @@ -0,0 +1,69 @@ +{ + boot.initrd = { + enable = true; + availableKernelModules = ["amdgpu" "r8169"]; + luks = { + yubikeySupport = true; + + devices = let + yubikey = { + slot = 2; + twoFactor = false; + storage.device = "/dev/disk/by-uuid/564B-4D0E"; + }; + in { + nixos-root = { + device = "/dev/disk/by-uuid/cca61c58-e022-47ad-b9fd-9af9d2fa8abb"; + preLVM = true; + }; + nixos-home = { + device = "/dev/disk/by-uuid/c21561bf-5714-4cd2-8f37-d5880f76910d"; + preLVM = true; + }; + long-storage = { + device = "/dev/disk/by-uuid/670bf56f-fd3d-4127-b598-6bde4d2f2c27"; + preLVM = true; + }; + old-ssd = { + device = "/dev/disk/by-uuid/35326fe8-b0ce-4939-bdf1-5b3e180ed057"; + preLVM = true; + }; + }; + }; + + # secrets = { + # "/etc/secrets/initrd/keyfile" = "/etc/secrets/initrd/keyfile"; + # }; + # kernelParams = [ "iomem=relaxed" ]; + network.ssh = { + enable = true; + port = 8022; + }; + }; + boot.loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; + + boot.kernelParams = [ + "video=HDMI-A-1:1920x1080@75" + "video=DP-2:1920x1080@75" + ]; + + networking = { + hostName = "ZeNixComputa"; + interfaces = { + enp4s0.useDHCP = true; + }; + }; + + users.users.traxys.uid = 1000; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.05"; # Did you read the comment? +} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index c24a328..96db549 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -3,8 +3,6 @@ # and in the NixOS manual (accessible by running ‘nixos-help’). {pkgs, ...}: { imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix ./localcfg.nix ./cachix.nix ]; diff --git a/nixos/localcfg.nix b/nixos/localcfg.nix index 28df1b9..6227a2b 100644 --- a/nixos/localcfg.nix +++ b/nixos/localcfg.nix @@ -3,37 +3,6 @@ pkgs, ... }: { - boot = { - initrd = { - luks.devices = { - root = { - device = "/dev/disk/by-uuid/de0242ac-788a-44fc-a1ef-8d7bfaa448c6"; - preLVM = true; - #keyFile = "/etc/secrets/initrd/keyfile"; - fallbackToPassword = true; - }; - home = { - device = "/dev/disk/by-uuid/b028c674-64c5-40e0-88c4-481d78854049"; - preLVM = true; - #keyFile = "/etc/secrets/initrd/keyfile"; - fallbackToPassword = true; - }; - }; - secrets = { - "/etc/secrets/initrd/keyfile" = "/etc/secrets/initrd/keyfile"; - }; - #kernelParams = [ "iomem=relaxed" ]; - }; - loader = { - grub = { - enable = true; - version = 2; - device = "nodev"; - enableCryptodisk = true; - }; - }; - }; - /* services.xserver = { enable = true; @@ -56,7 +25,6 @@ users = { users = { traxys = { - uid = 1000; extraGroups = [ "wheel" "http"