-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
133 lines (111 loc) · 3.75 KB
/
Copy pathflake.nix
File metadata and controls
133 lines (111 loc) · 3.75 KB
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
{
description = "roxie - Advanced Cluster Security Deployment Tool";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Build roxie
roxie = pkgs.buildGoModule {
pname = "roxie";
src = ./.;
# Let Nix handle vendoring by calculating the hash
# To update: set to pkgs.lib.fakeHash, build, then use the hash from error
vendorHash = "sha256-bIlSwBh8WJtscEtjQIvxdIK9sFR7aQNV2BUeVNj8qbA=";
# Inject version information at build time
ldflags = [
"-X main.version=0.1"
"-X main.buildDate=1970-01-01T00:00:00Z"
];
subPackages = [ "cmd" ];
meta = with pkgs.lib; {
description = "Fast, developer-friendly CLI to deploy and manage Red Hat Advanced Cluster Security (ACS)";
homepage = "https://github.com/stackrox/roxie";
license = licenses.asl20;
maintainers = [ ];
};
};
in
{
# Package outputs
packages = {
default = roxie;
roxie = roxie;
};
# Development shell with roxie and essential dependencies
devShells = {
# Default: Minimal shell (fast, essential tools only)
default = pkgs.mkShell {
buildInputs = with pkgs; [
# Go development tools
go
gopls
gotools
golangci-lint
# roxie binary
roxie
# Essential Kubernetes tools (lightweight)
kubectl
# Optional: Kubernetes utilities (lightweight)
k9s
stern
];
shellHook = ''
echo "🚀 roxie development environment (minimal)"
echo ""
echo "Available tools:"
echo " - roxie ($(roxie version))"
echo " - kubectl ($(kubectl version --client --short 2>/dev/null || echo 'not configured'))"
echo " - Go $(go version | cut -d' ' -f3)"
echo ""
echo "💡 For full set of pre-installed tooling use:"
echo " nix develop .#full"
echo ""
echo "Run 'roxie --help' to get started"
'';
};
# Full shell with all dependencies (including heavy ones)
full = pkgs.mkShell {
buildInputs = with pkgs; [
# Go development tools
go
gopls
gotools
golangci-lint
# roxie binary
roxie
# Kubernetes tools
kubectl
k9s
stern
# Container tools:
podman
# Load balancer
haproxy
];
shellHook = ''
echo "🚀 roxie development environment (full)"
echo ""
echo "Available tools:"
echo " - roxie ($(roxie version))"
echo " - kubectl ($(kubectl version --client --short 2>/dev/null || echo 'not configured'))"
echo " - podman ($(podman --version | head -n1))"
echo " - haproxy ($(haproxy -v | head -n1))"
echo ""
echo "Run 'roxie --help' to get started"
'';
};
};
# App for 'nix run'
apps.default = {
type = "app";
program = "${roxie}/bin/roxie";
};
# Formatter for 'nix fmt'
formatter = pkgs.nixpkgs-fmt;
}
);
}