-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
241 lines (211 loc) · 5.32 KB
/
home.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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
{ config, lib, ... }:
let
pkgs = import <nixpkgs> {}
//
import ./gardenertools {};
pkgsu = import <nixpkgsu> {};
# Import other Nix files
imports = [
./git.nix
./neovim.nix
./shell.nix
./tmux.nix
./vscode.nix
];
# Handly shell command to view the dependency tree of Nix packages
depends = pkgs.writeScriptBin "depends" ''
dep=$1
nix-store --query --requisites $(which $dep)
'';
git-hash = pkgs.writeScriptBin "git-hash" ''
nix-prefetch-url --unpack https://github.com/$1/$2/archive/$3.tar.gz
'';
wo = pkgs.writeScriptBin "wo" ''
readlink $(which $1)
'';
run = pkgs.writeScriptBin "run" ''
nix-shell --pure --run "$@"
'';
scripts = [
depends
git-hash
run
wo
];
# rubyPackages = with pkgs.rubyPackages_3_1; [
# jsonpath
# vault
# jwt
# huhalala
# ];
# pythonPackages = with pkgs.python38Packages; [
# bpython
# openapi-spec-validator
# pip
# requests
# setuptools
# ];
gitTools = with pkgs.gitAndTools; [
delta
diff-so-fancy
git-codeowners
gitflow
git-lfs
gh
];
in {
inherit imports;
# Allow non-free (as in beer) packages
# nixpkgs.config = {
# allowUnfree = true;
# allowUnsupportedSystem = true;
# };
home = {
username = builtins.getEnv "USER";
homeDirectory = builtins.getEnv "HOME";
stateVersion = "22.11";
};
home.sessionVariables = {
NIX_SSL_CERT_FILE = ~/.ssl/my-ca-bundle;
EDITOR = "nvim";
TERMINAL = "alacritty";
};
home.sessionPath = [
"$HOME/.krew/bin"
];
# Miscellaneous packages (in alphabetical order)
home.packages = with pkgs; [
# adoptopenjdk-bin # Java
argocd
autoconf # Broadly used tool, no clue what it does
awscli # Amazon Web Services CLI
azure-cli
bash # /bin/bash
bat # cat replacement written in Rust
buildpack # Cloud Native buildpacks
bottom
# buildkit # Fancy Docker
cacert
cachix # Nix build cache
civo
# cargo-edit # Easy Rust dependency management
# cargo-graph # Rust dependency graphs
# cargo-watch # Watch a Rust project and execute custom commands upon change
# curl # An old classic
colorls
comma
coreutils
cpulimit
# pkgsu.cue
# dhall # Exotic, Nix-like configuration language
delve
direnv # Per-directory environment variables
dive
exercism
# docker # World's #1 container tool
# docker-compose # Local multi-container Docker environments
# docker-machine # Docker daemon for macOS
fd
fluxcd
fzf
fzy
findutils
gardenctl
gardenlogin
kubeswitch
ocmcli
google-cloud-sdk # Google Cloud Platform CLI
graphviz # dot
# gnupg # gpg
gdu
gnused
gnutar
htop # Resource monitoring
httpie # Like curl but more user friendly
hurl # hurl.dev
jq # JSON parsing for the CLI
# jsonnet # Easy config language
k9s
kind # Easy Kubernetes installation
# kompose
# kubectl # Kubernetes CLI tool, use docker
krew
kubebuilder
kubectx # kubectl context switching
kubelogin-oidc
kubernetes-helm # Kubernetes package manager
kustomize
lazygit
# pkgsu.kustomize-sops
# lorri # Easy Nix shell
minikube # Local Kubernetes
neovim
niv # Nix dependency management
nix-serve
nixos-generators
nodejs # node and npm
# nodePackages.semver
openssl
# podman # Docker alternative
#prometheus # Monitoring system
protobuf # Protocol Buffers
# python3 # Have you upgraded yet???
# ruby_3_1
ripgrep
skaffold # Local Kubernetes dev tool
sops
# starship # Fancy shell that works with zsh
temporal-cli
terraform # Declarative infrastructure management
tilt # Fast-paced Kubernetes development
tree # Should be included in macOS but it's not
# python310Packages.wakeonlan
vagrant # Virtualization made easy
vault # Secret management
vscode # My fav text editor if I'm being honest
wget
zsh-powerlevel10k
# grype
# syft
(nerdfonts.override { fonts = [ "FiraCode" "JetBrainsMono" ]; })
]
++ gitTools
++ scripts
++ lib.optionals stdenv.isDarwin [
pinentry_mac # Necessary for GPG
];
home.file.".gnupg/gpg-agent.conf".text = ''
disable-scdaemon
grab
'' +
lib.optionals pkgs.stdenv.isDarwin "pinentry-program ${builtins.getEnv "HOME"}/.nix-profile/Applications/pinentry-mac.app/Contents/MacOS/pinentry-mac";
#home.file.".ssl/internal.crt".source = ./internal.crt;
home.activation = {
cacerts = lib.hm.dag.entryAfter ["writeBoundary"] ''
$DRY_RUN_CMD cat ~/.nix-profile/etc/ssl/certs/ca-bundle.crt ~/.ssl/*.crt >~/.ssl/my-ca-bundle
'';
};
fonts.fontconfig.enable = true;
# Home Manager
programs.home-manager.enable = true;
# nix-index for comma
programs.nix-index.enable = true;
# Dircolors
programs.dircolors.enable = true;
# Golang
programs.go = {
enable = true;
package = pkgsu.go_1_21;
};
# GPG
programs.gpg.enable = true;
# security.pki.certificateFiles = [ "/usr/local/share/ca-certificates/internal.crt" ];
# temporary fix https://github.com/NixOS/nixpkgs/issues/196651
# manual.manpages.enable = false;
nix = {
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
}