-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
38 lines (31 loc) · 1.12 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
{
description = "A Nix flake for a Go project using buildGoModule";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs"; # Use Nixpkgs for dependencies
};
outputs = { self, nixpkgs }: {
packages = nixpkgs.lib.genAttrs [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ] (system:
let
pkgs = import nixpkgs { inherit system; };
in
pkgs.buildGoModule rec {
pname = "projecthelper";
version = "0.5.0"; # Replace with your version
# The source code for the Go project
src = ./.;
installPhase = ''
mkdir -p $out/bin
cp $GOPATH/bin/projecthelper $out/bin/
'';
vendorHash = "sha256-Xq61Ji6gMP6OFdHSQqfrJVsKdatYM0ZezMbdz4Adr1A="; # nixpkgs.lib.fakeHash;
# Metadata
meta = with pkgs.lib; {
description = "A Go project packaged with buildGoModule";
license = licenses.mit; # Replace with your project's license
maintainers = [ maintainers.yourGitHubHandle ];
platforms = platforms.all; # Declare all platforms as supported
};
}
);
} ;
}