-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
73 lines (62 loc) · 1.91 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, flake-utils, nixpkgs, ... }@inputs:
let
outputs = flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs ({
inherit system;
overlays = [
];
config.allowUnfree = true;
});
in
{
packages = {
auth_proxy = pkgs.buildGoModule rec {
name = "auth_proxy";
src = ./auth_proxy;
vendorHash = "sha256-skp304q/dO1cBH6LIlrSg1rAoALtOK1wtweC0LJRPyI=";
};
vault_plugin = pkgs.buildGoModule rec {
name = "vault_plugin";
src = ./vault_plugin;
vendorHash = "sha256-1uGPhzCk9b0tJNz08S/3QQ8ceuppajn796zQ4glYXeQ=";
};
};
overlays.default = final: prev: {
zigpkgs = outputs.packages.${prev.system};
};
devShell = pkgs.pkgs.mkShell {
buildInputs = with pkgs;
[
protobuf
stdenv
go_1_18
buf
cmake
vault-bin
protoc-gen-go
pkgs.protoc-gen-connect-go
terraform
];
shellHook = ''
export CFLAGS="-I${pkgs.glibc.dev}/include"
export LDFLAGS="-L${pkgs.glibc}/lib"
[ -n "$(go env GOBIN)" ] && export PATH="$(go env GOBIN):''${PATH}"
[ -n "$(go env GOPATH)" ] && export PATH="$(go env GOPATH)/bin:''${PATH}"
'';
};
});
in
outputs
// {
overlays.default = final: prev: {
auth_proxy = outputs.packages.${prev.system}.auth_proxy;
vault_plugin = outputs.packages.${prev.system}.vault_plugin;
};
};
}