-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
55 lines (54 loc) · 2.17 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
{
description = "A very basic flake";
# even more performance: https://github.com/NixOS/nixpkgs/pull/266075/files (optional)
inputs.nixpkgs.url = "github:Mic92/nixpkgs/build-go-module";
inputs.gomod2nix.url = "github:nix-community/gomod2nix";
inputs.gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, gomod2nix }:
let
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
in
{
legacyPackages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
buildGoCache = pkgs.callPackage ./buildGoCache.nix { };
get-external-imports = pkgs.callPackage ./get-external-imports.nix { };
example = pkgs.callPackage ./examples/buildGoModule.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
};
example-no-cache = pkgs.callPackage ./examples/buildGoModule.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
useGoCache = false;
};
example-proxy-vendor = pkgs.callPackage ./examples/buildGoModule.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
proxyVendor = true;
};
example-proxy-vendor-no-cache = pkgs.callPackage ./examples/buildGoModule.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
proxyVendor = true;
useGoCache = false;
};
example-gomod2nix = pkgs.callPackage ./examples/buildGoApplication.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
};
example-gomod2nix-no-cache = pkgs.callPackage ./examples/buildGoApplication.nix {
inherit (self.legacyPackages.${system}) buildGoCache;
inherit (gomod2nix.legacyPackages.${system}) buildGoApplication;
useGoCache = false;
};
});
checks = forAllSystems (system:
builtins.removeAttrs self.legacyPackages.${system} ["buildGoCache"]
);
};
}