diff --git a/flake.nix b/flake.nix index fbbb7dc..95ce4be 100644 --- a/flake.nix +++ b/flake.nix @@ -75,9 +75,10 @@ nixosConfigurations = { tower = mkNix [ ./hosts/tower ]; # Main Desktop + envy = mkNix [ ./hosts/envy ]; # HP Convertable axolotl = mkNix [ ./hosts/axolotl ]; # PineBook Pro lacros = mkNix [ ./hosts/lacros ]; # Dell Chromebook - redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot Laptop + redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot extern = mkNix [ ./hosts/extern ]; # External Drive/USB kitty = mkNix [ ./hosts/kitty ]; # Dell Optiplex 7010 diff --git a/hosts/envy/boot/default.nix b/hosts/envy/boot/default.nix new file mode 100644 index 0000000..8edd6ac --- /dev/null +++ b/hosts/envy/boot/default.nix @@ -0,0 +1,7 @@ +{ pkgs, lib, ... }: +{ + boot = { + kernelPackages = pkgs.unstable.linuxPackages_latest; + blacklistedKernelModules = [ "pcspkr" ]; + }; +} diff --git a/hosts/envy/default.nix b/hosts/envy/default.nix new file mode 100644 index 0000000..7d82407 --- /dev/null +++ b/hosts/envy/default.nix @@ -0,0 +1,17 @@ +{ ... }: +{ + imports = [ + ./boot + ./disko + ./filesystems + ./hardware + ./users + ../../modules/system + ]; + + system.wireguard.client.enable = true; + networking.wireguard.interfaces.wgc.ips = [ "10.100.0.25/24" ]; + + system.stateVersion = "24.11"; + networking.hostName = "envy"; +} diff --git a/hosts/envy/disko/default.nix b/hosts/envy/disko/default.nix new file mode 100644 index 0000000..d5ccc1b --- /dev/null +++ b/hosts/envy/disko/default.nix @@ -0,0 +1,97 @@ +{ disko, config, ... }: +{ + imports = [ disko.nixosModules.disko ]; + + disko.devices = { + disk = { + "${config.networking.hostName}" = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + size = "2G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + luks = { + size = "100%"; + content = { + type = "luks"; + name = "${config.networking.hostName}-disk"; + settings.allowDiscards = true; + passwordFile = "/tmp/secret.key"; + content = { + type = "lvm_pv"; + vg = "${config.networking.hostName}"; + }; + }; + }; + }; + }; + }; + }; + + lvm_vg = { + "${config.networking.hostName}" = { + type = "lvm_vg"; + lvs = { + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/prev" = { + mountpoint = "/prev"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + + # Impermanence + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/persist/.snapshots" = { }; + + "/jimbo" = { + mountpoint = "/persist/home/jimbo"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/jimbo/.snapshots" = { }; + }; + }; + }; + swap = { + size = "4G"; + content = { + type = "swap"; + discardPolicy = "both"; + }; + }; + }; + }; + }; + }; + + # Needed for impermanence + fileSystems = { + "/persist".neededForBoot = true; + "/persist/home/jimbo".neededForBoot = true; + }; +} diff --git a/hosts/envy/filesystems/default.nix b/hosts/envy/filesystems/default.nix new file mode 100644 index 0000000..3596409 --- /dev/null +++ b/hosts/envy/filesystems/default.nix @@ -0,0 +1,11 @@ +{ config, ... }: +{ + fileSystems = { + # Network mounts + "/home/jimbo/JimboNFS" = { + device = "10.100.0.1:/export/JimboNFS"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; + }; +} diff --git a/hosts/envy/hardware/default.nix b/hosts/envy/hardware/default.nix new file mode 100644 index 0000000..b67f311 --- /dev/null +++ b/hosts/envy/hardware/default.nix @@ -0,0 +1,10 @@ +# nixos-generate-config --root ./ --no-filesystems +{ config, lib, ... }: +{ + boot.initrd.availableKernelModules = [ "xhci_pci" "sr_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/envy/id_ed25519.pub b/hosts/envy/id_ed25519.pub new file mode 100644 index 0000000..e36a85d --- /dev/null +++ b/hosts/envy/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC2lMkUd+BbXITE5LTg94hEzmA6UKsIIbaf5YOjGoLzl diff --git a/hosts/envy/users/default.nix b/hosts/envy/users/default.nix new file mode 100644 index 0000000..a0f4778 --- /dev/null +++ b/hosts/envy/users/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./jimbo ]; +} diff --git a/hosts/envy/users/jimbo/default.nix b/hosts/envy/users/jimbo/default.nix new file mode 100644 index 0000000..e39c27e --- /dev/null +++ b/hosts/envy/users/jimbo/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + home-manager.users.jimbo = { + home.stateVersion = "24.11"; + }; +} diff --git a/hosts/extern/boot/default.nix b/hosts/extern/boot/default.nix index 647ffc9..177034c 100644 --- a/hosts/extern/boot/default.nix +++ b/hosts/extern/boot/default.nix @@ -6,7 +6,7 @@ }; # Kernel that won't explode the MacBook Air - specialisation.nouveau.configuration.config = { + specialisation.oldkernel.configuration.config = { boot.kernelPackages = lib.mkForce pkgs.linuxPackages_5_10; }; } diff --git a/modules/home/wms/niri/outputs/default.nix b/modules/home/wms/niri/outputs/default.nix index ce670f3..ac4c820 100644 --- a/modules/home/wms/niri/outputs/default.nix +++ b/modules/home/wms/niri/outputs/default.nix @@ -70,6 +70,7 @@ output "${config.displays.d1}" { mode "1920x1080@143.980" position x=3840 y=405 + variable-refresh-rate } output "${config.displays.d2}" { mode "1920x1080@60"