aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sandbox/tool/package.nix
blob: d003cfa8edde4db19b57b597b110594d141a3905 (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
{
  lib,
  buildGoModule,
  pkg-config,
  util-linux,

  version,
}:
buildGoModule rec {
  pname = "check-sandbox";
  inherit version;

  src = builtins.path {
    name = "${pname}-src";
    path = lib.cleanSource ../.;
    filter = path: type: (type == "directory") || (type == "regular" && lib.hasSuffix ".go" path);
  };
  vendorHash = null;

  buildInputs = [ util-linux ];
  nativeBuildInputs = [ pkg-config ];

  preBuild = ''
    go mod init git.gensokyo.uk/security/hakurei/test/sandbox >& /dev/null
  '';

  postInstall = ''
    mv $out/bin/tool $out/bin/hakurei-test
  '';
}