-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
39 lines (37 loc) · 1.42 KB
/
Copy pathflake.nix
File metadata and controls
39 lines (37 loc) · 1.42 KB
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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { nixpkgs, ... }:
let
version = "0.2.0"; # x-release-please-version
# x86_64-darwin is excluded: the pinned nixpkgs-unstable aborts evaluation
# for it since upstream dropped support, breaking every output.
systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
default = pkgs.buildGoModule {
pname = "secondhand";
inherit version;
src = ./.;
vendorHash = "sha256-KSLMqyrISDOrcLtO/qxC2geFYY2ypPxQ9mWU+xreJ1I=";
ldflags = [ "-s" "-w" "-X main.version=v${version}" ];
nativeCheckInputs = [ pkgs.git ]; # test suite execs git directly
# buildGoModule names the output after the module (secondhand);
# every other build path (Makefile, .gitignore) expects hand.
postInstall = "mv $out/bin/secondhand $out/bin/hand";
meta.mainProgram = "hand";
};
}
);
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system}; in {
default = pkgs.mkShell {
packages = [ pkgs.go pkgs.golangci-lint pkgs.gopls pkgs.gotools pkgs.gcc ];
};
}
);
};
}