diff --git a/flake.nix b/flake.nix index a66ee31..f37be51 100644 --- a/flake.nix +++ b/flake.nix @@ -58,6 +58,7 @@ tower = mkNix [ ./hosts/tower ]; # Main Desktop envy = mkNix [ ./hosts/envy ]; # HP Convertable + pear = mkNix [ ./hosts/pear ]; # MacBook Pro redmond = mkNix [ ./hosts/redmond ]; # Lenovo Dual-Boot iso = mkNix [ ./hosts/iso ]; # ISO File diff --git a/hosts/envy/default.nix b/hosts/envy/default.nix index 8e1ffd4..26724a4 100644 --- a/hosts/envy/default.nix +++ b/hosts/envy/default.nix @@ -11,7 +11,6 @@ networking = { hostName = "envy"; - hostId = "db2e5735"; wg-quick.interfaces.wgc.address = [ "10.100.0.25/24" ]; }; diff --git a/hosts/midas/default.nix b/hosts/midas/default.nix index b4bc51f..556d147 100644 --- a/hosts/midas/default.nix +++ b/hosts/midas/default.nix @@ -9,10 +9,7 @@ ../../modules/system ]; - networking = { - hostName = "midas"; - hostId = "462433de"; - }; + networking.hostName = "midas"; system = { desktop.enable = true; diff --git a/hosts/pear/boot/default.nix b/hosts/pear/boot/default.nix new file mode 100644 index 0000000..50d146f --- /dev/null +++ b/hosts/pear/boot/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/pear/default.nix b/hosts/pear/default.nix new file mode 100644 index 0000000..0027e37 --- /dev/null +++ b/hosts/pear/default.nix @@ -0,0 +1,37 @@ +{ config, lib, ... }: +{ + imports = [ + ./boot + ./disko + ./filesystems + ./hardware + ./users + ../../modules/system + ]; + + networking = { + hostName = "pear"; + wg-quick.interfaces.wgc.address = [ "10.100.0.18/24" ]; + }; + + system = { + desktop.enable = true; + #lanzaboote.enable = true; + fancyboot.enable = true; + wireless.enable = true; + wireguard.client.enable = true; + libvirtd.enable = true; + stateVersion = "24.11"; + }; + + # Services to make this work as a school laptop + services.globalprotect.enable = true; + + virtualisation.vmware.host.enable = true; + nixpkgs.allowUnfreePackages = [ "vmware-workstation" ]; + + environment.persistence."/persist".directories = [ + "/home/${config.sysusers.main}/vmware" + "/home/${config.sysusers.main}/.vmware" + ]; +} diff --git a/hosts/pear/disko/default.nix b/hosts/pear/disko/default.nix new file mode 100644 index 0000000..cd0a3a8 --- /dev/null +++ b/hosts/pear/disko/default.nix @@ -0,0 +1,90 @@ +{ config, disko, ... }: +{ + 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" = { }; + "/persist/home/${config.sysusers.main}" = { }; + "/persist/home/${config.sysusers.main}/.snapshots" = { }; + }; + }; + }; + swap = { + size = "4G"; + content = { + type = "swap"; + discardPolicy = "both"; + }; + }; + }; + }; + }; + }; + + # Needed for impermanence + fileSystems."/persist".neededForBoot = true; +} diff --git a/hosts/pear/filesystems/default.nix b/hosts/pear/filesystems/default.nix new file mode 100644 index 0000000..b506ad9 --- /dev/null +++ b/hosts/pear/filesystems/default.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + fileSystems."/home/${config.sysusers.main}/KittyNFS" = { + device = "10.100.0.1:/storage"; + fsType = "nfs4"; + options = [ "x-systemd.automount" "_netdev" "nofail" "noauto" ]; + }; +} diff --git a/hosts/pear/hardware/default.nix b/hosts/pear/hardware/default.nix new file mode 100644 index 0000000..b7b0b5e --- /dev/null +++ b/hosts/pear/hardware/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, modulesPath, ... }: +{ + imports = [ + (modulesPath + "/hardware/network/broadcom-43xx.nix") + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ "dm-snapshot" "atkbd" "applespi" "intel_lpss_pci" "spi_pxa2xx_platform" ]; + 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/pear/users/default.nix b/hosts/pear/users/default.nix new file mode 100644 index 0000000..57e7f20 --- /dev/null +++ b/hosts/pear/users/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./main ]; +} diff --git a/hosts/pear/users/main/default.nix b/hosts/pear/users/main/default.nix new file mode 100644 index 0000000..b4d550f --- /dev/null +++ b/hosts/pear/users/main/default.nix @@ -0,0 +1,9 @@ +{ config, lib, ... }: +{ + home-manager.users."${config.sysusers.main}".home = { + desktop.enable = true; + remote-desktop.enable = true; + school.enable = true; + stateVersion = lib.mkForce config.system.stateVersion; + }; +} diff --git a/hosts/redmond/default.nix b/hosts/redmond/default.nix index 1f77ab0..6164961 100644 --- a/hosts/redmond/default.nix +++ b/hosts/redmond/default.nix @@ -11,7 +11,6 @@ networking = { hostName = "redmond"; - hostId = "ae713850"; wg-quick.interfaces.wgc.address = [ "10.100.0.23/24" ]; }; diff --git a/hosts/tower/default.nix b/hosts/tower/default.nix index 9e97a65..9b81c04 100644 --- a/hosts/tower/default.nix +++ b/hosts/tower/default.nix @@ -12,7 +12,6 @@ networking = { hostName = "tower"; - hostId = "3d16423a"; interfaces.enp42s0.wakeOnLan.enable = true; };