aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/interactive/raceattr.nix
blob: d94d7a7b4db59df8469671ec7f221690ef01ac90 (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, pkgs, ... }:
{
  security.wrappers.raceattr =
    let
      inherit (pkgs) buildGoModule;
    in
    {
      setuid = true;
      owner = "root";
      group = "root";
      source = "${
        (buildGoModule rec {
          name = "raceattr";
          pname = name;
          tags = [ "raceattr" ];

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

          preBuild = ''
            go mod init hakurei.app/raceattr >& /dev/null
          '';
        })
      }/bin/raceattr";
    };
}