-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
113 lines (99 loc) · 3.25 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
{
description = "harp";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
in
utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
inherit system;
};
rev =
if (self ? shortRev)
then self.shortRev
else "dev";
in
rec
{
packages.default = pkgs.callPackage ./default.nix {
inherit rev;
};
devShells = {
default =
let
devtools = {
gci = pkgs.buildGoModule rec {
pname = "gci";
version = "52e43a48497695a73d350b04a7e03423e3dd4909";
src = pkgs.fetchFromGitHub {
owner = "daixiang0";
repo = "gci";
rev = "${version}";
sha256 = "sha256-EBklnsZR8VwM89BztligZBDapmgyKuI9Ns8EFFo3ai8=";
};
vendorHash = "sha256-g7htGfU6C2rzfu8hAn6SGr0ZRwB8ZzSf9CgHYmdupE8=";
nativeBuildInputs = [ pkgs.installShellFiles ];
};
wwhrd = pkgs.buildGoModule rec {
pname = "wwhrd";
version = "b3052af659df6c012ddfe5c433c98953005faae8";
src = pkgs.fetchFromGitHub {
owner = "frapposelli";
repo = "wwhrd";
rev = "${version}";
sha256 = "sha256-jppPciJR2A1uKWhr+CB1Aquh33JXag0gjoBvohdt6+k=";
};
vendorHash = null;
nativeBuildInputs = [ pkgs.installShellFiles ];
};
cyclonedx-gomod = pkgs.buildGoModule rec {
pname = "cyclonedx-gomod";
version = "5e460935632418ad303008501b7dd498eb646b6d";
src = pkgs.fetchFromGitHub {
owner = "CycloneDX";
repo = "cyclonedx-gomod";
rev = "${version}";
sha256 = "sha256-BTvvVwompM7Ie4BsRcjT4yxLLJc1qH1514A4uzwgGCc=";
};
vendorHash = "sha256-uJgC44JtBSEwR6iKg8nmVmsFdyc3rtKSYxt8dbCABe0=";
subPackages = [ "cmd/cyclonedx-gomod" ];
nativeBuildInputs = [ pkgs.installShellFiles ];
};
};
in
pkgs.mkShell
{
buildInputs = [
pkgs.go_1_21
pkgs.gopls
pkgs.gotools
pkgs.go-tools
pkgs.gotestsum
pkgs.gofumpt
pkgs.golangci-lint
devtools.gci
devtools.cyclonedx-gomod
devtools.wwhrd
pkgs.mage
pkgs.buf
pkgs.mockgen
pkgs.protobuf
pkgs.protoc-gen-go
pkgs.protoc-gen-go-grpc
pkgs.cue
];
};
};
}
);
}