From 6f2aed041008e2e2d34d5d3753b6c0bbe47f9633 Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Thu, 31 Oct 2024 15:38:06 +0100 Subject: [PATCH] Create initial system config for casper --- nixos/config/casper.nix | 9 +++++++++ nixos/module/magi.nix | 25 ++++++++++++++++++++----- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/nixos/config/casper.nix b/nixos/config/casper.nix index 622e5e4..d795d69 100644 --- a/nixos/config/casper.nix +++ b/nixos/config/casper.nix @@ -1,3 +1,12 @@ { self, ... }: { lib, config, pkgs, ... }: { imports = with self.nixosModules; [ magi ]; + + ephemeral = { + enable = true; + device = "UUID=545bcd08-9f1a-4f42-b85e-93c47d496ac3"; + boot = { + device = "UUID=A5AE-22E8"; + fsType = "vfat"; + }; + }; } diff --git a/nixos/module/magi.nix b/nixos/module/magi.nix index 6d9e678..2aad2a2 100644 --- a/nixos/module/magi.nix +++ b/nixos/module/magi.nix @@ -1,10 +1,20 @@ { self, ... }: { lib, config, pkgs, ... }: { imports = with self.nixosModules; [ default + headless mimalloc physical ]; + boot.binfmt = { + emulatedSystems = [ "aarch64-linux" "riscv64-linux" ]; + preferStaticEmulators = true; + }; + + boot.kernelParams = [ + "hugepagesz=1G" "hugepages=16" + ]; + boot.kernelPackages = let inherit (self.packages.x86_64-linux) linux-hardened; in pkgs.linuxPackagesFor (linux-hardened.override { @@ -38,6 +48,10 @@ SATA_MOBILE_LPM_POLICY = 1; ATA_SFF = false; + BLK_DEV_MD = true; + MD_AUTODETECT = true; + MD_RAID1 = true; + BNXT = true; BNXT_FLOWER_OFFLOAD = true; BNXT_HWMON = true; @@ -89,11 +103,12 @@ }); }); - ephemeral = { - device = "nodev"; - boot = { - device = "nodev"; - fsType = "vfat"; + hardware.nitrokey.enable = true; + + nix = { + settings = { + system-features = [ "nixos-test" "benchmark" "big-parallel" "kvm" ] + ++ (map (arch: "gccarch-${arch}") (lib.systems.architectures.inferiors.znver2 ++ [ "rv64imac" "rv64imacfd" "rv64gc" "armv8-a" ])); }; }; }