-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdefault.nix
37 lines (37 loc) · 907 Bytes
/
default.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
{
system ? builtins.currentSystem,
inputs ? import ./flake.lock.nix { },
nixpkgs ? import inputs.nixpkgs {
inherit system;
# Makes the config pure as well. See <nixpkgs>/top-level/impure.nix:
config = { };
overlays = [ ];
},
buildGoModule ? nixpkgs.buildGoModule,
}:
let
inherit (nixpkgs) lib;
versionFile = lib.readFile ./version.go;
versionMatch = lib.match ".*\"([0-9]+\\.[0-9]+\\.[0-9]+)\".*" versionFile;
version = lib.head versionMatch;
github-deploy = buildGoModule {
name = "github-deploy-${version}";
src = nixpkgs.lib.cleanSource ./.;
vendorHash = "sha256-vcm3UhqwiUCdope9TpfO/CQQsxM0eh8nhvOCv4bGCng=";
};
in
{
inherit github-deploy;
defaultPackage = github-deploy;
devShell = nixpkgs.mkShell {
buildInputs = with nixpkgs; [
go
gofumpt
golangci-lint
gopls
nixpkgs-fmt
just
treefmt
];
};
}