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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
;; This "home-environment" file can be passed to 'guix home reconfigure'
;; to reproduce the content of your profile. This is "symbolic": it only
;; specifies package names. To reproduce the exact same profile, you also
;; need to capture the channels being used, as returned by "guix describe".
;; See the "Replicating Guix" section in the manual.
;;; Good reference
;;; https://git.sr.ht/~efraim/guix-config/tree/9009e110e16a8f153add7fb4d7f1512f6a543802/item/efraim-home.scm
(install-r7rs!)
(add-to-load-path (dirname (current-filename)))
(import (gnu home)
(gnu home services)
(gnu home services desktop)
(gnu home services guix)
(gnu home services shells)
(gnu home services shepherd)
(gnu home services sound)
(gnu home services ssh)
(gnu home services sway)
(gnu home services symlink-manager)
(gnu packages)
(gnu services)
(guix packages)
(gnu packages music)
(gnu packages guile-xyz)
(guix channels)
(guix derivations)
(guix monads)
(guix modules)
(guix store)
(guix gexp)
(guix transformations)
(srfi 1)
(config-generation sexp)
(rename (config packages) (home home-packages))
(rename (config sway) (sway-config rz/sway-config))
(config foot)
(rename (config git) (git-config rz/git-config))
(rename (config emacs) (emacs-config rz/emacs-config))
(ini))
(define secrets (load "secrets.scm"))
(define rz/terminal-emulator "foot")
(define bat-config
(string-append "--theme=Nord\n"
"--pager=\"less -R -F -X\""))
(define guix-gaming-config (cdr (assq 'guix-gaming-config secrets)))
(define log-dir (or (getenv "XDG_LOG_HOME") "/home/robby/.local/var/log"))
(define (generate-openssh-hosts num-vces num-vms-per-vce)
;; Generate all VCE numbers from 1 to num-vces
(let ((vce-numbers (iota num-vces 1))
(vm-numbers (iota num-vms-per-vce 1)))
;; For each VCE, generate configurations for all VMs
(append-map
(lambda (vce-num)
;; For each VM number, create a configuration
(map
(lambda (vm-num)
(openssh-host (name (string-append "rt-vce" (number->string vce-num)
"-kali" (number->string vm-num)))
(user "redteam")
(host-name (string-append "172.18.6." (number->string (+ 60 vm-num))))
(identity-file "/home/robby/.ssh/redteam_key")
(proxy (list
(proxy-jump (host-name (string-append "vce" (number->string vce-num))))))
(extra-content
(string-append " DynamicForward 8888\n"
" StrictHostKeyChecking no\n"
" UserKnownHostsFile=/dev/null"))))
vm-numbers))
vce-numbers)))
(define redteam-kali-vms (generate-openssh-hosts 2 10))
(home-environment
;; Below is the list of packages that will show up in your
;; Home profile, under ~/.guix-home/profile.
(packages home-packages)
;; Below is the list of Home services. To search for available
;; services, run 'guix home search KEYWORD' in a terminal.
(services
(list (service home-bash-service-type
(home-bash-configuration
(aliases '(("grep" . "grep --color=auto")
("ll" . "ls -l")
("ls" . "ls -p --color=auto")
("cp" . "cp --preserve=timestamps")
("reboot" . "loginctl reboot")
("poweroff" . "loginctl poweroff")
("hibernate" . "loginctl hibernate")
("p1" . "ping 1.1.1.1")
("p8" . "ping 8.8.8.8")
("e" . "emacsclient -r -n")
("kubectl" . "minikube kubectl --")
("duckdb" . "env LD_LIBRARY_PATH=/home/robby/.guix-profile/lib:$LD_LIBRARY_PATH $HOME/.local/bin/duckdb")
("nats" . "LD_LIBRARY_PATH=\"/gnu/store/9p1z62lff9czkr95n3sal97rjw5lm7wl-gcc-toolchain-14.2.0/lib:$LD_LIBRARY_PATH\" nats")
("sway" . "XDG_CURRENT_DESKTOP=sway dbus-run-session sway")))
(environment-variables
'(("BUN_INSTALL" . "$HOME/.bun")
("PATH" . "$BUN_INSTALL/bin:$PATH")
("PATH" . "$HOME/go/bin:$PATH")
("PATH" . "$HOME/.local/bin:$PATH")
("PATH" . "$HOME/.cargo/bin:$PATH")
("PATH" . "$HOME/.vnode/bin:$PATH")
("PODMAN_COMPOSE_WARNING_LOGS" . "false")
("BROWSER" . "xdg-open")
("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/home/robby/.local/share/flatpak/exports/share")))
(bashrc (list (local-file "home.bashrc"
"bashrc")))
(bash-profile (list (local-file
"home.bash_profile"
"bash_profile")))))
(service home-dbus-service-type)
(service home-xdg-configuration-files-service-type
`(;; ("sway/config" ,(plain-file "sway-config" rz/sway-config))
("emacs/init.el" ,(plain-file "init.el" rz/emacs-config))
("foot/foot.ini" ,(plain-file "foot.ini" foot-config))
("wofi/config" ,(local-file "wofi/config"))
("wofi/style.css" ,(local-file "wofi/style.css"))
("git/config" ,(plain-file "git-config" rz/git-config))
("bat/config" ,(plain-file "bat-config" bat-config))
("guix-gaming-channels/games.scm" ,(plain-file "guix-gaming-config" guix-gaming-config))))
(service home-files-service-type
`((".mbsyncrc" ,(local-file "mbsyncrc"))
(".nmprc" ,(plain-file "npmrc" "prefix=/home/robby/.vnode"))))
(service home-sway-service-type
(sway-configuration
(variables
(append %sway-default-variables
`((menu . "wofi -c ~/.config/wofi/config -I"))))
(extra-content (list rz/sway-config))))
(service home-shepherd-service-type
(home-shepherd-configuration
(services
(list
;; (shepherd-service
;; (documentation "SwayWM")
;; (provision '(sway))
;; (requirement '(dbus))
;; (respawn? #f)
;; (auto-start? #f)
;; (start #~(make-forkexec-constructor
;; (list #$(file-append (specification->package "dbus") "/bin/dbus-run-session") "sway")
;; #:log-file (string-append #$log-dir "/swaywm.log")))
;; (stop #~(make-system-destructor
;; (string-join (list #$(file-append (specification->package "sway") "/bin/swaymsg")
;; "exit")))))
(shepherd-service
(documentation "Emacs Server")
(provision '(emacs))
(start #~(make-system-constructor "emacs --daemon"))
(stop #~(make-system-destructor "emacsclient --eval \"(kill-emacs)\"")))
(shepherd-service
(documentation "Run a Radicle node")
(provision '(rad))
(start #~(make-forkexec-constructor
(list "/home/robby/.cargo/bin/rad" "node" "start" "--path" "/home/robby/.cargo/bin/radicle-node" "--foreground")
#:log-file (string-append #$log-dir "/rad-node.log")))
(stop #~(make-system-destructor "/home/robby/.cargo/bin/rad node stop"))
(respawn? #t))
(shepherd-service
(documentation "Run the Radicle web API")
(provision '(rad-web))
(start #~(make-forkexec-constructor
(list "/home/robby/.cargo/bin/rad-web" "--no-open")
#:log-file (string-append #$log-dir "/rad-web.log")))
(stop #~(make-kill-destructor))
(respawn? #t))))))
(service home-pipewire-service-type)
(simple-service 'some-useful-env-vars-service
home-environment-variables-service-type
`(("LESSHISTFILE" . "$XDG_CACHE_HOME/.lesshst")
("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/home/robby/.local/share/flatpak/exports/share")
("EDITOR" . "emacsclient -n -a emacs")
("EMACSLOADPATH" . "$HOME/.guix-home/profile/share/emacs/site-lisp/")
("XDG_DESKTOP_DIR" . "$HOME/desktop")
("XDG_DOWNLOAD_DIR" . "$HOME/downloads")
("XDG_TEMPLATES_DIR" . "$HOME/templates")
("XDG_PUBLICSHARE_DIR" . "$HOME/public")
("XDG_DOCUMENTS_DIR" . "$HOME/documents")
("XDG_MUSIC_DIR" . "$HOME/music")
("XDG_PICTURES_DIR" . "$HOME/pictures")
("XDG_VIDEOS_DIR" . "$HOME/videos")
("BROWSER" . "xdg-open")
("PODMAN_COMPOSE_WARNING_LOGS" . "false")
;; Required to open links in Firefox with DBUS instead of X11 sockets
("MOZ_DBUS_REMOTE" . "1")
("MOZ_ENABLE_WAYLAND" . "1")))
(service home-openssh-service-type
(home-openssh-configuration
(hosts
(append (list (openssh-host (name "not-a-pi")
(host-name "10.69.0.1"))
(openssh-host (name "zoinks")
(host-name "zoinks.one"))
(openssh-host (name "lowell-makes")
(host-name "96.81.79.90")
(port 1122))
(openssh-host (name "lowell-makes-cameo2")
(host-name "cameo2")
(port 22)
(proxy (list
(proxy-jump (host-name "lowell-makes")))))
(openssh-host (name "lowell-makes-cameo")
(host-name "cameo")
(port 22)
(proxy (list
(proxy-jump (host-name "lowell-makes")))))
(openssh-host (name "lowell-makes-mogan")
(host-name "mogan")
(port 22)
(proxy (list
(proxy-jump (host-name "lowell-makes")))))
(openssh-host (name "bustelo")
(host-name "10.5.10.187")
(port 22)
(proxy (list
(proxy-jump (host-name "lowell-makes")))))
(openssh-host (name "moja")
(host-name "45.77.97.44"))
(openssh-host (name "babel")
(host-name "10.80.80.162"))
(openssh-host (name "alpha.apex")
(host-name "149.28.47.99"))
(openssh-host (name "cnyhackathon-jump")
(host-name "vce.cnyhackathon.org")
(user "rz")
(port 2210)
(extra-content
(string-append " DynamicForward 8888\n")))
(openssh-host (name "kali")
(user "redteam")
(host-name (string-append "172.18.6." (number->string (+ 60 7))))
(identity-file "/home/robby/.ssh/redteam_key")
(proxy (list
(proxy-jump (host-name "cnyhackathon-jump"))))
(extra-content
(string-append " DynamicForward 8888\n"
" StrictHostKeyChecking no\n"
" UserKnownHostsFile=/dev/null")))
(openssh-host (name "vce1")
(host-name "vce1.ncaecybergames.org")
(user "rz")
(port 2210)
(extra-content
(string-append " DynamicForward 8888\n")))
(openssh-host (name "vce2")
(host-name "vce2.ncaecybergames.org")
(user "rz")
(port 2210)
(extra-content
(string-append " DynamicForward 8888\n"))))
redteam-kali-vms))
(authorized-keys (cdr (assq 'ssh-authorized-keys secrets)))))
;; (simple-service 'variant-packages-service
;; home-channels-service-type
;; (cons*
;; ;; (channel
;; ;; (name 'nonguix)
;; ;; (url "https://git.robbyzambito.me/mirror/nonguix.git")
;; ;; (branch "steam-no-pulse"))
;; (channel
;; (name 'nonguix)
;; (url "https://gitlab.com/nonguix/nonguix")
;; ;; Enable signature verification:
;; (introduction
;; (make-channel-introduction
;; "897c1a470da759236cc11798f4e0a5f7d4d59fbc"
;; (openpgp-fingerprint
;; "2A39 3FFF 68F4 EF7A 3D29 12AF 6F51 20A0 22FB B2D5"))))
;; (channel
;; (name 'guix-gaming-games)
;; (url "https://gitlab.com/guix-gaming-channels/games.git")
;; ;; Enable signature verification:
;; (introduction
;; (make-channel-introduction
;; "c23d64f1b8cc086659f8781b27ab6c7314c5cca5"
;; (openpgp-fingerprint
;; "50F3 3E2E 5B0C 3D90 0424 ABE8 9BDC F497 A4BB CC7F"))))
;; (channel
;; (name 'guix)
;; (url "https://codeberg.org/guix/guix.git")
;; (branch "master"))
;; ;; (channel
;; ;; (name 'guix)
;; ;; (url "https://codeberg.org/guix/guix.git")
;; ;; (branch "master")
;; ;; (introduction
;; ;; (make-channel-introduction
;; ;; "9edb3f66fd807b096b48283debdcddccfea34bad"
;; ;; (openpgp-fingerprint
;; ;; "BBB0 2DDF 2CEA F6A8 0D1D E643 A2A0 6DF2 A33A 54FA"))))
;; '()
;; ;; %default-channels
;; ))
)))
|