aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sharefs/default.nix
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-07-07 18:32:56 +0900
committerOphestra <cat@gensokyo.uk>2026-07-07 18:56:27 +0900
commit6d55ee536e902d059380f79e870d06547627cc7c (patch)
treeaacf3e3ec42525cf0e7a674aa948359fd0c21ae2 /test/sharefs/default.nix
parentc8e8651694415d497b0800319b2ddda361b7651f (diff)
test: move nix files
These are too much clutter. Move them to test directory until the test suite replacement is upstreamed. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sharefs/default.nix')
-rw-r--r--test/sharefs/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/sharefs/default.nix b/test/sharefs/default.nix
new file mode 100644
index 00000000..e963eaa6
--- /dev/null
+++ b/test/sharefs/default.nix
@@ -0,0 +1,44 @@
+{
+ testers,
+
+ system,
+ self,
+}:
+testers.nixosTest {
+ name = "sharefs";
+ nodes.machine =
+ { options, pkgs, ... }:
+ let
+ fhs =
+ let
+ hakurei = options.environment.hakurei.package.default;
+ in
+ pkgs.buildFHSEnv {
+ pname = "hakurei-fhs";
+ inherit (hakurei) version;
+ targetPkgs = _: hakurei.targetPkgs;
+ extraOutputsToInstall = [ "dev" ];
+ profile = ''
+ export PKG_CONFIG_PATH="/usr/share/pkgconfig:$PKG_CONFIG_PATH"
+ '';
+ };
+ in
+ {
+ environment.systemPackages = [
+ # For go tests:
+ (pkgs.writeShellScriptBin "sharefs-workload-hakurei-tests" ''
+ cp -r "${self.packages.${system}.hakurei.src}" "/sdcard/hakurei" && cd "/sdcard/hakurei"
+ ${fhs}/bin/hakurei-fhs -c 'ROSA_SKIP_BINFMT=1 CC="clang -O3 -Werror" go test ./...'
+ '')
+ ];
+
+ imports = [
+ ./configuration.nix
+
+ self.nixosModules.hakurei
+ self.inputs.home-manager.nixosModules.home-manager
+ ];
+ };
+
+ testScript = builtins.readFile ./test.py;
+}