-
Notifications
You must be signed in to change notification settings - Fork 2
/
flake.nix
159 lines (147 loc) · 4.34 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
{
description = "Stackrox development environment";
nixConfig = {
substituters = [
"https://stackrox.cachix.org"
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://nixpkgs-terraform.cachix.org"
];
trusted-public-keys = [
"stackrox.cachix.org-1:Wnn8TKAitOTWKfTvvHiHzJjXy0YfiwoK6rrVzXt/trA="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nixpkgs-terraform.cachix.org-1:8Sit092rIdAVENA3ZVeH9hzSiqI/jng6JiCrQ1Dmusw="
];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-golang.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
nixpkgs-terraform.url = "github:stackbuilders/nixpkgs-terraform";
flake-parts.url = "github:hercules-ci/flake-parts";
};
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, ... }: {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [
flake-parts.flakeModules.easyOverlay
];
perSystem =
{ config
, pkgs
, system
, ...
}:
let
# Pinned packages.
custom = import ./pkgs { inherit pkgs; };
golang = (import inputs.nixpkgs-golang { inherit system; }).go_1_22;
stable = import inputs.nixpkgs-stable { inherit system; };
terraform = inputs.nixpkgs-terraform.packages.${system}."1.5.7";
# Add Darwin packages here.
darwin-pkgs =
if pkgs.stdenv.isDarwin
then {
inherit
(pkgs)
colima
docker
;
}
else { };
# Add Python packages here.
python-pkgs = ps: [
ps.python-ldap # Dependency of aws-saml.py
ps.pyyaml
];
in
{
packages =
{
# stackrox/stackrox
inherit
(pkgs)
bats
gettext# Needed for `envsubst`
gradle
jdk11
nodejs
postgresql
shellcheck
yarn
;
google-cloud-sdk = pkgs.google-cloud-sdk.withExtraComponents [
pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin
];
# stackrox/acs-fleet-manager
inherit
(pkgs)
aws-vault
awscli2
chamber
krb5# Dependency of aws-saml.py
pre-commit
;
# stackrox/acs-fleet-manager-aws-config
inherit terraform;
inherit
(pkgs)
terragrunt
detect-secrets
;
# openshift
inherit
(pkgs)
ocm
openshift
;
# misc
inherit (custom) vault;
inherit
(pkgs)
bfg-repo-cleaner
cachix
docker-buildx
gcc
git-absorb
gnumake
goreleaser
jq
jsonnet-bundler
k9s
kind
kubectl
kubectx
prometheus
wget
;
inherit (stable) bitwarden-cli;
go = golang;
helm = pkgs.kubernetes-helm;
jsonnet = pkgs.go-jsonnet;
python = pkgs.python311.withPackages python-pkgs;
yq = pkgs.yq-go;
}
// darwin-pkgs;
devShells = {
default = pkgs.mkShell {
buildInputs = builtins.attrValues config.packages;
};
};
overlayAttrs = config.packages;
};
flake = {
overlays.hashicorp = _: prev:
withSystem prev.stdenv.hostPlatform.system (
{ config, ... }: {
inherit
(config.packages)
terraform
vault
;
}
);
};
});
}