diff --git a/nodes/hosts/nixwork/configuration.nix b/nodes/hosts/nixwork/configuration.nix new file mode 100644 index 0000000..e837664 --- /dev/null +++ b/nodes/hosts/nixwork/configuration.nix @@ -0,0 +1,22 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./programs/sof-firmware.nix + # Not working yet. + #./services/fprintd.nix + ./services/touchpad.nix + ./system/bootloader.nix + ./system/filesystems.nix + ./system/networking.nix + ]; + + system.stateVersion = "25.05"; # Did you read the comment? +} + diff --git a/nodes/hosts/nixwork/disk-config.nix b/nodes/hosts/nixwork/disk-config.nix new file mode 100644 index 0000000..4dc3b08 --- /dev/null +++ b/nodes/hosts/nixwork/disk-config.nix @@ -0,0 +1,110 @@ +{ + disko.devices = { + disk = { + nvme1n1 = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + label = "boot"; + name = "ESP"; + size = "4500M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + "defaults" + ]; + }; + }; + luks = { + size = "100%"; + label = "luks"; + content = { + type = "luks"; + name = "cryptroot"; + # disable settings.keyFile if you want to use interactive password entry + #passwordFile = "/tmp/secret.key"; # Interactive + settings = { + allowDiscards = true; + #keyFile = "/tmp/secret.key"; + }; + + #additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + content = { + type = "btrfs"; + extraArgs = [ "-L" "nixos" "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ + "subvol=root" + "compress=zstd" + "noatime" + ]; + }; + "/root-blank" = { + mountOptions = [ + "subvol=root-blank" + "nodatacow" + "noatime" + ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ + "subvol=home" + "compress=zstd" + "noatime" + ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; + }; + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ + "subvol=persist" + "compress=zstd" + "noatime" + ]; + }; + "/log" = { + mountpoint = "/var/log"; + mountOptions = [ + "subvol=log" + "compress=zstd" + "noatime" + ]; + }; + "/lib" = { + mountpoint = "/var/lib"; + mountOptions = [ + "subvol=lib" + "compress=zstd" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; + fileSystems."/persist".neededForBoot = true; + fileSystems."/var/log".neededForBoot = true; + fileSystems."/var/lib".neededForBoot = true; +} diff --git a/nodes/hosts/nixwork/hardware-configuration.nix b/nodes/hosts/nixwork/hardware-configuration.nix new file mode 100644 index 0000000..5dc85ef --- /dev/null +++ b/nodes/hosts/nixwork/hardware-configuration.nix @@ -0,0 +1,14 @@ +# 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, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + hardware.xpadneo.enable = true; +} diff --git a/nodes/hosts/nixwork/home/jay/home.nix b/nodes/hosts/nixwork/home/jay/home.nix new file mode 100644 index 0000000..38178c2 --- /dev/null +++ b/nodes/hosts/nixwork/home/jay/home.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + imports = [ + ./programs/hyprland.nix + ./programs/hyprpanel.nix + ]; +} + diff --git a/nodes/hosts/nixwork/home/jay/programs/hyprland.nix b/nodes/hosts/nixwork/home/jay/programs/hyprland.nix new file mode 100644 index 0000000..d8ca801 --- /dev/null +++ b/nodes/hosts/nixwork/home/jay/programs/hyprland.nix @@ -0,0 +1,7 @@ +{ ... }: { + wayland.windowManager.hyprland = { + settings = { + "monitor" = "eDP-1, 2880x1800@120, 0x0, 1"; + }; + }; +} diff --git a/nodes/hosts/nixwork/home/jay/programs/hyprpanel.nix b/nodes/hosts/nixwork/home/jay/programs/hyprpanel.nix new file mode 100644 index 0000000..87ae744 --- /dev/null +++ b/nodes/hosts/nixwork/home/jay/programs/hyprpanel.nix @@ -0,0 +1,19 @@ +{ lib, ... }: { + programs.hyprpanel = { + settings = { + "bar.layouts" = { + "0" = { + right = [ "battery" ]; + }; + }; + + bar = { + customModules = { + cava = { + framerate = lib.mkForce 120; + }; + }; + }; + }; + }; +} diff --git a/nodes/hosts/nixwork/node.nix b/nodes/hosts/nixwork/node.nix new file mode 100644 index 0000000..0bc182d --- /dev/null +++ b/nodes/hosts/nixwork/node.nix @@ -0,0 +1,4 @@ +{ + os = "nixos"; + channel = "stable"; +} diff --git a/nodes/hosts/nixwork/programs/sof-firmware.nix b/nodes/hosts/nixwork/programs/sof-firmware.nix new file mode 100644 index 0000000..4e9d9ec --- /dev/null +++ b/nodes/hosts/nixwork/programs/sof-firmware.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = [ + pkgs.sof-firmware + ]; +} + diff --git a/nodes/hosts/nixwork/services/fprintd.nix b/nodes/hosts/nixwork/services/fprintd.nix new file mode 100644 index 0000000..290efe6 --- /dev/null +++ b/nodes/hosts/nixwork/services/fprintd.nix @@ -0,0 +1,5 @@ +{ pkgs, ...}: { + services.fprintd.enable = true; + services.fprintd.tod.enable = true; + services.fprintd.tod.driver = pkgs.libfprint-2-tod1-goodix-550a; +} diff --git a/nodes/hosts/nixwork/services/touchpad.nix b/nodes/hosts/nixwork/services/touchpad.nix new file mode 100644 index 0000000..4353925 --- /dev/null +++ b/nodes/hosts/nixwork/services/touchpad.nix @@ -0,0 +1,4 @@ +{ ... }: { + # Enable touchpad support (enabled default in most desktopManager). + services.libinput.enable = true; +} diff --git a/nodes/hosts/nixwork/system/bootloader.nix b/nodes/hosts/nixwork/system/bootloader.nix new file mode 100644 index 0000000..c551f97 --- /dev/null +++ b/nodes/hosts/nixwork/system/bootloader.nix @@ -0,0 +1,52 @@ +{ config, ... }: { + boot = { + tmp = { + useTmpfs = true; + tmpfsSize = "50%"; + }; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = with config.boot.kernelPackages; [ xpadneo ]; + extraModprobeConfig = '' options bluetooth disable_ertm=1 ''; + + initrd = { + + # OLD CONFIG + # NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS + # nvme0n1 + # └─nvme0n1p1 crypto_LUKS 2 e174181f-828c-44fd-97c1-0e2fdc2322e5 + # └─luks-e174181f-828c-44fd-97c1-0e2fdc2322e5 btrfs home f8ed950a-5cc9-4b87-901c-4cfece6daf6c 3.3T 9% /home + # luks.devices."luks-e174181f-828c-44fd-97c1-0e2fdc2322e5".device = "/dev/disk/by-uuid/e174181f-828c-44fd-97c1-0e2fdc2322e5"; + # nvme1n1 + # ├─nvme1n1p1 vfat FAT32 D19B-1967 4.3G 3% /boot + # ├─nvme1n1p2 crypto_LUKS 2 300fdb2a-d887-4e53-bc97-9fdc123856ce + # │ └─luks-300fdb2a-d887-4e53-bc97-9fdc123856ce swap 1 swap 66b9e1f6-1fc5-4c32-afc7-724880504495 [SWAP] + # luks.devices."luks-300fdb2a-d887-4e53-bc97-9fdc123856ce".device = "/dev/disk/by-uuid/300fdb2a-d887-4e53-bc97-9fdc123856ce"; + # └─nvme1n1p3 crypto_LUKS 2 e69c5d63-f5a7-4cb1-a858-4e6396d8def7 + # └─luks-e69c5d63-f5a7-4cb1-a858-4e6396d8def7 btrfs root f53b22d4-df74-4ee0-9f85-3fb0eb087150 /nix/store + # luks.devices."luks-e69c5d63-f5a7-4cb1-a858-4e6396d8def7".device = "/dev/disk/by-uuid/e69c5d63-f5a7-4cb1-a858-4e6396d8def7"; + + # NEW CONFIG + # nvme0n1 + # └─nvme0n1p1 crypto_LUKS 2 1976c849-c317-46c0-af98-d2dfc455c489 + # └─crypthome btrfs home c63ca365-e963-4ea4-bb71-ed1c7e1b6bc8 /mnt/home + # luks.devices."crypthome".device = "/dev/disk/by-uuid/1976c849-c317-46c0-af98-d2dfc455c489"; + # nvme1n1 + # ├─nvme1n1p1 vfat FAT32 CDA0-8838 4.4G 0% /mnt/boot + # └─nvme1n1p2 crypto_LUKS 2 e948662c-ae57-46aa-b7bf-cc09dbaa8cdb + # └─cryptroot btrfs nixos 77021dd1-9fa5-4e9f-9be2-ba943e6de77c 925.1G 0% /mnt/var/log + # /mnt/persist + # /mnt/nix + # /mnt + luks.devices."cryptroot" = { + device = "/dev/disk/by-partlabel/luks"; + allowDiscards = true; + }; + + kernelModules = [ ]; + + availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ]; + + }; + }; +} + diff --git a/nodes/hosts/nixwork/system/filesystems.nix b/nodes/hosts/nixwork/system/filesystems.nix new file mode 100644 index 0000000..576ecdb --- /dev/null +++ b/nodes/hosts/nixwork/system/filesystems.nix @@ -0,0 +1,54 @@ +{ ... }: { + + fileSystems."/" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=root" "compress=zstd" "noatime" ]; + }; + + fileSystems."/home" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=home" "compress=zstd" "noatime" ]; + }; + + fileSystems."/nix" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=nix" "compress=zstd" "noatime" ]; + }; + + fileSystems."/var/log" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=log" "compress=zstd" "noatime" ]; + neededForBoot = true; + }; + + fileSystems."/var/lib" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=lib" "compress=zstd" "noatime" ]; + neededForBoot = true; + }; + + fileSystems."/persist" = + { device = "/dev/mapper/cryptroot"; + fsType = "btrfs"; + options = [ "subvol=persist" "compress=zstd" "noatime" ]; + neededForBoot = true; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-partlabel/boot"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [{ + device = "/swapfile"; + size = 18 * 1024; + }]; + +} + diff --git a/nodes/hosts/nixwork/system/networking.nix b/nodes/hosts/nixwork/system/networking.nix new file mode 100644 index 0000000..0fe2fbf --- /dev/null +++ b/nodes/hosts/nixwork/system/networking.nix @@ -0,0 +1,4 @@ +{ ... }: { + networking.hostName = "lappy"; # Define your hostname. +} +