-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathflake.nix
More file actions
114 lines (107 loc) · 3.19 KB
/
Copy pathflake.nix
File metadata and controls
114 lines (107 loc) · 3.19 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
{
description = "ktchn8s Lab Shell";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
kanidm-overlay = final: prev: {
kanidm_1_6_4 = (import (builtins.fetchTarball {
# https://lazamar.co.uk/nix-versions/?channel=nixos-25.05&package=kanidm
url = "https://github.com/NixOS/nixpkgs/archive/1c1c9b3f5ec0421eaa0f22746295466ee6a8d48f.tar.gz";
# sha256 can be computed with:
# nix-prefetch-url --unpack <URL>
sha256 = "0szvq1swpzyjmyyw929ngxy1khdnd9ba96qds2bm6l6kg4iq3cq0";
}) { inherit system; }).kanidm;
};
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ kanidm-overlay ];
};
in
with pkgs;
{
devShells.default = mkShell {
packages = [
# dev tools
bat
delta
diffutils
eza
fzf
git
gnumake
jq
neovim
nix-search-cli
sops
tmux
yq
zsh
# provisioning/configuration tools
ansible
ansible-lint
opentofu
minicom
tflint
trivy
xorriso
# networking tools
netcat
nettools
openssh
wireguard-tools
# k8s tools
dyff
k9s
k3d
kubectl
kubernetes-helm
kustomize
krew
# lang support
go
gotestsum
python3 # ansible dependency
# extra python packages
(python3.withPackages (p: with p; [
pip
# ansible dependencies
jinja2
jmespath
kubernetes
netaddr
# post-install
pexpect
rich
]))
] ++ lib.optionals pkgs.stdenv.isDarwin [
# NOTE: Darwin-only packages for cross-platform compatibility
# k8s tools
] ++ lib.optionals pkgs.stdenv.isLinux [
# NOTE: Linux-only packages for cross-platform compatibility
# networking tools
iproute2
# k8s tools
helm
kanidm_1_6_4
];
shellHook = ''
# use 'git rev-parse' instead of '${self}' to get the root project dir,
# because while the latter seems promising,
# it actually refers to the path in '/nix/store/' where the flake is copied to
ROOT_PATH=$(git rev-parse --show-toplevel)
# configure python virtual environment with dependencies
python -m venv "$ROOT_PATH/.venv"
source "$ROOT_PATH/.venv/bin/activate"
pip install -r "$ROOT_PATH/requirements.txt" >/dev/null
# kubernetes plugins
krew install rook-ceph &>/dev/null
'';
};
}
);
}