aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox/default.nix
blob: 8ea1bd53eea86fd467b634a2923ce9f1f39a1f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  nixosTest,

  self,
  withRace ? false,
}:

nixosTest {
  name = "hakurei-sandbox" + (if withRace then "-race" else "");
  nodes.machine =
    { options, pkgs, ... }:
    {
      # Run with Go race detector:
      environment.hakurei = lib.mkIf withRace rec {
        # race detector does not support static linking
        package = (pkgs.callPackage ../../package.nix { }).overrideAttrs (previousAttrs: {
          GOFLAGS = previousAttrs.GOFLAGS ++ [ "-race" ];
        });
        hsuPackage = options.environment.hakurei.hsuPackage.default.override { hakurei = package; };
      };

      imports = [
        ./configuration.nix

        self.nixosModules.hakurei
        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;
}