-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
65 lines (59 loc) · 1.57 KB
/
flake.nix
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "Scion Path Discovery";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/22.05";
src = {
url = "github:netsys-lab/scion-path-discovery/v1.0.1";
flake = false;
};
};
outputs = {
self,
nixpkgs,
src,
}: let
supportedSystems = ["x86_64-linux" "x86_64-darwin"];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system:
import nixpkgs {
inherit system;
overlays = [
self.overlays.default
];
});
in {
overlays.default = final: prev: {
scion-path-discovery-examples = with prev;
buildGoModule {
pname = "scion-path-discovery-examples";
version = "1.0.1";
inherit src;
vendorSha256 = "sha256-4XUojpI7VCIvGBTpp96SGP5Du48W6Zgrj8qkPFXPZrk=";
CGO_ENABLED = 0;
buildPhase = ''
make
'';
postInstall = ''
cp -r bin $out
'';
};
};
packages = forAllSystems (system: rec {
inherit (nixpkgsFor.${system}) scion-path-discovery-examples;
default = scion-path-discovery-examples;
});
apps = forAllSystems (system: let
pkg = self.packages.${system}.scion-path-discovery-examples;
in {
example-simple = {
type = "app";
program = "${pkg}/bin/simple";
};
example-mppingpong = {
type = "app";
program = "${pkg}/bin/mppingpong";
};
});
formatter = forAllSystems (system: nixpkgsFor.${system}.alejandra);
};
}