diff --git a/flake.nix b/flake.nix index 4559866..97d8071 100644 --- a/flake.nix +++ b/flake.nix @@ -7,8 +7,6 @@ mypkgs = import ./pkgs; deploy = import lib/deploy.nix; - hardware = import lib/hardware.nix; - forAllSystems = f: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: f system); @@ -41,13 +39,13 @@ in { - lib = { inherit forAllSystems hardware deploy; }; + lib = { inherit forAllSystems deploy; }; nixosModules = mods // { default.imports = builtins.attrValues mods; }; nixosConfigurations = builtins.mapAttrs (_: nixpkgs.lib.nixosSystem) - (import ./hosts hardware self.nixosModules.default); + (import ./hosts self.nixosModules.default); apps = forAllSystems (system: import lib/apps.nix nixpkgs.legacyPackages.${system}); diff --git a/hosts/cube/default.nix b/hosts/cube/default.nix index ab03a36..acb23ff 100644 --- a/hosts/cube/default.nix +++ b/hosts/cube/default.nix @@ -33,6 +33,9 @@ kernelParams = map (x: "video=DP-${x}:1280x720@60") [ "0" "1" "2" ]; }; + hardware.cpu.amd.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + fileSystems = { "/" = { device = "tmpfs"; fsType = "tmpfs"; options = [ "mode=755" ]; }; "/boot" = { device = "/dev/disk/by-partlabel/_esp"; fsType = "vfat"; }; diff --git a/hosts/default.nix b/hosts/default.nix index 16ae8b7..e0ba7bc 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,20 +1,20 @@ -hardware: nixosModule: -with hardware; +nixosModule: builtins.mapAttrs - (name: { system, mods }: { + (name: system: { inherit system; - modules = mods ++ [ + modules = [ nixosModule + (./. + "/${name}") { networking.hostName = name; } ]; }) { - cube = { system = "x86_64-linux"; mods = [ physical ./cube ]; }; - hp = { system = "x86_64-linux"; mods = [ physical ./hp ]; }; - lenny = { system = "x86_64-linux"; mods = [ physical ./lenny ]; }; - nixdev = { system = "x86_64-linux"; mods = [ qemu ./nixdev ]; }; - slate = { system = "x86_64-linux"; mods = [ physical ./slate ]; }; + cube = "x86_64-linux"; + hp = "x86_64-linux"; + lenny = "x86_64-linux"; + nixdev = "x86_64-linux"; + slate = "x86_64-linux"; } diff --git a/hosts/hp/default.nix b/hosts/hp/default.nix index dadd533..5bdb047 100644 --- a/hosts/hp/default.nix +++ b/hosts/hp/default.nix @@ -30,6 +30,9 @@ loader.efi.canTouchEfiVariables = false; }; + hardware.cpu.intel.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + fileSystems = { "/" = { device = "tmpfs"; fsType = "tmpfs"; options = [ "mode=755" ]; }; "/nix" = { device = "zroot/locker/nix"; fsType = "zfs"; }; diff --git a/hosts/lenny/default.nix b/hosts/lenny/default.nix index 509142c..32d4a52 100644 --- a/hosts/lenny/default.nix +++ b/hosts/lenny/default.nix @@ -37,6 +37,9 @@ loader.efi.canTouchEfiVariables = true; }; + hardware.cpu.intel.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + fileSystems = { "/" = { device = "tmpfs"; fsType = "tmpfs"; options = [ "mode=755" "size=4G" ]; }; "/nix" = { device = "lenny/locker/nix"; fsType = "zfs"; }; diff --git a/hosts/nixdev/default.nix b/hosts/nixdev/default.nix index 9c79acf..daf1ecc 100644 --- a/hosts/nixdev/default.nix +++ b/hosts/nixdev/default.nix @@ -1,10 +1,16 @@ -{ config, lib, pkgs, ... }: +{ config, lib, modulesPath, pkgs, ... }: { + imports = [ + "${modulesPath}/profiles/qemu-guest.nix" + ]; + sconfig = { gnome = true; profile = "desktop"; }; + services.qemuGuest.enable = true; + services.openssh.enable = true; users.mutableUsers = false; diff --git a/hosts/slate/default.nix b/hosts/slate/default.nix index 63384d8..b4af025 100644 --- a/hosts/slate/default.nix +++ b/hosts/slate/default.nix @@ -11,6 +11,9 @@ initrd.luks.devices.cryptroot = { device = "/dev/disk/by-partlabel/_luks"; }; }; + hardware.cpu.intel.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + fileSystems = { "/" = { device = "/dev/mapper/cryptroot"; fsType = "btrfs"; options = [ "subvol=/os" "discard" "compress=zstd" ]; }; "/home" = { device = "/dev/mapper/cryptroot"; fsType = "btrfs"; options = [ "subvol=/home" "discard" "compress=zstd" ]; }; diff --git a/lib/hardware.nix b/lib/hardware.nix deleted file mode 100644 index 10a5ce9..0000000 --- a/lib/hardware.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - physical = { lib, ... }: lib.mkMerge - [ - { hardware.cpu.amd.updateMicrocode = true; } - { hardware.cpu.intel.updateMicrocode = true; } - { hardware.enableRedistributableFirmware = true; } - ]; - - qemu = { config, lib, modulesPath, ... }: lib.mkMerge - [ - (import "${modulesPath}/profiles/qemu-guest.nix" { inherit config lib; }) - { services.qemuGuest.enable = true; } - ]; - - vmware = { lib, ... }: lib.mkMerge - [ - { virtualisation.vmware.guest.enable = true; } - ]; -}