diff --git a/nix/configuration/flake.nix b/nix/configuration/flake.nix index c0f25ee..2b84092 100644 --- a/nix/configuration/flake.nix +++ b/nix/configuration/flake.nix @@ -93,6 +93,7 @@ base_x86_64_linux // { modules = base_x86_64_linux.modules ++ [ + ./hosts/odo (nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix") # TODO: Figure out how to do image based appliances # (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix") @@ -118,9 +119,8 @@ base_x86_64_linux // { modules = base_x86_64_linux.modules ++ [ + ./hosts/neelix (nixpkgs + "/nixos/modules/installer/cd-dvd/iso-image.nix") - # TODO: Figure out how to do image based appliances - # (nixpkgs + "/nixos/modules/profiles/image-based-appliance.nix") { isoImage.makeEfiBootable = true; isoImage.makeUsbBootable = true; diff --git a/nix/configuration/hosts/neelix/optimized_build.nix b/nix/configuration/hosts/neelix/optimized_build.nix index 4f678a4..a6ae54f 100644 --- a/nix/configuration/hosts/neelix/optimized_build.nix +++ b/nix/configuration/hosts/neelix/optimized_build.nix @@ -7,62 +7,72 @@ { imports = [ ]; - nix.settings.system-features = lib.mkForce [ - "gccarch-alderlake" - "gccarch-x86-64-v3" - "benchmark" - "big-parallel" - "kvm" - "nixos-test" + config = lib.mkMerge [ + { } + (lib.mkIf (!config.me.buildingIso) { + nix.settings.system-features = lib.mkForce [ + "gccarch-alderlake" + "gccarch-x86-64-v3" + "benchmark" + "big-parallel" + "kvm" + "nixos-test" + ]; + + # nixpkgs.hostPlatform = { + # gcc.arch = "alderlake"; + # gcc.tune = "alderlake"; + # system = "x86_64-linux"; + + # }; + + nixpkgs.overlays = [ + ( + self: super: + let + optimizeWithFlags = + pkg: flags: + pkg.overrideAttrs (old: { + NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; + }); + addConfig = + additionalConfig: pkg: + pkg.override (oldconfig: { + structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig; + }); + in + { + linux_alderlake = + addConfig + { + # Full preemption + PREEMPT = lib.mkOverride 60 lib.kernel.yes; + PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no; + + # Google's BBRv3 TCP congestion Control + TCP_CONG_BBR = lib.kernel.yes; + DEFAULT_BBR = lib.kernel.yes; + + # Preemptive Full Tickless Kernel at 300Hz + HZ = lib.kernel.freeform "300"; + HZ_300 = lib.kernel.yes; + HZ_1000 = lib.kernel.no; + } + ( + optimizeWithFlags super.linux_6_12 [ + "-march=alderlake" + "-mtune=alderlake" + ] + ); + } + ) + ]; + + boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_alderlake; + }) + (lib.mkIf (config.me.buildingIso) { + boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12; + boot.supportedFilesystems = [ "zfs" ]; + }) ]; - - # nixpkgs.hostPlatform = { - # gcc.arch = "alderlake"; - # gcc.tune = "alderlake"; - # system = "x86_64-linux"; - # }; - - nixpkgs.overlays = [ - ( - self: super: - let - optimizeWithFlags = - pkg: flags: - pkg.overrideAttrs (old: { - NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; - }); - addConfig = - additionalConfig: pkg: - pkg.override (oldconfig: { - structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig; - }); - in - { - linux_alderlake = - addConfig - { - # Full preemption - PREEMPT = lib.mkOverride 60 lib.kernel.yes; - PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no; - - # Google's BBRv3 TCP congestion Control - TCP_CONG_BBR = lib.kernel.yes; - DEFAULT_BBR = lib.kernel.yes; - - # Preemptive Full Tickless Kernel at 300Hz - HZ = lib.kernel.freeform "300"; - HZ_300 = lib.kernel.yes; - HZ_1000 = lib.kernel.no; - } - ( - optimizeWithFlags super.linux_6_12 [ - "-march=alderlake" - "-mtune=alderlake" - ] - ); - } - ) - ]; - - boot.kernelPackages = lib.mkIf (!config.me.buildingIso) (pkgs.linuxPackagesFor pkgs.linux_alderlake); } diff --git a/nix/configuration/hosts/odo/optimized_build.nix b/nix/configuration/hosts/odo/optimized_build.nix index 43d09b8..7e6fbc0 100644 --- a/nix/configuration/hosts/odo/optimized_build.nix +++ b/nix/configuration/hosts/odo/optimized_build.nix @@ -7,65 +7,75 @@ { imports = [ ]; - nix.settings.system-features = lib.mkForce [ - "gccarch-znver4" - "gccarch-skylake" - # "gccarch-alderlake" missing WAITPKG - "gccarch-x86-64-v3" - "gccarch-x86-64-v4" - "benchmark" - "big-parallel" - "kvm" - "nixos-test" + config = lib.mkMerge [ + { } + (lib.mkIf (!config.me.buildingIso) { + nix.settings.system-features = lib.mkForce [ + "gccarch-znver4" + "gccarch-skylake" + # "gccarch-alderlake" missing WAITPKG + "gccarch-x86-64-v3" + "gccarch-x86-64-v4" + "benchmark" + "big-parallel" + "kvm" + "nixos-test" + ]; + + # nixpkgs.hostPlatform = { + # gcc.arch = "znver4"; + # gcc.tune = "znver4"; + # system = "x86_64-linux"; + + # }; + + nixpkgs.overlays = [ + ( + self: super: + let + optimizeWithFlags = + pkg: flags: + pkg.overrideAttrs (old: { + NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; + }); + addConfig = + additionalConfig: pkg: + pkg.override (oldconfig: { + structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig; + }); + in + { + linux_znver4 = + addConfig + { + # Full preemption + PREEMPT = lib.mkOverride 60 lib.kernel.yes; + PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no; + + # Google's BBRv3 TCP congestion Control + TCP_CONG_BBR = lib.kernel.yes; + DEFAULT_BBR = lib.kernel.yes; + + # Preemptive Full Tickless Kernel at 300Hz + HZ = lib.kernel.freeform "300"; + HZ_300 = lib.kernel.yes; + HZ_1000 = lib.kernel.no; + } + ( + optimizeWithFlags super.linux_6_12 [ + "-march=znver4" + "-mtune=znver4" + ] + ); + } + ) + ]; + + boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_znver4; + }) + (lib.mkIf (config.me.buildingIso) { + boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_6_12; + boot.supportedFilesystems.zfs = true; + }) ]; - - # nixpkgs.hostPlatform = { - # gcc.arch = "znver4"; - # gcc.tune = "znver4"; - # system = "x86_64-linux"; - # }; - - nixpkgs.overlays = [ - ( - self: super: - let - optimizeWithFlags = - pkg: flags: - pkg.overrideAttrs (old: { - NIX_CFLAGS_COMPILE = [ (old.NIX_CFLAGS_COMPILE or "") ] ++ flags; - }); - addConfig = - additionalConfig: pkg: - pkg.override (oldconfig: { - structuredExtraConfig = pkg.structuredExtraConfig // additionalConfig; - }); - in - { - linux_znver4 = - addConfig - { - # Full preemption - PREEMPT = lib.mkOverride 60 lib.kernel.yes; - PREEMPT_VOLUNTARY = lib.mkOverride 60 lib.kernel.no; - - # Google's BBRv3 TCP congestion Control - TCP_CONG_BBR = lib.kernel.yes; - DEFAULT_BBR = lib.kernel.yes; - - # Preemptive Full Tickless Kernel at 300Hz - HZ = lib.kernel.freeform "300"; - HZ_300 = lib.kernel.yes; - HZ_1000 = lib.kernel.no; - } - ( - optimizeWithFlags super.linux_6_12 [ - "-march=znver4" - "-mtune=znver4" - ] - ); - } - ) - ]; - - boot.kernelPackages = lib.mkIf (!config.me.buildingIso) (pkgs.linuxPackagesFor pkgs.linux_znver4); }