about summary refs log tree commit diff
path: root/nixos/tests/kernel-rust.nix
diff options
context:
space:
mode:
authorJulian Stecklina <julian.stecklina@cyberus-technology.de>2023-11-30 17:00:39 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-12 20:29:06 +0100
commitd1f33201effb2ce5b09e86bc15f787b909d40f99 (patch)
treef0b02b8cbda1cd3bc4718404981207cc1c7dff01 /nixos/tests/kernel-rust.nix
parent5fca7feab9b1811348b6bb86fc0bbfa86a3acfea (diff)
nixos/tests/kernel-rust: init
Diffstat (limited to 'nixos/tests/kernel-rust.nix')
-rw-r--r--nixos/tests/kernel-rust.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/nixos/tests/kernel-rust.nix b/nixos/tests/kernel-rust.nix
new file mode 100644
index 0000000000000..80eb386936771
--- /dev/null
+++ b/nixos/tests/kernel-rust.nix
@@ -0,0 +1,30 @@
+{ pkgs, ... }: {
+  name = "kernel-rust";
+  meta = with pkgs.lib.maintainers; {
+    maintainers = [ blitz ];
+  };
+
+  nodes.machine = { config, pkgs, ... }:
+    {
+      boot.kernelPackages = pkgs.linuxPackages_testing;
+
+      boot.extraModulePackages = [
+        config.boot.kernelPackages.rust-out-of-tree-module
+      ];
+
+      boot.kernelPatches = [
+        {
+          name = "Rust Support";
+          patch = null;
+          features = {
+            rust = true;
+          };
+        }
+      ];
+    };
+
+  testScript = ''
+    machine.wait_for_unit("default.target")
+    machine.succeed("modprobe rust_out_of_tree")
+  '';
+}