diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-12-25 04:05:54 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-12-25 05:13:02 +0900 |
| commit | 7bfbd5981025282007f09225e22e895523d7a7bf (patch) | |
| tree | 14e4ea7475ab63c8fa22845d287a307fb029c110 /cmd/sharefs/test/default.nix | |
| parent | ea815a59e85a5acad8e22e98a16cdc6de1323824 (diff) | |
cmd/sharefs: implement shared filesystem
This is for passing files between applications, similar to android /sdcard.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd/sharefs/test/default.nix')
| -rw-r--r-- | cmd/sharefs/test/default.nix | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/cmd/sharefs/test/default.nix b/cmd/sharefs/test/default.nix new file mode 100644 index 00000000..53ab8fc2 --- /dev/null +++ b/cmd/sharefs/test/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 'CC="clang -O3 -Werror" go test ./...' + '') + ]; + + imports = [ + ./configuration.nix + + self.nixosModules.hakurei + self.inputs.home-manager.nixosModules.home-manager + ]; + }; + + testScript = builtins.readFile ./test.py; +} |
