diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-02-23 18:48:01 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-02-23 18:48:01 +0900 |
| commit | b6af8caffec91db14dfe3c1e095fd1fc84ecfd9e (patch) | |
| tree | 94b55fda497cfd43e258047933cb5e8869bd0d0d /test/default.nix | |
| parent | e1a3549ea0ed7bfaed77f59e04bab70d7049750e (diff) | |
nix: clean up directory structure
Tests for fpkg is going to be in ./cmd/fpkg, so this central tests directory is no longer necessary.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'test/default.nix')
| -rw-r--r-- | test/default.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/test/default.nix b/test/default.nix new file mode 100644 index 00000000..d803a235 --- /dev/null +++ b/test/default.nix @@ -0,0 +1,47 @@ +{ + lib, + nixosTest, + writeShellScriptBin, + + system, + self, + withRace ? false, +}: + +nixosTest { + name = "fortify" + (if withRace then "-race" else ""); + nodes.machine = + { options, pkgs, ... }: + { + environment.systemPackages = [ + # For go tests: + self.packages.${system}.fhs + (writeShellScriptBin "fortify-src" "echo -n ${self.packages.${system}.fortify.src}") + ]; + + # 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; +} |
