diff --git a/flake.nix b/flake.nix index a8433d76..68d17fd5 100644 --- a/flake.nix +++ b/flake.nix @@ -58,12 +58,12 @@ # nixos-rebuild switch --flake /etc/nixos#hostname nixosConfigurations = { tower = mkNix [ ./hosts/tower ]; # Main Desktop + kitty = mkNix [ ./hosts/kitty ]; # Dell Optiplex 7010 envy = mkNix [ ./hosts/envy ]; # HP Convertable pear = mkNix [ ./hosts/pear ]; # MacBook Pro intuos = mkNix [ ./hosts/intuos ]; # Wacom Intuos Tablet redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot - iso = mkNix [ ./hosts/iso ]; # ISO File midas = mkNix [ ./hosts/midas ]; # Dell Optiplex 5040 prophet = mkNix [ ./hosts/prophet ]; # Oracle Neoverse-N1 diff --git a/hosts/iso/default.nix b/hosts/iso/default.nix deleted file mode 100644 index 4f4f5045..00000000 --- a/hosts/iso/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib, ... }: -{ - imports = [ - ./hardware - ./users - ../../modules/system - ]; - - networking.hostName = "iso"; - - system = { - desktop.enable = true; - wireless.enable = true; - video.nvidia.enable = true; - libvirtd.enable = true; - stateVersion = "24.11"; - }; - - environment.persistence."/persist".enable = lib.mkForce false; - - services = { - btrfs.autoScrub.enable = lib.mkForce false; - fstrim.enable = lib.mkForce false; - }; -} diff --git a/hosts/iso/hardware/default.nix b/hosts/iso/hardware/default.nix deleted file mode 100644 index 18f153e4..00000000 --- a/hosts/iso/hardware/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, lib, modulesPath, ... }: -{ - imports = [ - (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") - (modulesPath + "/installer/cd-dvd/channel.nix") - ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/kitty/boot/default.nix b/hosts/kitty/boot/default.nix new file mode 100644 index 00000000..50d146f5 --- /dev/null +++ b/hosts/kitty/boot/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/kitty/default.nix b/hosts/kitty/default.nix new file mode 100644 index 00000000..04e7a94a --- /dev/null +++ b/hosts/kitty/default.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: +{ + imports = [ + ./boot + ./disko + ./filesystems + ./hardware + ./users + ../../modules/system + ]; + + networking.hostName = "kitty"; + + system = { + desktop.enable = true; + lanzaboote.enable = true; + fancyboot.enable = true; + stateVersion = "24.11"; + }; +} diff --git a/hosts/kitty/disko/default.nix b/hosts/kitty/disko/default.nix new file mode 100644 index 00000000..36d1bd7e --- /dev/null +++ b/hosts/kitty/disko/default.nix @@ -0,0 +1,90 @@ +{ config, disko, ... }: +{ + imports = [ disko.nixosModules.disko ]; + + disko.devices = { + disk = { + "${config.networking.hostName}" = { + type = "disk"; + device = "/dev/sda"; + 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" "noexec" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + + # Impermanence + "/persist" = { + mountpoint = "/persist"; + mountOptions = [ "compress=zstd" "noatime" "ssd" ]; + }; + "/persist/.snapshots" = { }; + "/persist/home/${config.sysusers.main}" = { }; + "/persist/home/${config.sysusers.main}/.snapshots" = { }; + }; + }; + }; + swap = { + size = "8G"; + content = { + type = "swap"; + discardPolicy = "both"; + }; + }; + }; + }; + }; + }; + + # Needed for impermanence + fileSystems."/persist".neededForBoot = true; +} diff --git a/hosts/kitty/filesystems/default.nix b/hosts/kitty/filesystems/default.nix new file mode 100644 index 00000000..299da259 --- /dev/null +++ b/hosts/kitty/filesystems/default.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + fileSystems."/home/${config.sysusers.main}/Midas" = { + device = "${config.ips.server}:/"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "noauto" "soft" "_netdev" ]; + }; +} diff --git a/hosts/kitty/hardware/default.nix b/hosts/kitty/hardware/default.nix new file mode 100644 index 00000000..2c067d3d --- /dev/null +++ b/hosts/kitty/hardware/default.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" ]; + boot.kernelModules = [ "kvm-intel" ]; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/kitty/id_ed25519.pub b/hosts/kitty/id_ed25519.pub new file mode 100644 index 00000000..a828417e --- /dev/null +++ b/hosts/kitty/id_ed25519.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGyeBzogUVlK+PR+lC92gPwzal8KmA2xeaTOhi59smXq bun@kitty diff --git a/hosts/iso/users/default.nix b/hosts/kitty/users/default.nix similarity index 100% rename from hosts/iso/users/default.nix rename to hosts/kitty/users/default.nix diff --git a/hosts/iso/users/main/default.nix b/hosts/kitty/users/main/default.nix similarity index 83% rename from hosts/iso/users/main/default.nix rename to hosts/kitty/users/main/default.nix index 26b7a3ad..b609338c 100644 --- a/hosts/iso/users/main/default.nix +++ b/hosts/kitty/users/main/default.nix @@ -2,7 +2,7 @@ { home-manager.users."${config.sysusers.main}".home = { desktop.enable = true; - remote-desktop.enable = true; + production.enable = true; stateVersion = lib.mkForce config.system.stateVersion; }; } diff --git a/modules/system/users/main/default.nix b/modules/system/users/main/default.nix index d4051841..1b466552 100644 --- a/modules/system/users/main/default.nix +++ b/modules/system/users/main/default.nix @@ -13,6 +13,7 @@ createHome = true; openssh.authorizedKeys.keyFiles = [ ../../../../hosts/tower/id_ed25519.pub + ../../../../hosts/kitty/id_ed25519.pub ../../../../hosts/envy/id_ed25519.pub ../../../../hosts/pear/id_ed25519.pub