diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-30 22:03:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-30 22:09:46 +0900 |
| commit | 297b444dfb6adb71d5d1e61ea1b5aff16683896e (patch) | |
| tree | 61136bffe95aae67baa436b20ce60b7b9074d126 /test/sandbox/default.nix | |
| parent | 89a05909a4fb393864a8aa752f6979dd9aaa2898 (diff) | |
test: separate app and sandbox
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/sandbox/default.nix')
| -rw-r--r-- | test/sandbox/default.nix | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/sandbox/default.nix b/test/sandbox/default.nix new file mode 100644 index 00000000..6ffc4fd5 --- /dev/null +++ b/test/sandbox/default.nix @@ -0,0 +1,39 @@ +{ + lib, + nixosTest, + + self, + withRace ? false, +}: + +nixosTest { + name = "fortify-sandbox" + (if withRace then "-race" else ""); + nodes.machine = + { options, pkgs, ... }: + { + # Run with Go race detector: + environment.fortify = lib.mkIf withRace rec { + # race detector does not support static linking + package = (pkgs.callPackage ../../package.nix { }).overrideAttrs (previousAttrs: { + GOFLAGS = previousAttrs.GOFLAGS ++ [ "-race" ]; + }); + fsuPackage = options.environment.fortify.fsuPackage.default.override { fortify = package; }; + }; + + imports = [ + ./configuration.nix + + self.nixosModules.fortify + self.inputs.home-manager.nixosModules.home-manager + ]; + }; + + # adapted from nixos sway integration tests + + # testScriptWithTypes:49: error: Cannot call function of unknown type + # (machine.succeed if succeed else machine.execute)( + # ^ + # Found 1 error in 1 file (checked 1 source file) + skipTypeCheck = true; + testScript = builtins.readFile ./test.py; +} |
