diff options
author | Linnnus <[email protected]> | 2024-10-01 21:04:52 +0200 |
---|---|---|
committer | Linnnus <[email protected]> | 2024-10-02 22:22:33 +0200 |
commit | 7f88dff4e19bbe668cfdd325750d1b83923345d9 (patch) | |
tree | 2ea01714e090c940078ad7921ac490fa9636e61b | |
parent | 932f65d4c7acf57fabd4eaf9a1070e8a30d9314a (diff) |
muhammed: Move linux-builder to own file, add features for NixOS tests
-rw-r--r-- | hosts/muhammed/configuration.nix | 27 | ||||
-rw-r--r-- | hosts/muhammed/linux-builder/default.nix | 40 |
2 files changed, 41 insertions, 26 deletions
diff --git a/hosts/muhammed/configuration.nix b/hosts/muhammed/configuration.nix index c082ea9..04fd55e 100644 --- a/hosts/muhammed/configuration.nix +++ b/hosts/muhammed/configuration.nix @@ -2,6 +2,7 @@ {flakeInputs, ...}: { imports = [ ./home + ./linux-builder ./wraaath-sshfs ]; @@ -39,32 +40,6 @@ services.still-awake.enable = true; - # Create a local Linux builder. This will allow us to build aarch64-linux - # targets directly on this machine. - nix.settings.trusted-users = ["linus"]; - nix.linux-builder = { - enable = true; - - # Clearing the VM state upon startup should improve reliability at the cost - # of some startup speed. Will have to re-evaluate if this trade off is - # worth it at some point. - ephemeral = true; - - config = {pkgs, ...}: { - environment.systemPackages = with pkgs; [ - # cntr is used to jump into the sandbox of packages that use breakpointHook. - pkgs.cntr - - # Nix is used to debug and fetch other tools as needed. - pkgs.nix - ]; - - # Allow root login. This would normally be horrible but it's a local VM so who cares. - users.users.root.hashedPassword = "$y$j9T$TosKLKCZ.g9be.Wz5/qVJ.$YWvn4nAp8tn.xhHGBMOz748PHma6QGhN/WShilEbz8A"; - services.openssh.permitRootLogin = "yes"; - }; - }; - # Enable nightly GC of Nix store. nix.gc = { automatic = true; diff --git a/hosts/muhammed/linux-builder/default.nix b/hosts/muhammed/linux-builder/default.nix new file mode 100644 index 0000000..a4d2b8d --- /dev/null +++ b/hosts/muhammed/linux-builder/default.nix @@ -0,0 +1,40 @@ +# Create a local Linux builder. This will allow us to build aarch64-linux +# targets directly on this machine. +# +# It also does some related stuff to make NixOS tests work. + +{ ... }: + +{ + nix.settings.trusted-users = ["linus"]; + + nix.linux-builder = { + enable = true; + + # Clearing the VM state upon startup should improve reliability at the cost + # of some startup speed. Will have to re-evaluate if this trade off is + # worth it at some point. + ephemeral = true; + + config = {pkgs, ...}: { + environment.systemPackages = with pkgs; [ + # cntr is used to jump into the sandbox of packages that use breakpointHook. + pkgs.cntr + + # Nix is used to debug and fetch other tools as needed. + pkgs.nix + ]; + + # Allow root login. This would normally be horrible but it's a local VM so who cares. + users.users.root.hashedPassword = "$y$j9T$TosKLKCZ.g9be.Wz5/qVJ.$YWvn4nAp8tn.xhHGBMOz748PHma6QGhN/WShilEbz8A"; + services.openssh.permitRootLogin = "yes"; + }; + }; + + # Add system-features to the nix daemon that are needed for NixOS tests + # Starting with Nix 2.19, this will be automatic + nix.settings.system-features = [ + "nixos-test" + "apple-virt" + ]; +} |