-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathflake.nix
48 lines (38 loc) · 1.07 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
{
description = "go-etcd-cron";
inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
inputs.utils.url = "github:numtide/flake-utils";
inputs.gomod2nix = {
url = "github:nix-community/gomod2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, utils, gomod2nix }:
let
targetSystems = with utils.lib.system; [
x86_64-linux
x86_64-darwin
aarch64-linux
aarch64-darwin
];
repo = ./.;
# We only source go files to have better cache hits when actively working
# on non-go files.
src = nixpkgs.lib.sourceFilesBySuffices ./. [ ".go" "go.mod" "go.sum" "gomod2nix.toml" ];
version = "v0.1.0";
in utils.lib.eachSystem targetSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ gomod2nix.overlays.default ];
};
ci = import ./nix/ci.nix { inherit pkgs; };
in {
apps = ci.apps;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
gomod2nix.packages.${system}.default
];
};
});
}