-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathflake.nix
30 lines (30 loc) · 989 Bytes
/
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
{
description = "hellogopher";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}";
go = pkgs.go_1_24;
in
{
# We cannot get the version with Nix in pure mode. The build process
# could add a `.version` and commit it. See for example:
# https://github.com/akvorado/akvorado/blob/8686e1cbd23328af4d29fd216b673f87345be4e5/docker/Dockerfile#L6
packages.default = pkgs.buildGoModule.override { inherit go; } {
name = "hellogopher";
src = ./.;
vendorHash = "sha256-Z3DQZ6bleZ3hs0r+WtvgZuFuqGsOJrjnZXRz1Wbyh8o=";
buildPhase = ''
make all
'';
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin/.
'';
};
});
}