mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-12-06 19:08:05 +00:00
Compare commits
269
Commits
0b6b5feb72
...
trunk
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c7b110f44 | ||
|
|
dc1eb9b49f | ||
|
|
d79904c39c | ||
|
|
dd6f34d630 | ||
|
|
e4673718e1 | ||
|
|
5c9acbaf76 | ||
|
|
9df7b98170 | ||
|
|
9a3dbeabcd | ||
|
|
d63b2e8ed4 | ||
|
|
bfcb3e35f6 | ||
|
|
bd8ba90e4d | ||
|
|
1ce5a82fac | ||
|
|
020eeab068 | ||
|
|
5b6492be2e | ||
|
|
5c805b94ca | ||
|
|
a9b702223f | ||
|
|
689357179a | ||
|
|
7bd1855a00 | ||
|
|
7f6cdacf9d | ||
|
|
cb73c01597 | ||
|
|
ef4eb81a56 | ||
|
|
b4f703f33d | ||
|
|
07f3c47c02 | ||
|
|
b755c0d018 | ||
|
|
6af9d5426f | ||
|
|
a8da12053f | ||
|
|
2f77ce5db2 | ||
|
|
0dec192155 | ||
|
|
c174d7a009 | ||
|
|
357aba2039 | ||
|
|
328d7023af | ||
|
|
e4dafed2ad | ||
|
|
17cae93520 | ||
|
|
fff737cc07 | ||
|
|
a6736d8030 | ||
|
|
00b4c71c87 | ||
|
|
809e90d7fb | ||
|
|
bfe0d7379d | ||
|
|
e0db50c276 | ||
|
|
55d68222f4 | ||
|
|
1c6b3e3cb6 | ||
|
|
22d0abb36a | ||
|
|
0daf8b388b | ||
|
|
a19f1684cf | ||
|
|
a4de900221 | ||
|
|
a6124dd914 | ||
|
|
0e4f53ed58 | ||
|
|
c3781eefc8 | ||
|
|
8b1ecc349e | ||
|
|
cdb841b71e | ||
|
|
18cef20133 | ||
|
|
078c2d7983 | ||
|
|
877fe611c6 | ||
|
|
9c154fa85c | ||
|
|
279e3645b6 | ||
|
|
19d981d97a | ||
|
|
fb5e0fd076 | ||
|
|
c3cb87ecb5 | ||
|
|
e0333310c8 | ||
|
|
db99800394 | ||
|
|
4f8e710735 | ||
|
|
42e0ad6d86 | ||
|
|
f5da8e8aeb | ||
|
|
30cb0fca4f | ||
|
|
0999318f8d | ||
|
|
3507deee77 | ||
|
|
db46c04f3d | ||
|
|
2b03183286 | ||
|
|
579db10847 | ||
|
|
7912112268 | ||
|
|
be842ba63f | ||
|
|
2fb0028c81 | ||
|
|
c27ac08668 | ||
|
|
4b892bd318 | ||
|
|
52f55af4e9 | ||
|
|
9b9071c9e0 | ||
|
|
f6a6436ebc | ||
|
|
a7073acb39 | ||
|
|
276eca71dd | ||
|
|
e1b25f7d8d | ||
|
|
9afc4e56da | ||
|
|
27baf1ba57 | ||
|
|
fc235e2eb0 | ||
|
|
e076f5f3de | ||
|
|
01d1c44615 | ||
|
|
8a41a4e33d | ||
|
|
42e079f438 | ||
|
|
631adacf12 | ||
|
|
b98b1b1e9f | ||
|
|
2e08e1a93e | ||
|
|
90537893e2 | ||
|
|
15e867800b | ||
|
|
717eb109be | ||
|
|
58c47e9bfc | ||
|
|
c62ff66702 | ||
|
|
98a49dcb06 | ||
|
|
14ce4e3aba | ||
|
|
567a1e7a55 | ||
|
|
f25d748dbd | ||
|
|
9f77f8a014 | ||
|
|
3e1ac671e3 | ||
|
|
8f5f47e0c3 | ||
|
|
ee479dbfda | ||
|
|
200667cddc | ||
|
|
c66f1a8c8d | ||
|
|
1122c6fec9 | ||
|
|
755e5c109a | ||
|
|
6142ed7cd5 | ||
|
|
a332d68283 | ||
|
|
a3b53eb118 | ||
|
|
649be3f514 | ||
|
|
ccc53c9afc | ||
|
|
731b5877ff | ||
|
|
c2897f17ad | ||
|
|
2dae5082ff | ||
|
|
5119a0fbfd | ||
|
|
9525c5b1c0 | ||
|
|
bdde9175c6 | ||
|
|
e4aff75551 | ||
|
|
0d00baa9e1 | ||
|
|
34502202bf | ||
|
|
641f1fbd71 | ||
|
|
1398722e04 | ||
|
|
74b0cd7410 | ||
|
|
ed54329e1f | ||
|
|
14bde08c8b | ||
|
|
1f35f0e393 | ||
|
|
87bfe33314 | ||
|
|
5f312b336d | ||
|
|
805ea83faf | ||
|
|
8aae7d26dd | ||
|
|
8bebafaacd | ||
|
|
b353ee7610 | ||
|
|
09bfd608cf | ||
|
|
2816e3e06a | ||
|
|
8f0677e5e3 | ||
|
|
0f8ae9ca08 | ||
|
|
8a8142d16c | ||
|
|
b15af6f9ff | ||
|
|
08b1980f22 | ||
|
|
9454089804 | ||
|
|
ed43a49877 | ||
|
|
c8625f6a8c | ||
|
|
a88ac359a0 | ||
|
|
f34040153c | ||
|
|
bde35a43ac | ||
|
|
c45fecb485 | ||
|
|
996ebc9ec0 | ||
|
|
a6a6564eab | ||
|
|
4b0111cdd7 | ||
|
|
890a978283 | ||
|
|
b93fb3a2b5 | ||
|
|
93f50036db | ||
|
|
ab3698c4ad | ||
|
|
91f2eac90a | ||
|
|
83af642df3 | ||
|
|
5d831de5b5 | ||
|
|
cc797a3378 | ||
|
|
a21dc8e795 | ||
|
|
44e890633e | ||
|
|
7aa919844f | ||
|
|
c6361f6e7b | ||
|
|
ba37355893 | ||
|
|
21391bab6e | ||
|
|
d624abc771 | ||
|
|
956de518d2 | ||
|
|
9a7c64ce33 | ||
|
|
4f3ac7df33 | ||
|
|
9ece9f0544 | ||
|
|
55b07c9767 | ||
|
|
9f0956bfbe | ||
|
|
ef94c881f4 | ||
|
|
010f5f210a | ||
|
|
7a0190a86b | ||
|
|
4982100143 | ||
|
|
1e87b9028b | ||
|
|
3d11e4c069 | ||
|
|
2bf3bf916e | ||
|
|
bb0a9bebf1 | ||
|
|
2fe29cce0a | ||
|
|
87b05c2535 | ||
|
|
c225a5846f | ||
|
|
72b15a5eb2 | ||
|
|
a1bcd459d2 | ||
|
|
916c283444 | ||
|
|
58f025804c | ||
|
|
ee1573b734 | ||
|
|
104ebd3348 | ||
|
|
28aa141446 | ||
|
|
410be8c1be | ||
|
|
e50e842994 | ||
|
|
8237066e73 | ||
|
|
ba91ca76c0 | ||
|
|
6e28a0825b | ||
|
|
ecdb930021 | ||
|
|
ed592c6c6e | ||
|
|
42269efc67 | ||
|
|
87d4e55ea4 | ||
|
|
2e9ba3e2a5 | ||
|
|
1edd471f4c | ||
|
|
43f10a6062 | ||
|
|
63d7c774dc | ||
|
|
08ac8f2e93 | ||
|
|
5d5aefca89 | ||
|
|
3a0838e5e0 | ||
|
|
d687672c1c | ||
|
|
4d553b92ce | ||
|
|
6cf57b252d | ||
|
|
745ad5e88f | ||
|
|
388bb5dbd0 | ||
|
|
386de67aee | ||
|
|
180635cee4 | ||
|
|
30af71b024 | ||
|
|
c2722ed176 | ||
|
|
428a150814 | ||
|
|
39eb45af2b | ||
|
|
e28731a5de | ||
|
|
5f88ec068e | ||
|
|
83773b25db | ||
|
|
4d2f3a2e0c | ||
|
|
205b14dd34 | ||
|
|
06a8a5f726 | ||
|
|
fe34e0911d | ||
|
|
3f77432233 | ||
|
|
7a2f31556f | ||
|
|
17c2fdf76e | ||
|
|
8bf6002818 | ||
|
|
ffce98cafe | ||
|
|
398f692861 | ||
|
|
32b08cc095 | ||
|
|
fbb478cc2c | ||
|
|
b8f6b048c9 | ||
|
|
7de4e2bc47 | ||
|
|
05ac833e35 | ||
|
|
9033ba867d | ||
|
|
07a823cb6b | ||
|
|
02723cc74a | ||
|
|
a1452f76ac | ||
|
|
40a0e474c7 | ||
|
|
9f9e2915bf | ||
|
|
3f71c1448b | ||
|
|
ed943d36b4 | ||
|
|
c5b6a2832d | ||
|
|
f1cdc992a2 | ||
|
|
8d0f3f34c7 | ||
|
|
baa2213866 | ||
|
|
8c29cb4cde | ||
|
|
eeedc71a06 | ||
|
|
9462b7c3db | ||
|
|
1df01c6699 | ||
|
|
83bd48e8c0 | ||
|
|
592ad3d9e8 | ||
|
|
fc0fced73c | ||
|
|
87f3cb47d7 | ||
|
|
258d5123ce | ||
|
|
a9ade5af1c | ||
|
|
5bafe4f0b1 | ||
|
|
5a5dffb983 | ||
|
|
506a39e83a | ||
|
|
a53ee17e5a | ||
|
|
3fd458447b | ||
|
|
27ed879db1 | ||
|
|
239b86e51d | ||
|
|
d1c4b82750 | ||
|
|
05f69100c3 | ||
|
|
c660951855 | ||
|
|
2889a00542 | ||
|
|
42701881b4 | ||
|
|
86d418b080 |
No files matched your search
+7
-512
@@ -40,55 +40,20 @@
|
||||
(fill-column . 72)))
|
||||
(scheme-mode
|
||||
.
|
||||
((eval . (put 'computed-substitution-with-inputs 'scheme-indent-function 1))
|
||||
((geiser-repl-add-project-paths . ("modules"))
|
||||
|
||||
(eval . (put 'match-record/dolly 'scheme-indent-function 3))
|
||||
(eval . (put 'match-record-lambda/dolly 'scheme-indent-function 2))
|
||||
|
||||
(eval . (put 'computed-substitution-with-inputs 'scheme-indent-function 1))
|
||||
(eval . (put 'hidden-desktop-entry 'scheme-indent-function 1))
|
||||
(eval . (put 'modify-services/by-name 'scheme-indent-function 1))
|
||||
|
||||
(eval . (put 'btrbk-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'caddy-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'clash-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cloudflare-tunnel-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cloudflare-warp-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cuirass-worker-container-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'docker-mailserver-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'forgejo-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-atuin-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-blueman-applet-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-direnv-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-fcitx5-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-mako-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-network-manager-applet-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-niri-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-qbittorrent-service-type 'scheme-indent-function 0))
|
||||
(eval . (put 'home-rofi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-socks2http-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-swaybg-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-theme-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-wakapi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-waybar-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-zoxide-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'jellyfin-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'komga-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'miniflux-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'misskey-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'navidrome-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'qbittorrent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'shadow-tls-client-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'shadow-tls-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'shadow-tls-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'smartdns-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tailscale-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'vaultwarden-configuration 'scheme-indent-function 0))
|
||||
;; Nonguix
|
||||
;; Note this next setting will use the current guix as the geiser binary;
|
||||
;; one working with a local guix checkout may want something different.
|
||||
(geiser-guile-binary . ("guix" "repl"))
|
||||
|
||||
(eval . (put 'with-transformation 'scheme-indent-function 1))
|
||||
|
||||
(eval . (put 'nonguix-container 'scheme-indent-function 0))
|
||||
(eval . (put 'nvidia-configuration 'scheme-indent-function 0))
|
||||
|
||||
;; Below are copied from Guix.
|
||||
(indent-tabs-mode . nil)
|
||||
@@ -222,474 +187,4 @@
|
||||
|
||||
(eval . (put 'with-shepherd-action 'scheme-indent-function 3))
|
||||
|
||||
(eval . (put 'with-http-server 'scheme-indent-function 1))
|
||||
|
||||
;; Record constructors.
|
||||
;; URIs for origin methods.
|
||||
(eval . (put 'android-repo-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'bzr-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'cvs-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'git-checkout 'scheme-indent-function 0))
|
||||
(eval . (put 'git-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'hg-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'svn-multi-reference 'scheme-indent-function 0))
|
||||
(eval . (put 'svn-reference 'scheme-indent-function 0))
|
||||
|
||||
;; guix/
|
||||
(eval . (put 'avahi-service 'scheme-indent-function 0))
|
||||
(eval . (put 'bag 'scheme-indent-function 0))
|
||||
(eval . (put 'build-status 'scheme-indent-function 0))
|
||||
(eval . (put 'build-system 'scheme-indent-function 0))
|
||||
(eval . (put 'channel 'scheme-indent-function 0))
|
||||
(eval . (put 'gnu-package-descriptor 'scheme-indent-function 0))
|
||||
(eval . (put 'graft 'scheme-indent-function 0))
|
||||
(eval . (put 'lint-checker 'scheme-indent-function 0))
|
||||
(eval . (put 'lint-warning 'scheme-indent-function 0))
|
||||
(eval . (put 'manifest-entry 'scheme-indent-function 0))
|
||||
(eval . (put 'manifest-pattern 'scheme-indent-function 0))
|
||||
(eval . (put 'manifest-transaction 'scheme-indent-function 0))
|
||||
(eval . (put 'node-type 'scheme-indent-function 0))
|
||||
(eval . (put 'origin 'scheme-indent-function 0))
|
||||
(eval . (put 'package 'scheme-indent-function 0))
|
||||
(eval . (put 'platform 'scheme-indent-function 0))
|
||||
(eval . (put 'profile 'scheme-indent-function 0))
|
||||
(eval . (put 'progress-reporter 'scheme-indent-function 0))
|
||||
(eval . (put 'search-path-specification 'scheme-indent-function 0))
|
||||
(eval . (put 'upstream-input 'scheme-indent-function 0))
|
||||
(eval . (put 'upstream-source 'scheme-indent-function 0))
|
||||
(eval . (put 'upstream-updater 'scheme-indent-function 0))
|
||||
|
||||
;; gnu/
|
||||
(eval . (put 'bootloader 'scheme-indent-function 0))
|
||||
(eval . (put 'bootloader-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'image 'scheme-indent-function 0))
|
||||
(eval . (put 'image-type 'scheme-indent-function 0))
|
||||
(eval . (put 'menu-entry 'scheme-indent-function 0))
|
||||
(eval . (put 'partition 'scheme-indent-function 0))
|
||||
|
||||
;; gnu/machine
|
||||
(eval . (put 'digital-ocean-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'environment-type 'scheme-indent-function 0))
|
||||
(eval . (put 'hetzner-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'machine 'scheme-indent-function 0))
|
||||
(eval . (put 'machine-ssh-configuration 'scheme-indent-function 0))
|
||||
|
||||
;; gnu/system
|
||||
(eval . (put 'boot-parameters 'scheme-indent-function 0))
|
||||
(eval . (put 'file-system 'scheme-indent-function 0))
|
||||
(eval . (put 'file-system-mapping 'scheme-indent-function 0))
|
||||
(eval . (put 'locale-definition 'scheme-indent-function 0))
|
||||
(eval . (put 'mapped-device 'scheme-indent-function 0))
|
||||
(eval . (put 'mapped-device-kind 'scheme-indent-function 0))
|
||||
(eval . (put 'name-service 'scheme-indent-function 0))
|
||||
(eval . (put 'name-service-switch 'scheme-indent-function 0))
|
||||
(eval . (put 'operating-system 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-entry 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-service 'scheme-indent-function 0))
|
||||
(eval . (put 'privileged-program 'scheme-indent-function 0))
|
||||
(eval . (put 'subid-range 'scheme-indent-function 0))
|
||||
(eval . (put 'subids-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'subids-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'swap-space 'scheme-indent-function 0))
|
||||
(eval . (put 'user-account 'scheme-indent-function 0))
|
||||
(eval . (put 'user-group 'scheme-indent-function 0))
|
||||
(eval . (put 'virtual-machine 'scheme-indent-function 0))
|
||||
|
||||
;; gnu/home
|
||||
(eval . (put 'home-bash-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-bash-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'home-batsignal-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-beets-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-dbus-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-dotfiles-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-environment 'scheme-indent-function 0))
|
||||
(eval . (put 'home-fish-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-fish-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'home-gpg-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-inputrc-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-kodi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-mcron-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-msmtp-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-openssh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-parcimonie-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-pipewire-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-redshift-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-shell-profile-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-shepherd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-ssh-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-unclutter-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-xdg-base-directories-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-xdg-mime-applications-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-xdg-user-directories-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-xmodmap-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-znc-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-zsh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'home-zsh-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'msmtp-account 'scheme-indent-function 0))
|
||||
(eval . (put 'msmtp-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openssh-host 'scheme-indent-function 0))
|
||||
(eval . (put 'point 'scheme-indent-function 0))
|
||||
(eval . (put 'proxy-jump 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-bar 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-border-color 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-color 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-input 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-mode 'scheme-indent-function 0))
|
||||
(eval . (put 'sway-output 'scheme-indent-function 0))
|
||||
(eval . (put 'xdg-desktop-action 'scheme-indent-function 0))
|
||||
(eval . (put 'xdg-desktop-entry 'scheme-indent-function 0))
|
||||
|
||||
;; gnu/services
|
||||
(eval . (put 'agate-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'agetty-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'alsa-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'anonip-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'apcupsd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'apcupsd-event-handlers 'scheme-indent-function 0))
|
||||
(eval . (put 'auditd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'autossh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'avahi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'backend-userroot-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'bffe-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'bitlbee-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'bluetooth-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cachefilesd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'certbot-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cgit-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'configuration-field 'scheme-indent-function 0))
|
||||
(eval . (put 'connman-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'connman-general-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'containerd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cuirass-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cuirass-remote-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cuirass-remote-worker-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'cups-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'darkstat-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dbus-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dconf-keyfile 'scheme-indent-function 0))
|
||||
(eval . (put 'dconf-profile 'scheme-indent-function 0))
|
||||
(eval . (put 'debootstrap-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dhcp-client-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dhcpcd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dhcpd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dicod-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dict-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'directory-server-instance-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dnsmasq-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'docker-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dovecot-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'dropbear-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'earlyoom-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'elogind-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'enlightenment-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'exim-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ext-component-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fail2ban-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fail2ban-ignore-cache-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fail2ban-jail-action-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fail2ban-jail-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fail2ban-jail-filter-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fcgiwrap-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fifo-listener-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'file-database-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'files-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fprintd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'fstrim-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-cleaner-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-confd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-kvmd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-luxid-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-metad-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-mond-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-noded-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-os 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-os-variant 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-rapi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-watcher-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ganeti-wconfd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gdm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'geoclue-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'getmail-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'getmail-configuration-file 'scheme-indent-function 0))
|
||||
(eval . (put 'getmail-destination-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'getmail-options-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'getmail-retriever-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'git-daemon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'git-http-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gitile-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gitolite-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gitolite-git-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gitolite-rc-file 'scheme-indent-function 0))
|
||||
(eval . (put 'gmnisrv-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gnome-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gnome-keyring-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gpm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-agreety-session 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-gtkgreet-sway-session 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-terminal-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-user-session 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-wlgreet-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-wlgreet-session 'scheme-indent-function 0))
|
||||
(eval . (put 'greetd-wlgreet-sway-session 'scheme-indent-function 0))
|
||||
(eval . (put 'gss-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-agent-dynamic-auth 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-agent-dynamic-auth-with-file 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-agent-password-auth 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-agent-password-file-auth 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-build-coordinator-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-data-service-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-extension 'scheme-indent-function 0))
|
||||
(eval . (put 'guix-publish-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'gvfs-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'host 'scheme-indent-function 0))
|
||||
(eval . (put 'hostapd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'hpcguix-web-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'httpd-config-file 'scheme-indent-function 0))
|
||||
(eval . (put 'httpd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'httpd-module 'scheme-indent-function 0))
|
||||
(eval . (put 'httpd-virtualhost 'scheme-indent-function 0))
|
||||
(eval . (put 'hurd-console-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'hurd-getty-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'hurd-vm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'idmap-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'imap4d-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'inet-listener-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'inetd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'inetd-entry 'scheme-indent-function 0))
|
||||
(eval . (put 'inputattach-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'int-component-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ipfs-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'iptables-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-general-settings 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-network-settings 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-scan-settings 'scheme-indent-function 0))
|
||||
(eval . (put 'iwd-settings 'scheme-indent-function 0))
|
||||
(eval . (put 'jami-account 'scheme-indent-function 0))
|
||||
(eval . (put 'jami-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'joycond-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'keepalived-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'kmscon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-acl-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-key-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-keystore-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-policy-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-remote-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-resolver-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'knot-zone-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'krb5-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'krb5-realm 'scheme-indent-function 0))
|
||||
(eval . (put 'kwallet-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ladspa-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'laminar-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'libvirt-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lightdm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lightdm-gtk-greeter-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lightdm-seat-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'linux-builder-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lirc-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'live-service 'scheme-indent-function 0))
|
||||
(eval . (put 'localed-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'location-access-control 'scheme-indent-function 0))
|
||||
(eval . (put 'log-cleanup-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'log-rotation 'scheme-indent-function 0))
|
||||
(eval . (put 'log-rotation-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'login-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lsh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'lxqt-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mailbox-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mate-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mcron-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'memcached-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'method-access-control 'scheme-indent-function 0))
|
||||
(eval . (put 'mingetty-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mod-muc-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'modem-manager-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mosquitto-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mpd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mpd-output 'scheme-indent-function 0))
|
||||
(eval . (put 'mpd-partition 'scheme-indent-function 0))
|
||||
(eval . (put 'mpd-plugin 'scheme-indent-function 0))
|
||||
(eval . (put 'mumble-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mumble-server-public-registration-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mumi-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mumi-package-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mympd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'mympd-ip-acl 'scheme-indent-function 0))
|
||||
(eval . (put 'mysql-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'namespace-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nar-herder-cached-compression-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nar-herder-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'network-address 'scheme-indent-function 0))
|
||||
(eval . (put 'network-link 'scheme-indent-function 0))
|
||||
(eval . (put 'network-manager-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'network-route 'scheme-indent-function 0))
|
||||
(eval . (put 'nfs-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nftables-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-location-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-log-format-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-named-location-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nginx-upstream-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-channel 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-global 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-limits 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-operator 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-options 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-server 'scheme-indent-function 0))
|
||||
(eval . (put 'ngircd-ssl 'scheme-indent-function 0))
|
||||
(eval . (put 'nix-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nscd-cache 'scheme-indent-function 0))
|
||||
(eval . (put 'nscd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'nslcd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ntp-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ntp-server 'scheme-indent-function 0))
|
||||
(eval . (put 'oci-container-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'oci-image 'scheme-indent-function 0))
|
||||
(eval . (put 'opaque-cgit-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'opaque-cups-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'opaque-dovecot-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'opaque-prosody-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'opendht-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openntpd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'opensmtpd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openssh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openvpn-ccd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openvpn-client-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openvpn-remote-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openvpn-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'openvswitch-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'operation-access-control 'scheme-indent-function 0))
|
||||
(eval . (put 'package-database-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pagekite-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-krb5-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-mount-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pam-mount-volume 'scheme-indent-function 0))
|
||||
(eval . (put 'passdb-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'patchwork-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'patchwork-database-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'patchwork-settings-module 'scheme-indent-function 0))
|
||||
(eval . (put 'pcscd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'php-fpm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'php-fpm-dynamic-process-manager-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'php-fpm-on-demand-process-manager-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'php-fpm-static-process-manager-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pipefs-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'plasma-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'plugin-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'policy-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'polkit-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'postgresql-config-file 'scheme-indent-function 0))
|
||||
(eval . (put 'postgresql-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'postgresql-role 'scheme-indent-function 0))
|
||||
(eval . (put 'pounce-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'power-profiles-daemon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'powertop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'prometheus-node-exporter-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'prosody-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'protocol-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'pulseaudio-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'qemu-binfmt-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'qemu-guest-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'quassel-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-auth-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-encoding-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-logging-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-rights-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'radicale-storage-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rasdaemon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'readymedia-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'readymedia-media-directory 'scheme-indent-function 0))
|
||||
(eval . (put 'redis-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'repository-cgit-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'resize-file-system-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'restic-backup-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'restic-backup-job 'scheme-indent-function 0))
|
||||
(eval . (put 'rngd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rootless-podman-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rottlog-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rpcbind-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rshiny-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rspamd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rsync-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'rsync-module 'scheme-indent-function 0))
|
||||
(eval . (put 'samba-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'screen-locker-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'sddm-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'seatd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'service-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'service-type 'scheme-indent-function 0))
|
||||
(eval . (put 'shepherd-action 'scheme-indent-function 0))
|
||||
(eval . (put 'shepherd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'shepherd-service 'scheme-indent-function 0))
|
||||
(eval . (put 'slim-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'snuik-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'speakersafetyd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'spice-vdagent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'ssl-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'static-networking 'scheme-indent-function 0))
|
||||
(eval . (put 'strongswan-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'sugar-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'syncthing-config-file 'scheme-indent-function 0))
|
||||
(eval . (put 'syncthing-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'syncthing-device 'scheme-indent-function 0))
|
||||
(eval . (put 'syncthing-folder 'scheme-indent-function 0))
|
||||
(eval . (put 'syncthing-folder-device 'scheme-indent-function 0))
|
||||
(eval . (put 'sysctl-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'syslog-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'system-log-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tailon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tailon-configuration-file 'scheme-indent-function 0))
|
||||
(eval . (put 'thermald-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tlp-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tor-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tor-onion-service-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'tor-transport-plugin 'scheme-indent-function 0))
|
||||
(eval . (put 'transmission-daemon-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'udev-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'udisks-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'unattended-upgrade-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'unbound-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'unbound-remote 'scheme-indent-function 0))
|
||||
(eval . (put 'unbound-server 'scheme-indent-function 0))
|
||||
(eval . (put 'unbound-zone 'scheme-indent-function 0))
|
||||
(eval . (put 'unix-listener-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'upower-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'usb-modeswitch-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'userdb-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'varnish-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'virtlog-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'virtual-build-machine 'scheme-indent-function 0))
|
||||
(eval . (put 'virtualhost-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'vnstat-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'webssh-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'wesnothd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'whoogle-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'wireguard-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'wireguard-peer 'scheme-indent-function 0))
|
||||
(eval . (put 'wpa-supplicant-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'wsdd-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'xe-guest-utilities-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'xen-guest-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'xfce-desktop-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'xorg-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'xvnc-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'yggdrasil-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'zabbix-agent-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'zabbix-front-end-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'zabbix-server-configuration 'scheme-indent-function 0))
|
||||
(eval . (put 'zone-entry 'scheme-indent-function 0))
|
||||
(eval . (put 'zone-file 'scheme-indent-function 0))
|
||||
(eval . (put 'zram-device-configuration 'scheme-indent-function 0)))))
|
||||
(eval . (put 'with-http-server 'scheme-indent-function 1)))))
|
||||
+9
-4
@@ -6,8 +6,12 @@
|
||||
Rosenthal is a [[https://guix.gnu.org/manual/devel/en/html_node/Channels.html][Guix channel]] created for experiments. It currently holds some
|
||||
packages and services not ready for upstreaming.
|
||||
|
||||
NOTE: everything in this channel is subject to change and may be deleted **at
|
||||
any time**, please [[https://codeberg.org/hako/Rosenthal/issues][report an issue]] if you are affected.
|
||||
Feel free to upstream things from this channel if you find them useful and
|
||||
suitable. I can help with that but don't have the energy to finish all the
|
||||
process by myself.
|
||||
|
||||
NOTE: everything in this channel is subject to change and may be deleted *at any
|
||||
time*, please [[https://codeberg.org/hako/Rosenthal/issues][report an issue]] if you are affected.
|
||||
|
||||
Channel specification:
|
||||
#+begin_src scheme
|
||||
@@ -22,8 +26,9 @@ Channel specification:
|
||||
"13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7"))))
|
||||
#+end_src
|
||||
|
||||
You can use [[https://toys.whereis.social/?search=&channel=rosenthal][Toys]] to search packages, services and public symbols from Rosenthal
|
||||
and other Guix channels.
|
||||
Available packages and services are listed in [[file:etc/docs/index.org][index.org]] (outputed by the [[file:etc/scripts/index][index]]
|
||||
script). You can also use [[https://toys.whereis.social/?search=&channel=rosenthal][toys.whereis.social]] or [[https://search.guix.moe/?search=&channel=rosenthal][search.guix.moe]] to search them
|
||||
and public symbols from Rosenthal and other Guix channels.
|
||||
|
||||
[[https://guix.gnu.org/manual/devel/en/html_node/Substitutes.html][Substitutes]] (pre-built package binaries) for this channel are available via [[https://guix.moe/][Guix
|
||||
Moe]]'s infrastructure.
|
||||
@@ -0,0 +1,136 @@
|
||||
*** Packages
|
||||
| PACKAGE | SYNOPSIS | LOCATION |
|
||||
|-+-+-|
|
||||
|[[https://github.com/ai-robots-txt/ai.robots.txt][=ai-robots-txt=]]@2.1|List of AI agents and robots to block|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L37][web.scm]]|
|
||||
|[[https://grafana.com/oss/alloy-opentelemetry-collector/][=alloy-bin=]]@1.21.2|OpenTelemetry Collector distribution with programmable pipelines|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L609][binaries.scm]]|
|
||||
|[[https://github.com/anthonyhab/bb-auth][=bb-auth=]]@0.2.0|Unified polkit, keyring, and pinentry authentication daemon|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/authentication.scm#L22][authentication.scm]]|
|
||||
|[[https://bitwarden.com/][=bitwarden-icecat=]]@2026.10.0|Bitwarden client browser extension|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L48][browser-extensions.scm]]|
|
||||
|[[https://www.busybox.net][=busybox-static=]]@1.37.0|Many common UNIX utilities in a single executable|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/busybox.scm#L14][busybox.scm]]|
|
||||
|[[https://caddyserver.com/][=caddy=]]@2.11.7|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L70][web.scm]]|
|
||||
|[[https://git.guix.moe/hako/caddy][=caddy-dolly=]]@2026.10.23|Extensible HTTP web server with automatic HTTPS|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L139][web.scm]]|
|
||||
|[[https://1.1.1.1/][=cloudflare-warp-bin=]]@2026.8.2115.0|Cloudflare WARP client|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L42][binaries.scm]]|
|
||||
|[[https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/][=cloudflared=]]@2026.10.3|Cloudflare Tunnel client|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L25][networking.scm]]|
|
||||
|[[https://davmac.org/projects/dinit/][=dinit=]]@0.22.1|Service manager with dependency management|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/admin.scm#L25][admin.scm]]|
|
||||
|[[https://github.com/felixonmars/dnsmasq-china-list][=dnsmasq-china-list=]]@0.0.0-22.c79474a|Chinese-specific DNS server configurations|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/dns.scm#L18][dns.scm]]|
|
||||
|[[https://matt.ucc.asn.au/dropbear/dropbear.html][=dropbear-static=]]@2025.89|Small SSH server and client|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/ssh.scm#L16][ssh.scm]]|
|
||||
|[[https://github.com/Schnouki/caddyfile-mode][=emacs-caddyfile-mode=]]@0.2-0.fc41148|Emacs major mode for editing Caddy configuration files|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L25][emacs-xyz.scm]]|
|
||||
|[[https://github.com/dakra/ghostel][=emacs-consult-ghostel=]]@0.59.0|Consult integration for ghostel|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L51][emacs-xyz.scm]]|
|
||||
|[[https://codeberg.org/akib/emacs-eat][=emacs-eat-dolly=]]@0.9.4|Terminal emulator in Emacs|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L77][emacs-xyz.scm]]|
|
||||
|[[https://github.com/astoff/isearch-mb][=emacs-isearch-mb=]]@0.8|Control `isearch' from the minibuffer|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L95][emacs-xyz.scm]]|
|
||||
|[[https://github.com/taquangtrung/emacs-kdl-mode][=emacs-kdl-mode=]]@0.0.1-1.e966ed4|Emacs major mode for editing files in the KDL document language|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L120][emacs-xyz.scm]]|
|
||||
|[[https://github.com/dandavison/magit-delta][=emacs-magit-delta-dolly=]]@0.1-0.5fc7dbd|Integration of `delta' with `emacs-magit'|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L141][emacs-xyz.scm]]|
|
||||
|[[https://github.com/0WD0/majutsu][=emacs-majutsu-dolly=]]@0.6.0-7.19856a9|Emacs interface for Jujutsu version control system|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L156][emacs-xyz.scm]]|
|
||||
|[[https://github.com/xuchunyang/msgpack.el][=emacs-msgpack=]]@0.1.1-0.5353a7b|Read and write MessagePack object in Emacs|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L180][emacs-xyz.scm]]|
|
||||
|[[https://git.thanosapollo.org/pcmpl-tailscale][=emacs-pcmpl-tailscale=]]@0.0.1-0.acd6bce|Enhanced shell completions for tailscale|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L206][emacs-xyz.scm]]|
|
||||
|[[https://codeberg.org/divyaranjan/emacs-reader][=emacs-reader=]]@0.3.2-4.4fca3aa|Emacs document reader|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L231][emacs-xyz.scm]]|
|
||||
|[[https://github.com/ArthurHeymans/emacs-tramp-rpc][=emacs-tramp-rpc=]]@0.15.0|TRAMP backend using RPC|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L264][emacs-xyz.scm]]|
|
||||
|[[https://wakatime.com/emacs][=emacs-wakatime-mode=]]@1.0.2-60.1c5b225|Automatic time tracking extension for Emacs using WakaTime|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/emacs-xyz.scm#L298][emacs-xyz.scm]]|
|
||||
|[[https://forgejo.org/][=forgejo=]]@16.0.6|Self-hosted, lightweight software forge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/web.scm#L161][web.scm]]|
|
||||
|[[https://grafana.com/][=grafana-bin=]]@13.2.4|Platform for monitoring and observability|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L416][binaries.scm]]|
|
||||
|[[https://github.com/hylophile/guile-toml][=guile-toml=]]@1.0|TOML module for Guile Scheme|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/guile-xyz.scm#L19][guile-xyz.scm]]|
|
||||
|[[https://github.com/hifi/heisenbridge][=heisenbridge=]]@1.15.4|Bouncer-style Matrix IRC bridge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/messaging.scm#L33][messaging.scm]]|
|
||||
|[[https://komga.org/][=komga-bin=]]@1.29.1|Media server for comics/mangas/BDs/magazines/eBooks|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L190][binaries.scm]]|
|
||||
|[[https://sr.ht/~kennylevinsen/seatd][=libseat-sans-logind=]]@0.9.3|Seat management library|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/admin.scm#L62][admin.scm]]|
|
||||
|[[https://www.freedesktop.org/wiki/Software/vaapi/][=libva-nox=]]@2.22.0|Video acceleration library|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/video.scm#L14][video.scm]]|
|
||||
|[[https://github.com/Limine-Bootloader/Limine][=limine=]]@12.9.4|Multiprotocol bootloader and boot manager|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/bootloaders.scm#L40][bootloaders.scm]]|
|
||||
|[[https://cachyos.org/][=linux-cachyos-bore-zen4=]]@7.2.11-1|CachyOS Linux kernel (bore + znver4)|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/linux.scm#L289][linux.scm]]|
|
||||
|[[https://cachyos.org/][=linux-cachyos-lts-server=]]@6.18.55-1|CachyOS Linux kernel (lts + server)|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/linux.scm#L247][linux.scm]]|
|
||||
|[[https://grafana.com/oss/loki/][=loki-bin=]]@3.7.9|Log aggregation system|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L545][binaries.scm]]|
|
||||
|[[https://github.com/sot-tech/LottieConverter][=lottie-converter=]]@0.2-0.3ad34af|Lottie animation converter|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/animation.scm#L22][animation.scm]]|
|
||||
|[[https://github.com/mautrix/telegram][=mautrix-telegram=]]@0.2610.0|Matrix-Telegram hybrid puppeting/relaybot bridge|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/messaging.scm#L66][messaging.scm]]|
|
||||
|[[https://wiki.metacubex.one/][=mihomo=]]@1.19.33|Rule-based proxy|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L70][networking.scm]]|
|
||||
|[[https://grafana.com/oss/mimir/][=mimir-bin=]]@3.2.3|Scalable long-term storage for Prometheus|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L505][binaries.scm]]|
|
||||
|[[https://github.com/Sevichecc/miniflux-injector][=miniflux-injector-icecat=]]@2.3.3|Injects Miniflux search results into search page|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L97][browser-extensions.scm]]|
|
||||
|[[https://codeberg.org/hako/mirror-substitutes][=mirror-substitutes=]]@0.0.3|Mirror Guix substitutes|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/package-management.scm#L39][package-management.scm]]|
|
||||
|[[https://www.navidrome.org/][=navidrome-bin=]]@0.64.2|Web-based music collection server and streamer|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L238][binaries.scm]]|
|
||||
|[[https://noctalia.dev/][=noctalia-greeter=]]@1.7.0|Login greeter for greetd|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/wm.scm#L40][wm.scm]]|
|
||||
|[[https://github.com/27justin/ohmyech][=ohmyech-icecat=]]@1.5|Visual indicator for Encrpted Client Hello|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/browser-extensions.scm#L147][browser-extensions.scm]]|
|
||||
|[[https://github.com/ifreund/dumb_runtime_dir][=pam-dumb-runtime-dir=]]@1.0.4|Create `XDG_RUNTIME_DIR' on login and never remove it|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/admin.scm#L74][admin.scm]]|
|
||||
|[[https://prismlauncher.org/][=prismlauncher-dolly=]]@11.1.1|Free, open source launcher for Minecraft|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/games.scm#L45][games.scm]]|
|
||||
|[[https://prometheus.io/][=prometheus-bin=]]@3.15.1|Monitoring system and time series database|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L453][binaries.scm]]|
|
||||
|[[https://pypi.org/project/coherent.licensed/][=python-coherent-licensed=]]@0.5.2|License management tooling|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L31][python-xyz.scm]]|
|
||||
|[[https://github.com/cher-nov/cryptg][=python-cryptg=]]@0.5.2|Cryptographic utilities for Telegram|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L53][python-xyz.scm]]|
|
||||
|[[https://github.com/jaraco/irc][=python-irc=]]@20.3.1|Python Internet Relay Chat protocol library|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L109][python-xyz.scm]]|
|
||||
|[[https://github.com/jaraco/jaraco.logging][=python-jaraco-logging=]]@3.4.0|Python logging facility|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L144][python-xyz.scm]]|
|
||||
|[[https://github.com/jaraco/jaraco.stream][=python-jaraco-stream=]]@3.0.4|Routines for dealing with data streams|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L170][python-xyz.scm]]|
|
||||
|[[https://github.com/mautrix/python][=python-mautrix=]]@0.20.8|Python 3 asyncio Matrix framework|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L195][python-xyz.scm]]|
|
||||
|[[https://github.com/tulir/Telethon][=python-tulir-telethon=]]@1.99.0a6|Python 3 MTProto API Telegram client library|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/python-xyz.scm#L228][python-xyz.scm]]|
|
||||
|[[https://sr.ht/~kennylevinsen/seatd][=seatd-sans-logind=]]@0.9.3|Seat management daemon|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/admin.scm#L111][admin.scm]]|
|
||||
|[[https://www.ihcblog.com/a-better-tls-obfs-proxy/][=shadow-tls-bin=]]@0.2.25|Proxy to expose real tls handshake to the firewall|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L288][binaries.scm]]|
|
||||
|[[https://sing-box.sagernet.org/][=sing-box=]]@1.14.3|Universal proxy platform|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L118][networking.scm]]|
|
||||
|[[https://github.com/zenhack/socks2http][=socks2http=]]@0.0.0-20160712034938-bafa2cde8eb4|SOCKS5 to HTTP proxy|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L190][networking.scm]]|
|
||||
|[[https://tangled.org/oppi.li/stinkpot][=stinkpot=]]@0.1.0|Search shell history|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/shellutils.scm#L18][shellutils.scm]]|
|
||||
|[[https://systemd.io/][=systemd-stub=]]@262.1|Unified kernel image UEFI stub|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/bootloaders.scm#L103][bootloaders.scm]]|
|
||||
|[[https://tailscale.com/][=tailscale=]]@1.104.2|Mesh VPN service utilizing the WireGuard protocol and 2FA|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/networking.scm#L217][networking.scm]]|
|
||||
|[[https://matrix-construct.github.io/tuwunel/][=tuwunel-bin=]]@1.9.4|Matrix homeserver|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L131][binaries.scm]]|
|
||||
|[[https://systemd.io][=ukify=]]@262.1|Unified kernel image UEFI tool|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/bootloaders.scm#L146][bootloaders.scm]]|
|
||||
|[[https://wakapi.dev/][=wakapi-bin=]]@2.18.2|WakaTime-compatible backend|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L318][binaries.scm]]|
|
||||
|[[https://wakatime.com/plugins][=wakatime-cli-bin=]]@2.27.13|Command line interface to WakaTime|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/packages/binaries.scm#L366][binaries.scm]]|
|
||||
*** Services
|
||||
| SERVICE | DESCRIPTION | LOCATION |
|
||||
|-+-+-|
|
||||
|=alloy=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L82][monitoring.scm]]|
|
||||
|=btrbk=|Configure and run btrbk hourly.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/file-systems.scm#L53][file-systems.scm]]|
|
||||
|=caddy=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L160][web.scm]]|
|
||||
|=clash=|Run Clash.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L121][child-error.scm]]|
|
||||
|=cloudflare-tunnel=|Run cloudflared, the Cloudflare Tunnel daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L219][child-error.scm]]|
|
||||
|=cloudflare-warp=|Run warp-svc, the Cloudflare Warp daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L255][child-error.scm]]|
|
||||
|=cuirass=|Run the Cuirass continuous integration service.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/cuirass.scm#L68][cuirass.scm]]|
|
||||
|=cuirass-worker-container=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/cuirass.scm#L208][cuirass.scm]]|
|
||||
|=docker-mailserver=|Run Docker Mailserver.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/mail.scm#L77][mail.scm]]|
|
||||
|=dumb-runtime-dir=|Create `XDG_RUNTIME_DIR' on login and never remove it.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/file-systems.scm#L94][file-systems.scm]]|
|
||||
|=forgejo=|Run Forgejo.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L302][web.scm]]|
|
||||
|=gamemode=|Set up Guix System environment for gamemode.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/games.scm#L51][games.scm]]|
|
||||
|=grafana=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L180][monitoring.scm]]|
|
||||
|=heisenbridge=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/messaging.scm#L95][messaging.scm]]|
|
||||
|=iocaine=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L408][web.scm]]|
|
||||
|=jellyfin=|Run the Jellyfin media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L544][web.scm]]|
|
||||
|=jellyfin-oci=|Run Jellyfin, a media system.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L634][web.scm]]|
|
||||
|=komga=|Run Komga.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L706][web.scm]]|
|
||||
|=loki=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L269][monitoring.scm]]|
|
||||
|=mautrix-telegram=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/messaging.scm#L181][messaging.scm]]|
|
||||
|=mimir=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L356][monitoring.scm]]|
|
||||
|=misskey=|Run Misskey, an interplanetary microblogging platform.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L798][web.scm]]|
|
||||
|=navidrome=|Run Navidrome.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L888][web.scm]]|
|
||||
|=network-online=|Wait for the network to come up.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L72][networking.scm]]|
|
||||
|=nix-search-paths=|Set up search paths for `with-nix-profile'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/nix.scm#L59][nix.scm]]|
|
||||
|=noctalia-greeter=|Set up environment for `noctalia-greeter-session'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/base.scm#L76][base.scm]]|
|
||||
|=prometheus=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/monitoring.scm#L447][monitoring.scm]]|
|
||||
|=qbittorrent=|Run qBittorrent daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/bittorrent.scm#L120][bittorrent.scm]]|
|
||||
|=shadow-tls=|Run shadow-tls.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L451][child-error.scm]]|
|
||||
|=sing-box=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L176][networking.scm]]|
|
||||
|=smartdns=|Run Smartdns daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/dns.scm#L44][dns.scm]]|
|
||||
|=tailscaled=|Run tailscaled.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L249][networking.scm]]|
|
||||
|=tuwunel=|Run Tuwunel.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L975][web.scm]]|
|
||||
|=vaultwarden=|Run Vaultwarden, a Bitwarden compatible server.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/web.scm#L1114][web.scm]]|
|
||||
|=zfs=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/file-systems.scm#L187][file-systems.scm]]|
|
||||
|=home-atuin=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L68][shellutils.scm]]|
|
||||
|=home-bb-auth=|Run `bb-auth' daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L423][desktop.scm]]|
|
||||
|=home-blueman-applet=|Run blueman applet, a tray applet for managing bluetooth.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L122][desktop.scm]]|
|
||||
|=home-direnv=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L105][shellutils.scm]]|
|
||||
|=home-emacs=|Install Emacs into home profile and run its daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/emacs.scm#L142][emacs.scm]]|
|
||||
|=home-fcitx5=|Run fcitx5, an input method framework.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L246][desktop.scm]]|
|
||||
|=home-goimapnotify=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/mail.scm#L129][mail.scm]]|
|
||||
|=home-graphical-session=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/desktop.scm#L165][desktop.scm]]|
|
||||
|=home-gtk2=|Set up GTK2 settings in `~/.config/gtk-2.0/gtkrc'|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/gtk.scm#L53][gtk.scm]]|
|
||||
|=home-gtk3=|Set up GTK3 settings in `~/.config/gtk-3.0/settings.ini'|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/gtk.scm#L74][gtk.scm]]|
|
||||
|=home-gtk4=|Set up GTK4 settings in `~/.config/gtk-4.0/settings.ini'|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/gtk.scm#L84][gtk.scm]]|
|
||||
|=home-keyboard=|Set layouts by configuring XKB_* environment variables. Service accepts an instance of `keyboard-layout' from `(gnu system keyboard)'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/keyboard.scm#L21][keyboard.scm]]|
|
||||
|=home-mako=|Run mako, a notification daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L302][desktop.scm]]|
|
||||
|=home-network-manager-applet=|Run nm-applet, a tray applet for managing networks.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L341][desktop.scm]]|
|
||||
|=home-network-online=|Wait for the network to come up.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/networking.scm#L81][networking.scm]]|
|
||||
|=home-niri=|Set up configuration file for niri, a scrollable-tiling Wayland compositor.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L381][desktop.scm]]|
|
||||
|=home-nix-search-paths=|Set up search paths for `with-nix-profile'.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/nix.scm#L74][nix.scm]]|
|
||||
|=home-noctalia=|Run Noctalia, a lightweight Wayland shell and bar.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/desktop.scm#L219][desktop.scm]]|
|
||||
|=home-polkit-gnome=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L450][desktop.scm]]|
|
||||
|=home-qbittorrent=|Run qBittorrent daemon.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/bittorrent.scm#L158][bittorrent.scm]]|
|
||||
|=home-rofi=|Set up configuration file for rofi, an application launcher.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L476][desktop.scm]]|
|
||||
|=home-shadow-tls=|Run shadow-tls.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L460][child-error.scm]]|
|
||||
|=home-socks2http=|Run socks2http.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L495][child-error.scm]]|
|
||||
|=home-stinkpot=|Set up `stinkpot' for Fish shell.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L143][shellutils.scm]]|
|
||||
|=home-swaybg=|Run swaybg, a screen wallpaper utility for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L516][desktop.scm]]|
|
||||
|=home-theme=|Set up desktop themes.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L615][desktop.scm]]|
|
||||
|=home-wakapi=|Run Wakapi, a self-hosted WakaTime-compatible backend.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/child-error.scm#L298][child-error.scm]]|
|
||||
|=home-waybar=|Run waybar, a status bar for Wayland compositors.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/desktop.scm#L680][desktop.scm]]|
|
||||
|=home-writable-files-manager=|Provide an `update-writable-files' script, which copies files to configuration files, makes them writable and creates symlinks to directories on every activation. If an existing file would be overwritten, backs up that file first.|[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/home/services/writable-files-manager.scm#L264][writable-files-manager.scm]]|
|
||||
|=home-zoxide=| |[[https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/rosenthal/services/shellutils.scm#L177][shellutils.scm]]|
|
||||
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: scheme; -*-
|
||||
exec guix repl -- "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; GNU Guix --- Functional package management for GNU
|
||||
;;; Copyright © 2025-2026 Hilton Chain <hako@ultrarare.space>
|
||||
;;;
|
||||
;;; This file is part of GNU Guix.
|
||||
;;;
|
||||
;;; GNU Guix is free software; you can redistribute it and/or modify it
|
||||
;;; under the terms of the GNU General Public License as published by
|
||||
;;; the Free Software Foundation; either version 3 of the License, or (at
|
||||
;;; your option) any later version.
|
||||
;;;
|
||||
;;; GNU Guix is distributed in the hope that it will be useful, but
|
||||
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;;; GNU General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU General Public License
|
||||
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
;;;
|
||||
;;; Usage: cleanup-crates.scm [FILE] ...
|
||||
;;;
|
||||
|
||||
(use-modules (ice-9 match)
|
||||
(ice-9 regex)
|
||||
(srfi srfi-26)
|
||||
(system base compile)
|
||||
(guix ui)
|
||||
(guix utils)
|
||||
(guix scripts shell))
|
||||
|
||||
(define (cleanup-crates file)
|
||||
(define %unused
|
||||
(let ((warnings (open-output-string)))
|
||||
(parameterize ((current-warning-port warnings))
|
||||
(compile-file file
|
||||
#:optimization-level 0
|
||||
#:warning-level 0
|
||||
#:opts '(#:warnings (unused-toplevel))))
|
||||
(map (cut match:substring <> 1)
|
||||
(list-matches "`(rust-[^']*)'" (get-output-string warnings)))))
|
||||
|
||||
(info (G_ "removing ~a unused definitions~%") (length %unused))
|
||||
(for-each (lambda (name)
|
||||
(info (G_ "removing '~a'...~%") name)
|
||||
(and=> (find-definition-location file (string->symbol name) #:define-prefix 'define)
|
||||
delete-expression))
|
||||
%unused)
|
||||
|
||||
(info (G_ "collapsing newlines~%"))
|
||||
(guix-shell "sed" "--" "sed" "--in-place" ":a;N;$!ba;s/\\n\\n\\+/\\n\\n/g" file))
|
||||
|
||||
(match (program-arguments)
|
||||
((_ files ..1)
|
||||
(for-each cleanup-crates files))
|
||||
(_
|
||||
(cleanup-crates "modules/rosenthal/packages/rust-crates.scm")))
|
||||
@@ -1,11 +1,12 @@
|
||||
#!/usr/bin/env -S guix repl
|
||||
#!/bin/sh
|
||||
# -*- mode: scheme; -*-
|
||||
exec guix repl -- "$0" "$@"
|
||||
!#
|
||||
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2020, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net>
|
||||
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
|
||||
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
|
||||
;;; Copyright © 2022 Maxim Cournoyer <maxim@guixotic.coop>
|
||||
;;; Copyright © 2022, 2026 Maxim Cournoyer <maxim@guixotic.coop>
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
@@ -25,7 +26,9 @@
|
||||
(ice-9 rdelim)
|
||||
(ice-9 regex)
|
||||
(ice-9 textual-ports)
|
||||
(guix gexp))
|
||||
(guix gexp)
|
||||
(guix modules)
|
||||
(guix packages))
|
||||
|
||||
(define* (break-string str #:optional (max-line-length 70))
|
||||
"Break the string STR into lines that are no longer than MAX-LINE-LENGTH.
|
||||
@@ -380,6 +383,30 @@ modifying."
|
||||
(cons* new (old-sexp (first hunks)) hunks)))
|
||||
(group-hunks-by-sexp hunks)))
|
||||
|
||||
(define (new+old+hunks->package new+old+hunks)
|
||||
"Return the package object whose source is referenced in a new+old+hunks
|
||||
tuple, which describes modifications to the package in a tuple containing the
|
||||
new sexp, the old sexp as well as a tail of <hunk> objects."
|
||||
(match new+old+hunks
|
||||
((new-sexp old-sexp . hunks)
|
||||
(let* ((hunk-file-name (hunk-file-name (first hunks)))
|
||||
(variable-name (second new-sexp))
|
||||
(module-name
|
||||
(match (file-name->module-name hunk-file-name)
|
||||
(('modules 'rosenthal symbols ...)
|
||||
(cons 'rosenthal symbols))
|
||||
(x x))))
|
||||
(module-ref (resolve-module module-name) variable-name)))))
|
||||
|
||||
(define (sort-new+old+hunks-by-closure new+old+hunks)
|
||||
"Sort new+old+hunks by their package closure size."
|
||||
(sort new+old+hunks
|
||||
(match-lambda*
|
||||
(((= new+old+hunks->package x-package)
|
||||
(= new+old+hunks->package y-package))
|
||||
(< (length (package-closure (list x-package)))
|
||||
(length (package-closure (list y-package))))))))
|
||||
|
||||
(define %delay 1000)
|
||||
|
||||
(define (main . args)
|
||||
@@ -441,7 +468,7 @@ modifying."
|
||||
hunks)
|
||||
(define copyright-line
|
||||
(any (lambda (line) (and=> (string-prefix? "+;;; Copyright ©" line)
|
||||
(const line)))
|
||||
(const line)))
|
||||
(hunk-diff-lines (first hunks))))
|
||||
(cond
|
||||
(copyright-line
|
||||
@@ -456,13 +483,14 @@ modifying."
|
||||
(usleep %delay)
|
||||
(unless (eqv? 0 (status:exit-val (close-pipe port)))
|
||||
(error "Cannot commit")))))))
|
||||
(new+old+hunks (match definitions
|
||||
('() changes) ;reuse
|
||||
(_
|
||||
;; XXX: we recompute the hunks here because previous
|
||||
;; insertions lead to offsets.
|
||||
(let-values (((definitions changes)
|
||||
(partition hunk-type (diff-info))))
|
||||
changes)))))))))
|
||||
(sort-new+old+hunks-by-closure
|
||||
(new+old+hunks (match definitions
|
||||
('() changes) ;reuse
|
||||
(_
|
||||
;; XXX: we recompute the hunks here because previous
|
||||
;; insertions lead to offsets.
|
||||
(let-values (((definitions changes)
|
||||
(partition hunk-type (diff-info))))
|
||||
changes))))))))))
|
||||
|
||||
(apply main (cdr (command-line)))
|
||||
Executable
+101
@@ -0,0 +1,101 @@
|
||||
#!/bin/sh
|
||||
# -*- mode: scheme; -*-
|
||||
exec guix repl -- "$0" "$@"
|
||||
!#
|
||||
;;; SPDX-License-Identifier: CC0-1.0
|
||||
;;; Copyright © 2025-2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(use-modules (ice-9 match)
|
||||
(ice-9 string-fun)
|
||||
(srfi srfi-1)
|
||||
(srfi srfi-71)
|
||||
(guix diagnostics)
|
||||
(guix discovery)
|
||||
(guix packages)
|
||||
(guix profiles)
|
||||
(guix ui)
|
||||
(rosenthal utils packages)
|
||||
(rosenthal utils services)
|
||||
(gnu services))
|
||||
|
||||
(define (location->org-url loc)
|
||||
(match loc
|
||||
(#f "<unknown location>")
|
||||
(($ <location> file line column)
|
||||
(format #f "[[~a][~a]]"
|
||||
(format #f "https://codeberg.org/hako/Rosenthal/src/branch/trunk/modules/~a#L~a"
|
||||
file
|
||||
line)
|
||||
(basename file)))))
|
||||
|
||||
(define (replace-newlines str)
|
||||
(define str*
|
||||
(string-replace-substring
|
||||
(string-trim-right str #\newline)
|
||||
"\n"
|
||||
" "))
|
||||
(if (string-null? str*)
|
||||
" "
|
||||
str*))
|
||||
|
||||
(format #t "\
|
||||
*** Packages
|
||||
| PACKAGE | SYNOPSIS | LOCATION |
|
||||
|-+-+-|
|
||||
")
|
||||
|
||||
(define (sort-packages packages)
|
||||
(stable-sort
|
||||
packages
|
||||
(lambda (a b)
|
||||
(string< (package-name a)
|
||||
(package-name b)))))
|
||||
|
||||
(for-each
|
||||
(lambda (p)
|
||||
(format #t "|[[~a][=~a=]]@~a|~a|~a|~%"
|
||||
(package-home-page p)
|
||||
(package-name p)
|
||||
(package-version p)
|
||||
(replace-newlines (package-synopsis-string p))
|
||||
(and=> (package-location p) location->org-url)))
|
||||
(sort-packages
|
||||
(filter (negate hidden-package?)
|
||||
(all-rosenthal-packages))))
|
||||
|
||||
|
||||
(format #t "\
|
||||
*** Services
|
||||
| SERVICE | DESCRIPTION | LOCATION |
|
||||
|-+-+-|
|
||||
")
|
||||
|
||||
;; Copied from (guix scripts system search).
|
||||
(define service-type-name*
|
||||
(compose symbol->string service-type-name))
|
||||
(define (service-type-description-string type)
|
||||
"Return the rendered and localised description of TYPE, a service type."
|
||||
(and=> (service-type-description type)
|
||||
texi->plain-text))
|
||||
|
||||
(define (sort-services services)
|
||||
(stable-sort
|
||||
services
|
||||
(lambda (a b)
|
||||
(string< (service-type-name* a)
|
||||
(service-type-name* b)))))
|
||||
|
||||
(for-each
|
||||
(lambda (s)
|
||||
(format #t "|=~a=|~a|~a|~%"
|
||||
(service-type-name* s)
|
||||
(replace-newlines (service-type-description-string s))
|
||||
(and=> (service-type-location s) location->org-url)))
|
||||
(let ((home-services
|
||||
services
|
||||
(partition (lambda (s)
|
||||
(string-prefix? "home-" (service-type-name* s)))
|
||||
(all-rosenthal-services))))
|
||||
(append
|
||||
(sort-services services)
|
||||
(sort-services home-services))))
|
||||
@@ -36,10 +36,10 @@
|
||||
old-entries))
|
||||
|
||||
(define labels
|
||||
(map-in-order menu-entry-label menu-entries))
|
||||
(map menu-entry-label menu-entries))
|
||||
|
||||
(define ukify-args
|
||||
(map-in-order menu-entry->ukify-args menu-entries))
|
||||
(map menu-entry->ukify-args menu-entries))
|
||||
|
||||
(program-file "install-limine"
|
||||
(with-imported-modules
|
||||
|
||||
@@ -26,7 +26,25 @@
|
||||
#~(list "--os-release" #$label
|
||||
"--linux" #$linux
|
||||
"--initrd" #$initrd
|
||||
"--cmdline" (string-join (list #$@arguments))
|
||||
"--cmdline"
|
||||
(string-join
|
||||
(map (lambda (arg)
|
||||
;; Use absolute references to avoid stale system generation
|
||||
;; status.
|
||||
(if (or (string-prefix? "gnu.system=" arg)
|
||||
(string-prefix? "gnu.load=" arg))
|
||||
(let* ((split-arg (string-split arg #\=))
|
||||
(option (car split-arg))
|
||||
(value (cadr split-arg)))
|
||||
(string-join
|
||||
(list option
|
||||
(catch #t
|
||||
(lambda ()
|
||||
(readlink value))
|
||||
(const value)))
|
||||
"="))
|
||||
arg))
|
||||
(list #$@arguments)))
|
||||
"--stub"
|
||||
#$(file-append systemd-stub "/libexec/" (systemd-stub-name)))))
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal build-system go-vendored)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (rosenthal utils download)
|
||||
#:use-module (guix build-system)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system go)
|
||||
#:export (%default-go-vendored-imported-modules
|
||||
%default-go-vendored-modules
|
||||
go-vendored-build-system))
|
||||
|
||||
(define %default-go-vendored-imported-modules
|
||||
;; Build-side modules imported and used by default.
|
||||
`(,@%default-gnu-imported-modules
|
||||
(guix build union)
|
||||
(guix build go-build-system)
|
||||
(rosenthal build go-vendored-build-system)))
|
||||
|
||||
(define %default-go-vendored-modules
|
||||
'((guix build union)
|
||||
(guix build utils)
|
||||
(rosenthal build go-vendored-build-system)))
|
||||
|
||||
(define* (lower name #:key source go vendor-hash #:allow-other-keys #:rest rest)
|
||||
(define private-keywords
|
||||
'(#:vendor-hash))
|
||||
|
||||
(define go-lower
|
||||
(build-system-lower go-build-system))
|
||||
|
||||
(define go-bag
|
||||
(apply go-lower name
|
||||
#:source source
|
||||
#:go go
|
||||
rest))
|
||||
|
||||
(bag
|
||||
(inherit go-bag)
|
||||
(build-inputs
|
||||
`(,@(if (and source vendor-hash)
|
||||
`(("vendored-go-dependencies"
|
||||
,(origin
|
||||
(method (go-mod-vendor #:go go))
|
||||
(uri source)
|
||||
(file-name (string-append name "-vendored-go-dependencies"))
|
||||
(hash
|
||||
(if (content-hash? vendor-hash)
|
||||
vendor-hash
|
||||
(content-hash vendor-hash))))))
|
||||
'())
|
||||
,@(bag-build-inputs go-bag)))
|
||||
(build (bag-build go-bag))
|
||||
(arguments
|
||||
(substitute-keyword-arguments
|
||||
(strip-keyword-arguments private-keywords (bag-arguments go-bag))
|
||||
((#:imported-modules imported-modules '())
|
||||
(if (null? imported-modules)
|
||||
%default-go-vendored-imported-modules
|
||||
imported-modules))
|
||||
((#:modules modules '())
|
||||
(if (null? modules)
|
||||
%default-go-vendored-modules
|
||||
modules))))))
|
||||
|
||||
(define go-vendored-build-system
|
||||
(build-system
|
||||
(name 'go-vendored)
|
||||
(description
|
||||
"Build system for Go programs, with vendored dependencies")
|
||||
(lower lower)))
|
||||
@@ -0,0 +1,29 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal build go-vendored-build-system)
|
||||
#:use-module (guix build utils)
|
||||
#:use-module ((guix build gnu-build-system) #:prefix gnu:)
|
||||
#:use-module ((guix build go-build-system) #:prefix go:)
|
||||
#:export (%standard-phases
|
||||
go-build))
|
||||
|
||||
(define* (unpack-vendored-dependencies #:key native-inputs inputs #:allow-other-keys)
|
||||
(let ((vendored-dependencies
|
||||
(assoc-ref (or native-inputs inputs) "vendored-go-dependencies")))
|
||||
(setenv "GOTOOLCHAIN" "local")
|
||||
(unsetenv "GO111MODULE")
|
||||
(when vendored-dependencies
|
||||
(copy-recursively vendored-dependencies "vendor"))))
|
||||
|
||||
(define %standard-phases
|
||||
(modify-phases go:%standard-phases
|
||||
(add-after 'unpack 'unpack-vendored-dependencies unpack-vendored-dependencies)
|
||||
(replace 'unpack
|
||||
(assoc-ref gnu:%standard-phases 'unpack))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))))
|
||||
|
||||
(define* (go-build #:key inputs (phases %standard-phases)
|
||||
#:allow-other-keys #:rest args)
|
||||
(apply gnu:gnu-build #:inputs inputs #:phases phases args))
|
||||
@@ -1,66 +0,0 @@
|
||||
{
|
||||
"appLauncher": {
|
||||
"terminalCommand": "wezterm start --"
|
||||
},
|
||||
"colorSchemes": {
|
||||
"darkMode": false,
|
||||
"predefinedScheme": "Nord"
|
||||
},
|
||||
"dock": {
|
||||
"displayMode": "exclusive",
|
||||
"enabled": true,
|
||||
"position": "left",
|
||||
"size": 2
|
||||
},
|
||||
"osd": {
|
||||
"enabled": true,
|
||||
"enabledTypes": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3
|
||||
]
|
||||
},
|
||||
"sessionMenu": {
|
||||
"countdownDuration": 10000,
|
||||
"enableCountdown": true,
|
||||
"largeButtonsLayout": "single-row",
|
||||
"largeButtonsStyle": true,
|
||||
"position": "center",
|
||||
"powerOptions": [
|
||||
{
|
||||
"action": "lock",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"action": "suspend",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"action": "hibernate",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"action": "reboot",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"action": "logout",
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"action": "shutdown",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"action": "rebootToUefi",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"showHeader": true,
|
||||
"showNumberLabels": true
|
||||
},
|
||||
"wallpaper": {
|
||||
"enabled": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
[bar.default]
|
||||
capsule = true
|
||||
concave_edge_corners = false
|
||||
margin_ends = 0
|
||||
radius = 0
|
||||
|
||||
[dock]
|
||||
concave_edge_corners = false
|
||||
enabled = true
|
||||
launcher_position = "start"
|
||||
position = "left"
|
||||
show_dots = true
|
||||
|
||||
[shell]
|
||||
polkit_agent = true
|
||||
|
||||
[[shell.session.actions]]
|
||||
action = "reboot"
|
||||
variant = "default"
|
||||
|
||||
[[shell.session.actions]]
|
||||
action = "shutdown"
|
||||
variant = "destructive"
|
||||
|
||||
[theme]
|
||||
builtin = "Nord"
|
||||
mode = "light"
|
||||
|
||||
[wallpaper]
|
||||
enabled = false
|
||||
@@ -1,90 +0,0 @@
|
||||
;;; -*- lexical-binding: t -*-
|
||||
|
||||
(use-package emacs
|
||||
:custom
|
||||
;; Disable tab indentation.
|
||||
(indent-tabs-mode nil)
|
||||
;; CJK support.
|
||||
(word-wrap-by-category t)
|
||||
:config
|
||||
;; Avoid re-indenting current line after entering `RET'.
|
||||
(setopt electric-indent-inhibit t)
|
||||
:hook
|
||||
(before-save . delete-trailing-whitespace)
|
||||
;; Automatic parenthesis pairing.
|
||||
(after-init . electric-pair-mode))
|
||||
|
||||
;; Check syntax on the fly.
|
||||
(use-package flycheck
|
||||
:hook
|
||||
(after-init . global-flycheck-mode))
|
||||
|
||||
(use-package flycheck-guile
|
||||
:after (flycheck geiser-guile))
|
||||
|
||||
(use-package geiser
|
||||
:custom
|
||||
(geiser-autodoc-identifier-format "%s → %s")
|
||||
(geiser-mode-smart-tab-p t)
|
||||
(geiser-mode-start-repl-p t)
|
||||
(geiser-repl-query-on-kill-p nil)
|
||||
:init
|
||||
;; Context menu on right click.
|
||||
;; Taken from guile-studio: https://elephly.net/guile-studio/
|
||||
(defun context-menu ()
|
||||
(let ((menu (make-sparse-keymap)))
|
||||
(pcase major-mode
|
||||
('scheme-mode
|
||||
(define-key menu (vector 'switch-to-repl)
|
||||
'("Switch to REPL" . geiser-repl-switch))
|
||||
(define-key menu (vector 'eval-buffer)
|
||||
'("Evaluate buffer" . geiser-eval-buffer))
|
||||
(define-key menu (vector 'lookup-documentation)
|
||||
'("Show documentation". geiser-doc-symbol-at-point))
|
||||
menu)
|
||||
(_
|
||||
(mouse-menu-major-mode-map)))))
|
||||
:bind
|
||||
([mouse-3] . (lambda (event)
|
||||
(interactive "e")
|
||||
(mouse-set-point event)
|
||||
(popup-menu (context-menu)))))
|
||||
|
||||
(use-package geiser-guile
|
||||
:after (geiser)
|
||||
:custom
|
||||
(geiser-active-implementation '(guile))
|
||||
(geiser-default-implementation 'guile)
|
||||
:config
|
||||
;; TODO: Make `flycheck-guile' support `guix repl'.
|
||||
(dolist (path
|
||||
(mapcar
|
||||
#'expand-file-name
|
||||
'("~/.config/guix/current/lib/guile/3.0/site-ccache"
|
||||
"~/.config/guix/current/share/guile/site/3.0"
|
||||
"~/.guix-profile/lib/guile/3.0/site-ccache"
|
||||
"~/.guix-profile/share/guile/site/3.0"
|
||||
"~/.guix-home/profile/lib/guile/3.0/site-ccache"
|
||||
"~/.guix-home/profile/share/guile/site/3.0"
|
||||
"/run/current-system/profile/lib/guile/3.0/site-ccache"
|
||||
"/run/current-system/profile/share/guile/site/3.0")))
|
||||
(add-to-list 'geiser-guile-load-path path t)))
|
||||
|
||||
(use-package macrostep
|
||||
:bind
|
||||
("C-c e" . macrostep-expand))
|
||||
|
||||
(use-package macrostep-geiser
|
||||
:after (geiser-mode)
|
||||
:hook
|
||||
(geiser-mode . macrostep-geiser-setup))
|
||||
|
||||
(use-package macrostep-geiser
|
||||
:after (geiser-repl)
|
||||
:hook
|
||||
(geiser-repl-mode . macrostep-geiser-setup))
|
||||
|
||||
(use-package puni
|
||||
:hook
|
||||
((eval-expression-minibuffer-setup nxml-mode prog-mode sgml-mode tex-mode)
|
||||
. puni-mode))
|
||||
@@ -1,65 +0,0 @@
|
||||
;;; -*- lexical-binding: t -*-
|
||||
|
||||
;; https://github.com/nykma/nema/blob/develop/my-sample/font.el
|
||||
|
||||
(defvar nema--font-size 12 "Font size")
|
||||
(defvar nema-fonts '((sans . "sans")
|
||||
(serif . "serif")
|
||||
(mono . "Victor Mono")
|
||||
(cjk . "Sarasa Mono CL")
|
||||
(symbol . "Noto Color Emoji")
|
||||
(modeline . "Source Serif 4"))
|
||||
"Fonts to use.")
|
||||
|
||||
(defun nema//get-font-family (key)
|
||||
(alist-get key nema-fonts))
|
||||
|
||||
(defun nema//generate-font-spec (key)
|
||||
(format "%s-%d"
|
||||
(nema//get-font-family key)
|
||||
nema--font-size))
|
||||
|
||||
(defun nema//load-base-font ()
|
||||
"Load the default font for ascii characters."
|
||||
(let* ((font-spec (nema//generate-font-spec 'mono)))
|
||||
(set-frame-parameter nil 'font font-spec)
|
||||
(add-to-list 'default-frame-alist (cons 'font font-spec))))
|
||||
|
||||
(defun nema//load-face-font ()
|
||||
"Load fonts used in faces.
|
||||
|
||||
This function must be called after frame creation."
|
||||
(let ((mono (nema//generate-font-spec 'mono))
|
||||
(sans (nema//generate-font-spec 'sans))
|
||||
(serif (nema//generate-font-spec 'sans-serif))
|
||||
(modeline (nema//generate-font-spec 'modeline)))
|
||||
(set-face-attribute 'variable-pitch nil :font sans)
|
||||
(set-face-attribute 'variable-pitch-text nil :font serif)
|
||||
(set-face-attribute 'fixed-pitch nil :font mono)
|
||||
(set-face-attribute 'fixed-pitch-serif nil :font mono)
|
||||
(set-face-attribute 'mode-line nil :font modeline)
|
||||
(set-face-attribute 'mode-line-inactive nil :font modeline)))
|
||||
|
||||
(defun nema//load-ext-font ()
|
||||
"Load fonts used for non-ascii characters.
|
||||
|
||||
This function must be called after frame creation."
|
||||
(let ((font (frame-parameter nil 'font))
|
||||
(font-spec-cjk (font-spec :family (nema//get-font-family 'cjk)))
|
||||
(font-spec-symbol (font-spec :family (nema//get-font-family 'symbol))))
|
||||
(dolist (charset '(kana han hangul cjk-misc bopomofo))
|
||||
(set-fontset-font font charset font-spec-cjk))
|
||||
(set-fontset-font font 'symbol font-spec-symbol)))
|
||||
|
||||
(defun nema/load-font ()
|
||||
"Load all font configuration."
|
||||
(interactive)
|
||||
(when (display-graphic-p)
|
||||
(nema//load-base-font)
|
||||
(nema//load-ext-font)
|
||||
(nema//load-face-font)))
|
||||
|
||||
(if (daemonp)
|
||||
(add-hook 'server-after-make-frame-hook #'nema/load-font)
|
||||
;; Else: not in daemon
|
||||
(add-hook 'after-init-hook #'nema/load-font))
|
||||
@@ -1,116 +0,0 @@
|
||||
;;; -*- lexical-binding: t -*-
|
||||
|
||||
(use-package emacs
|
||||
:custom
|
||||
(blink-cursor-mode nil)
|
||||
(enable-recursive-minibuffers t)
|
||||
(inhibit-splash-screen t)
|
||||
(uniquify-buffer-name-style 'forward)
|
||||
;; Exclude unavailable completions.
|
||||
(read-extended-command-predicate 'command-completion-default-include-p)
|
||||
;; Case-insensitive completion.
|
||||
(completion-ignore-case t)
|
||||
(read-buffer-completion-ignore-case t)
|
||||
(read-file-name-completion-ignore-case t)
|
||||
:bind
|
||||
([remap list-buffers] . switch-to-buffer)
|
||||
:hook
|
||||
(prog-mode . display-line-numbers-mode)
|
||||
;; Scrolling enhancement.
|
||||
(after-init . pixel-scroll-precision-mode)
|
||||
;; Recursive minibuffers indicatior.
|
||||
(after-init . minibuffer-depth-indicate-mode)
|
||||
;; Save minibuffer history.
|
||||
(after-init . savehist-mode)
|
||||
;; `fill-column' indicator.
|
||||
(prog-mode . display-fill-column-indicator-mode))
|
||||
|
||||
;; Theming
|
||||
(use-package emacs
|
||||
:custom
|
||||
(fringe-mode 0)
|
||||
(modus-themes-italic-constructs t)
|
||||
:config
|
||||
(load-theme 'modus-operandi-tinted :no-confirm))
|
||||
|
||||
(use-package corfu
|
||||
:custom
|
||||
;; Auto-completion.
|
||||
(corfu-auto t)
|
||||
(corfu-auto-delay 0.3)
|
||||
:hook
|
||||
(after-init . global-corfu-mode)
|
||||
:bind
|
||||
;; Free the `RET' key for less intrusive behavior.
|
||||
(:map corfu-map
|
||||
("RET" . nil)))
|
||||
|
||||
(use-package doom-modeline
|
||||
:custom
|
||||
(doom-modeline-icon nil)
|
||||
(doom-modeline-height 18)
|
||||
:hook
|
||||
(after-init . doom-modeline-mode))
|
||||
|
||||
(use-package helpful
|
||||
:bind
|
||||
([remap describe-function] . helpful-callable)
|
||||
([remap describe-variable] . helpful-variable)
|
||||
([remap describe-key] . helpful-key)
|
||||
([remap describe-command] . helpful-command)
|
||||
([remap describe-symbol] . helpful-symbol)
|
||||
("C-c C-d" . helpful-at-point))
|
||||
|
||||
(use-package hl-todo
|
||||
:custom
|
||||
(hl-todo-highlight-punctuation ":")
|
||||
:hook
|
||||
(prog-mode . hl-todo-mode))
|
||||
|
||||
(use-package isearch
|
||||
:custom
|
||||
(isearch-lazy-count t)
|
||||
(isearch-wrap-pause 'no-ding)
|
||||
(regexp-search-ring-max 200)
|
||||
(search-ring-max 200))
|
||||
|
||||
(use-package mwim
|
||||
:bind
|
||||
([remap move-beginning-of-line] . mwim-beginning)
|
||||
([remap move-end-of-line] . mwim-end))
|
||||
|
||||
(use-package orderless
|
||||
:custom
|
||||
(completion-styles '(orderless basic))
|
||||
(completion-category-overrides '((file (styles basic partial-completion))))
|
||||
(orderless-matching-styles '(orderless-literal orderless-flex orderless-regexp)))
|
||||
|
||||
(use-package paren
|
||||
:custom
|
||||
(show-paren-context-when-offscreen 'overlay)
|
||||
:hook
|
||||
(after-init . show-paren-mode))
|
||||
|
||||
(use-package rainbow-delimiters
|
||||
:hook
|
||||
(prog-mode . rainbow-delimiters-mode))
|
||||
|
||||
(use-package vertico
|
||||
:hook
|
||||
(after-init . vertico-mode))
|
||||
|
||||
(use-package vertico-directory
|
||||
:after (vertico)
|
||||
:bind
|
||||
(:map vertico-map
|
||||
("RET" . vertico-directory-enter)
|
||||
("DEL" . vertico-directory-delete-char)
|
||||
("M-DEL" . vertico-directory-delete-word))
|
||||
:hook
|
||||
(rfn-eshadow-update-overlay . vertico-directory-tidy))
|
||||
|
||||
(use-package which-key
|
||||
:config
|
||||
(which-key-setup-side-window-right-bottom)
|
||||
:hook
|
||||
(after-init . which-key-mode))
|
||||
@@ -1,32 +0,0 @@
|
||||
;;; -*- lexical-binding: t -*-
|
||||
|
||||
(use-package dired
|
||||
:custom
|
||||
(dired-listing-switches
|
||||
"-lv --all --group-directories-first --human-readable")
|
||||
:bind
|
||||
([remap list-directory] . dired))
|
||||
|
||||
(use-package dired-aux
|
||||
:custom
|
||||
(dired-create-destination-dirs 'ask)
|
||||
(dired-create-destination-dirs-on-trailing-dirsep t)
|
||||
(dired-vc-rename-file t))
|
||||
|
||||
(use-package envrc
|
||||
:hook
|
||||
(after-init . envrc-global-mode))
|
||||
|
||||
(use-package magit
|
||||
:custom
|
||||
(git-commit-cd-to-toplevel t))
|
||||
|
||||
(use-package project
|
||||
:config
|
||||
(add-to-list 'project-switch-commands '(magit-project-status "Magit") t)
|
||||
:bind
|
||||
(:map project-prefix-map
|
||||
("m" . magit-project-status)))
|
||||
|
||||
(use-package forge
|
||||
:after (magit))
|
||||
@@ -5,41 +5,367 @@
|
||||
(make-empty-file custom-file)
|
||||
(load custom-file))
|
||||
|
||||
;; Tweak garbage collection strategy.
|
||||
(use-package gcmh
|
||||
:config
|
||||
(gcmh-mode 1))
|
||||
|
||||
;; Set default storage locations for various packages.
|
||||
;; Keep ~/.config/emacs clean by setting default storage locations for various
|
||||
;; packages. Set this up first.
|
||||
(use-package no-littering
|
||||
:config
|
||||
(no-littering-theme-backups))
|
||||
|
||||
(use-package emacs
|
||||
:custom
|
||||
;; Workaround to use fish as login shell.
|
||||
(shell-file-name "/bin/sh"))
|
||||
|
||||
(load-file (locate-user-emacs-file "init-fonts.el"))
|
||||
(load-file (locate-user-emacs-file "init-interface.el"))
|
||||
(load-file (locate-user-emacs-file "init-editing.el"))
|
||||
(load-file (locate-user-emacs-file "init-miscellaneous.el"))
|
||||
(fill-column 80)
|
||||
(shell-file-name "/bin/sh") ;use POSIX-compatible shell
|
||||
(word-wrap-by-category t) ;improve CJK word-wrapping
|
||||
(pixel-scroll-precision-interpolate-page t)
|
||||
(show-paren-context-when-offscreen 'overlay)
|
||||
:config
|
||||
(setopt electric-indent-inhibit t) ;disable automatic re-indentation
|
||||
:hook
|
||||
(after-init . show-paren-mode)
|
||||
(before-save . delete-trailing-whitespace)
|
||||
(prog-mode . display-fill-column-indicator-mode))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Set up initial screen.
|
||||
;;; Guile & Guix hacking.
|
||||
;;;
|
||||
|
||||
(use-package flycheck
|
||||
:hook
|
||||
(after-init . global-flycheck-mode))
|
||||
|
||||
(use-package flycheck-guile
|
||||
:after flycheck geiser-guile)
|
||||
|
||||
(use-package geiser
|
||||
:custom
|
||||
(geiser-active-implementation '(guile))
|
||||
(geiser-default-implementation 'guile)
|
||||
(geiser-autodoc-identifier-format "%s → %s")
|
||||
(geiser-mode-smart-tab-p t)
|
||||
(geiser-mode-start-repl-p t)
|
||||
(geiser-repl-query-on-kill-p nil))
|
||||
|
||||
(use-package geiser-guile
|
||||
:after geiser
|
||||
:config
|
||||
(setopt geiser-guile-load-path
|
||||
(let* ((cmd "echo '(write %load-path)' | guix repl -q --type=machine")
|
||||
(out (nth 1 (split-string (shell-command-to-string cmd) "\n"))))
|
||||
(read out))))
|
||||
|
||||
(use-package guix
|
||||
:hook
|
||||
(scheme-mode . guix-devel-mode))
|
||||
|
||||
(use-package info-look
|
||||
:config
|
||||
(info-lookup-add-help
|
||||
:mode 'scheme-mode
|
||||
:regexp "[^()`',\" \n]+"
|
||||
:ignore-case nil
|
||||
:doc-spec
|
||||
(mapcar (lambda (node-name)
|
||||
(list node-name nil "^[ ]+-+ [^:]+:[ ]*" "\\b"))
|
||||
'("(guile)R5RS Index"
|
||||
"(guix)Programming Index"
|
||||
"(guile)Procedure Index"
|
||||
"(guile)Variable Index"
|
||||
"(r5rs)Index"
|
||||
"(guile)Concept Index"
|
||||
"(guix)Concept Index"))))
|
||||
|
||||
(use-package macrostep
|
||||
:bind
|
||||
((:map emacs-lisp-mode-map)
|
||||
("C-c e" . macrostep-expand)))
|
||||
|
||||
(use-package macrostep-geiser
|
||||
:after geiser
|
||||
:hook
|
||||
((geiser-mode geiser-repl-mode) . macrostep-geiser-setup)
|
||||
:bind
|
||||
((:map geiser-mode-map)
|
||||
("C-c e" . macrostep-expand))
|
||||
((:map geiser-repl-mode-map)
|
||||
("C-c e" . macrostep-expand)))
|
||||
|
||||
(use-package parinfer-rust-mode
|
||||
:config
|
||||
;; Disable parenthesis pairing in `electric-pair-mode' when
|
||||
;; `parinfer-rust-mode' is active.
|
||||
(setopt electric-pair-inhibit-predicate
|
||||
(lambda (char)
|
||||
(or (and (bound-and-true-p parinfer-rust-mode)
|
||||
(memql char '(?\( ?\[ ?\{)))
|
||||
(electric-pair-default-inhibit char))))
|
||||
(setopt parinfer-rust-troublesome-modes
|
||||
(delq 'electric-pair-mode parinfer-rust-troublesome-modes))
|
||||
;; These customizations are managed by Guix but will be overridden if using
|
||||
;; `no-littering'. Reset them to standard values.
|
||||
(custom-reevaluate-setting 'parinfer-rust-library-directory)
|
||||
(custom-reevaluate-setting 'parinfer-rust-library)
|
||||
:hook
|
||||
;; XXX: Enable mode first, workaround to support `menu-find-file-existing'.
|
||||
((emacs-lisp-mode lisp-mode scheme-mode) . parinfer-rust-mode-enable)
|
||||
((emacs-lisp-mode lisp-mode scheme-mode) . parinfer-rust-mode))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Completion.
|
||||
;;;
|
||||
|
||||
(use-package corfu
|
||||
:custom
|
||||
(corfu-auto t) ;auto-complete
|
||||
(corfu-auto-delay 0.3)
|
||||
:hook
|
||||
(after-init . global-corfu-mode))
|
||||
|
||||
(use-package orderless
|
||||
:custom
|
||||
(completion-styles '(orderless basic))
|
||||
(completion-category-overrides '((file (styles basic partial-completion))))
|
||||
(orderless-matching-styles '(orderless-literal orderless-flex orderless-regexp)))
|
||||
|
||||
(use-package vertico
|
||||
:custom
|
||||
;; Case-insensitive completion.
|
||||
(completion-ignore-case t)
|
||||
(read-buffer-completion-ignore-case t)
|
||||
(read-file-name-completion-ignore-case t)
|
||||
:hook
|
||||
(after-init . vertico-mode))
|
||||
|
||||
(use-package vertico-directory
|
||||
:after vertico
|
||||
:hook
|
||||
;; Tidy shadowed file names.
|
||||
(rfn-eshadow-update-overlay . vertico-directory-tidy)
|
||||
:bind
|
||||
((:map vertico-map)
|
||||
("RET" . vertico-directory-enter)
|
||||
("DEL" . vertico-directory-delete-char)
|
||||
("M-DEL" . vertico-directory-delete-word)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Vim-like editing experience.
|
||||
;;;
|
||||
|
||||
(use-package evil
|
||||
:custom
|
||||
(evil-undo-system 'undo-redo)
|
||||
(evil-want-integration t)
|
||||
(evil-want-keybinding nil))
|
||||
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:config
|
||||
(evil-collection-init))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Enhancements to the default interface.
|
||||
;;;
|
||||
|
||||
(use-package eldoc-box
|
||||
:hook
|
||||
(eldoc-mode . eldoc-box-hover-mode))
|
||||
|
||||
;; ElDoc integration for flycheck:
|
||||
;; https://www.masteringemacs.org/article/seamlessly-merge-multiple-documentation-sources-eldoc
|
||||
(use-package flycheck
|
||||
:init
|
||||
(defun mp/flycheck-eldoc (callback &rest _ignored)
|
||||
"Print flycheck messages at point by calling CALLBACK."
|
||||
(when-let ((flycheck-errors (and flycheck-mode (flycheck-overlay-errors-at (point)))))
|
||||
(mapc (lambda (err)
|
||||
(funcall callback
|
||||
(format "%s: %s"
|
||||
(let ((level (flycheck-error-level err)))
|
||||
(pcase level
|
||||
('info (propertize "I" 'face 'flycheck-error-list-info))
|
||||
('error (propertize "E" 'face 'flycheck-error-list-error))
|
||||
('warning (propertize "W" 'face 'flycheck-error-list-warning))
|
||||
(_ level)))
|
||||
(flycheck-error-message err))
|
||||
:thing (or (flycheck-error-id err)
|
||||
(flycheck-error-group err))
|
||||
:face 'font-lock-doc-face))
|
||||
flycheck-errors)))
|
||||
(defun mp/flycheck-prefer-eldoc ()
|
||||
(add-hook 'eldoc-documentation-functions #'mp/flycheck-eldoc nil t)
|
||||
(setq eldoc-documentation-strategy 'eldoc-documentation-compose-eagerly)
|
||||
(setq flycheck-display-errors-function nil)
|
||||
(setq flycheck-help-echo-function nil))
|
||||
:hook
|
||||
(flycheck-mode . mp/flycheck-prefer-eldoc))
|
||||
|
||||
(use-package helpful
|
||||
:bind
|
||||
([remap describe-function] . helpful-callable)
|
||||
([remap describe-variable] . helpful-variable)
|
||||
([remap describe-key] . helpful-key)
|
||||
([remap describe-command] . helpful-command)
|
||||
([remap describe-symbol] . helpful-symbol)
|
||||
("C-c C-d" . helpful-at-point))
|
||||
|
||||
(use-package isearch
|
||||
:custom
|
||||
(isearch-lazy-count t)
|
||||
(isearch-wrap-pause 'no-ding))
|
||||
|
||||
(use-package mwim
|
||||
:bind
|
||||
([remap move-beginning-of-line] . mwim-beginning)
|
||||
([remap move-end-of-line] . mwim-end))
|
||||
|
||||
(use-package which-key
|
||||
:config
|
||||
(which-key-setup-side-window-right-bottom))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Theming.
|
||||
;;;
|
||||
|
||||
(use-package emacs
|
||||
:config
|
||||
(load-theme 'modus-operandi-tinted :no-confirm))
|
||||
|
||||
(use-package doom-modeline
|
||||
:custom
|
||||
(doom-modeline-icon nil)
|
||||
(doom-modeline-height 18)
|
||||
:hook
|
||||
(after-init . doom-modeline-mode))
|
||||
|
||||
|
||||
;;;
|
||||
;;; User options for newcomers.
|
||||
;;; https://cgit.git.savannah.gnu.org/cgit/emacs.git/tree/etc/themes/newcomers-presets-theme.el
|
||||
;;; https://github.com/emacs-mirror/emacs/blob/master/etc/themes/newcomers-presets-theme.el
|
||||
;;;
|
||||
|
||||
(use-package emacs
|
||||
:custom
|
||||
;; Appearance-related options
|
||||
(font-use-system-font t)
|
||||
(frame-resize-pixelwise t)
|
||||
(window-resize-pixelwise t)
|
||||
(mode-line-compact 'long)
|
||||
;; Mouse-related options
|
||||
(context-menu-mode t)
|
||||
(save-interprogram-paste-before-kill t)
|
||||
(mouse-yank-at-point t)
|
||||
(pixel-scroll-mode t)
|
||||
(pixel-scroll-precision-mode t) ;; see bug#69972
|
||||
(mouse-drag-and-drop-region t)
|
||||
(mouse-drag-and-drop-region-cross-program t)
|
||||
(mouse-drag-mode-line-buffer t)
|
||||
(global-xref-mouse-mode t)
|
||||
;; Persistence-related options
|
||||
(savehist-mode t)
|
||||
(save-place-mode t)
|
||||
(recentf-mode t)
|
||||
;; Editing-related options
|
||||
(electric-pair-mode t)
|
||||
(repeat-mode t)
|
||||
(delete-selection-mode t)
|
||||
(editorconfig-mode t)
|
||||
(indent-tabs-mode nil)
|
||||
(imenu-auto-rescan t)
|
||||
(view-read-only t)
|
||||
(column-number-mode t)
|
||||
;; Directory managment-related options
|
||||
(dired-auto-revert-buffer t)
|
||||
(dired-mouse-drag-files t)
|
||||
(shell-command-prompt-show-cwd t)
|
||||
;; File-related options
|
||||
;; (etags-regen-mode t)
|
||||
(vc-auto-revert-mode t)
|
||||
(vc-deduce-backend-nonvc-modes t)
|
||||
(vc-dir-save-some-buffers-on-revert t)
|
||||
(vc-find-revision-no-save t)
|
||||
(vc-follow-symlinks t)
|
||||
(vc-use-incoming-outgoing-prefixes t)
|
||||
;; Completion-related options
|
||||
(minibuffer-visible-completions t)
|
||||
(completions-detailed t)
|
||||
(completions-group t)
|
||||
(completion-auto-select 'second-tab)
|
||||
(completion-eager-update t)
|
||||
;; (completion-styles '(basic emacs22 flex))
|
||||
;; (global-completion-preview-mode t)
|
||||
(tab-always-indent 'complete)
|
||||
(which-key-mode t)
|
||||
;; Package-related options
|
||||
(package-autosuggest-mode t)
|
||||
(package-menu-use-current-if-no-marks nil)
|
||||
;; Frame- and window-related options
|
||||
(frame-inhibit-implied-resize t)
|
||||
(tab-bar-history-mode t)
|
||||
(tab-bar-show t)
|
||||
;; Programming-related options
|
||||
(compilation-scroll-output 'first-error)
|
||||
:hook
|
||||
(prog-mode . display-line-numbers-mode)
|
||||
;; (prog-mode . flymake-mode)
|
||||
;; (prog-mode . flyspell-prog-mode)
|
||||
(text-mode . display-line-numbers-mode))
|
||||
;; (text-mode . flyspell-mode))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Font configuration with proper CJK support. Based on
|
||||
;;; https://github.com/nykma/nema/blob/develop/my-sample/font.el
|
||||
;;;
|
||||
|
||||
(use-package emacs
|
||||
:config
|
||||
(defun hako/load-font ()
|
||||
(let* ((size 16)
|
||||
(mono (font-spec :family "Victor Mono" :size size))
|
||||
(modeline (font-spec :family "Source Serif 4" :size size))
|
||||
(cjk (font-spec :family "Sarasa Mono CL" :size size))
|
||||
(symbol (font-spec :family "Noto Color Emoji" :size size))
|
||||
(emoji (font-spec :family "Noto Color Emoji" :size size)))
|
||||
(when (display-graphic-p)
|
||||
(set-face-attribute 'default nil :font mono)
|
||||
(set-face-attribute 'mode-line nil :font modeline)
|
||||
(set-face-attribute 'mode-line-active nil :font modeline)
|
||||
(set-face-attribute 'mode-line-inactive nil :font modeline)
|
||||
(let ((font (frame-parameter nil 'font)))
|
||||
(dolist (charset '(kana han hangul cjk-misc bopomofo))
|
||||
(set-fontset-font font charset cjk))
|
||||
(set-fontset-font font 'symbol symbol nil 'append)
|
||||
(set-fontset-font font 'emoji emoji nil 'append)))))
|
||||
|
||||
(if (daemonp)
|
||||
(add-hook 'server-after-make-frame-hook #'hako/load-font)
|
||||
(add-hook 'after-init-hook #'hako/load-font)))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Set up a ready-to-use geiser REPL.
|
||||
;;;
|
||||
|
||||
(progn
|
||||
(setopt initial-scratch-message
|
||||
"\
|
||||
;;; Type your Guile program here and evaluate it.
|
||||
;;; `M-x cua-mode' to use Ctrl-C/X/Z for copy, cut, paste.
|
||||
;;; `M-x evil-mode' for Vim-like experience.
|
||||
\n")
|
||||
(scheme-mode)
|
||||
(geiser-repl-import-module "(gnu)")
|
||||
(geiser-repl-import-module "(nonguix)")
|
||||
(geiser-repl-import-module "(rosenthal)")
|
||||
(delete-window)
|
||||
(display-splash-screen))
|
||||
(dolist (module
|
||||
'("(guix)"
|
||||
"(gnu)"
|
||||
"(gnu services cups)"
|
||||
"(gnu services desktop)"
|
||||
"(gnu services guix)"
|
||||
"(gnu services networking)"
|
||||
"(gnu services shepherd)"
|
||||
"(gnu services ssh)"
|
||||
"(gnu services xorg)"
|
||||
"(gnu home)"
|
||||
"(gnu home services)"
|
||||
"(gnu home services desktop)"
|
||||
"(gnu home services shepherd)"))
|
||||
(geiser-repl-import-module module))
|
||||
(delete-window))
|
||||
@@ -1,8 +1,13 @@
|
||||
#!/bin/sh
|
||||
dir="$(dirname "$(realpath "$0")")"
|
||||
if [[ ! -f ~/.config/emacs/init.el ]]
|
||||
set -e
|
||||
|
||||
TOP_DIR="$(dirname "$(realpath "$0")")"
|
||||
|
||||
# Install packages.
|
||||
guix repl -- "$TOP_DIR/packages"
|
||||
|
||||
# Install configuration file.
|
||||
if [ ! -f ~/.config/emacs/init.el ]
|
||||
then
|
||||
mkdir -p ~/.config/emacs
|
||||
cp "$dir/init"* ~/.config/emacs
|
||||
install -D -mode=0644 --target-directory="$HOME/.config/emacs" "$TOP_DIR/init.el"
|
||||
fi
|
||||
cat "$dir/packages.txt" | xargs guix package --install
|
||||
@@ -1,36 +0,0 @@
|
||||
;; What follows is a "manifest" equivalent to the command line you gave.
|
||||
;; You can store it in a file that you may then pass to any 'guix' command
|
||||
;; that accepts a '--manifest' (or '-m') option.
|
||||
|
||||
(specifications->manifest
|
||||
(list "emacs-pgtk"
|
||||
"emacs-corfu"
|
||||
"emacs-doom-modeline"
|
||||
"emacs-edit-indirect"
|
||||
"emacs-envrc"
|
||||
"emacs-evil"
|
||||
"emacs-fish-mode"
|
||||
"emacs-flycheck"
|
||||
"emacs-flycheck-guile"
|
||||
"emacs-forge"
|
||||
"emacs-gcmh"
|
||||
"emacs-geiser"
|
||||
"emacs-geiser-guile"
|
||||
"emacs-helpful"
|
||||
"emacs-hl-todo"
|
||||
"emacs-json-mode"
|
||||
"emacs-macrostep"
|
||||
"emacs-macrostep-geiser"
|
||||
"emacs-magit"
|
||||
"emacs-markdown-mode"
|
||||
"emacs-mwim"
|
||||
"emacs-no-littering"
|
||||
"emacs-orderless"
|
||||
"emacs-puni"
|
||||
"emacs-rainbow-delimiters"
|
||||
"emacs-vertico"
|
||||
"fontconfig"
|
||||
"font-adobe-source-serif"
|
||||
"font-google-noto-emoji"
|
||||
"font-sarasa-gothic"
|
||||
"font-victor-mono"))
|
||||
@@ -0,0 +1,53 @@
|
||||
(use-modules (ice-9 match)
|
||||
(guix packages)
|
||||
(guix scripts install)
|
||||
(gnu packages))
|
||||
|
||||
(define emacs-packages
|
||||
(map specification->package
|
||||
(list "bash" ;Required when using in `guix shell --container'.
|
||||
(if (getenv "WAYLAND_DISPLAY")
|
||||
"emacs-pgtk"
|
||||
"emacs")
|
||||
"emacs-no-littering"
|
||||
;; Guile & Guix hacking.
|
||||
"emacs-flycheck"
|
||||
"emacs-flycheck-guile"
|
||||
"emacs-geiser"
|
||||
"emacs-geiser-guile"
|
||||
"emacs-guix"
|
||||
"emacs-macrostep"
|
||||
"emacs-macrostep-geiser"
|
||||
"emacs-parinfer-rust-mode"
|
||||
;; Completion.
|
||||
"emacs-corfu"
|
||||
"emacs-orderless"
|
||||
"emacs-vertico"
|
||||
;; Vim-like editing experience.
|
||||
"emacs-evil"
|
||||
"emacs-evil-collection"
|
||||
"emacs-goto-chg" ;dependency of emacs-evil
|
||||
;; Enhancements to the default interface.
|
||||
"emacs-eldoc-box"
|
||||
"emacs-helpful"
|
||||
"emacs-mwim"
|
||||
;; Theming.
|
||||
"emacs-doom-modeline"
|
||||
;; Fonts.
|
||||
"font-adobe-source-serif"
|
||||
"font-google-noto-emoji"
|
||||
"font-sarasa-gothic"
|
||||
"font-victor-mono"
|
||||
"fontconfig"
|
||||
;; Other useful packages.
|
||||
"emacs-magit")))
|
||||
|
||||
(match (command-line)
|
||||
;; guix repl -- <this-file>
|
||||
((_this-file)
|
||||
(apply guix-install
|
||||
(map package-name
|
||||
emacs-packages)))
|
||||
;; guix shell -f <this-file>, or other use cases.
|
||||
(_
|
||||
emacs-packages))
|
||||
@@ -1,31 +0,0 @@
|
||||
emacs-pgtk
|
||||
emacs-corfu
|
||||
emacs-doom-modeline
|
||||
emacs-edit-indirect
|
||||
emacs-envrc
|
||||
emacs-evil
|
||||
emacs-fish-mode
|
||||
emacs-flycheck
|
||||
emacs-flycheck-guile
|
||||
emacs-forge
|
||||
emacs-gcmh
|
||||
emacs-geiser
|
||||
emacs-geiser-guile
|
||||
emacs-helpful
|
||||
emacs-hl-todo
|
||||
emacs-json-mode
|
||||
emacs-macrostep
|
||||
emacs-macrostep-geiser
|
||||
emacs-magit
|
||||
emacs-markdown-mode
|
||||
emacs-mwim
|
||||
emacs-no-littering
|
||||
emacs-orderless
|
||||
emacs-puni
|
||||
emacs-rainbow-delimiters
|
||||
emacs-vertico
|
||||
fontconfig
|
||||
font-adobe-source-serif
|
||||
font-google-noto-emoji
|
||||
font-sarasa-gothic
|
||||
font-victor-mono
|
||||
@@ -55,31 +55,34 @@
|
||||
"emacs-pgtk"
|
||||
"neovim"
|
||||
|
||||
"emacs-no-littering"
|
||||
;; Enhancements to the default interface.
|
||||
"emacs-helpful"
|
||||
"emacs-mwim"
|
||||
;; Completion.
|
||||
"emacs-corfu"
|
||||
"emacs-doom-modeline"
|
||||
"emacs-edit-indirect" ;for emacs-markdown-mode
|
||||
"emacs-envrc"
|
||||
"emacs-evil"
|
||||
"emacs-fish-mode"
|
||||
"emacs-orderless"
|
||||
"emacs-vertico"
|
||||
;; Guile hacking.
|
||||
"emacs-flycheck"
|
||||
"emacs-flycheck-guile"
|
||||
"emacs-forge"
|
||||
"emacs-gcmh"
|
||||
"emacs-geiser"
|
||||
"emacs-geiser-guile"
|
||||
"emacs-helpful"
|
||||
"emacs-hl-todo"
|
||||
"emacs-json-mode"
|
||||
"emacs-macrostep"
|
||||
"emacs-macrostep-geiser"
|
||||
"emacs-parinfer-rust-mode"
|
||||
;; Theming.
|
||||
"emacs-doom-modeline"
|
||||
;; Fonts.
|
||||
"font-adobe-source-serif"
|
||||
"font-google-noto-emoji"
|
||||
"font-sarasa-gothic"
|
||||
"font-victor-mono"
|
||||
"fontconfig"
|
||||
;; Other useful packages.
|
||||
"emacs-edit-indirect"
|
||||
"emacs-evil"
|
||||
"emacs-guix"
|
||||
"emacs-magit"
|
||||
"emacs-markdown-mode"
|
||||
"emacs-mwim"
|
||||
"emacs-no-littering"
|
||||
"emacs-orderless"
|
||||
"emacs-puni"
|
||||
"emacs-rainbow-delimiters"
|
||||
"emacs-vertico"
|
||||
|
||||
;; Fonts.
|
||||
"font-adobe-source-serif"
|
||||
@@ -169,7 +172,6 @@
|
||||
"git"
|
||||
"gnupg"
|
||||
"mosh"
|
||||
"ncurses"
|
||||
"rsync"
|
||||
"unzip"
|
||||
;; Provide Wayland session for the login manager.
|
||||
|
||||
@@ -13,9 +13,20 @@
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services configuration)
|
||||
;; Guix Home - services
|
||||
#:use-module (gnu home services)
|
||||
#:use-module (gnu home services shepherd)
|
||||
;; Guix packages
|
||||
#:autoload (gnu packages window-management) (noctalia-shell)
|
||||
#:export (home-graphical-session-service-type
|
||||
home-graphical-session-configuration))
|
||||
home-graphical-session-configuration
|
||||
|
||||
home-noctalia-configuration
|
||||
home-noctalia-service-type))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Graphical session.
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-graphical-session-configuration
|
||||
(timeout
|
||||
@@ -42,8 +53,9 @@
|
||||
(let ((name (in-vicinity directory name)))
|
||||
(and (string-match pattern name)
|
||||
(access? name O_RDWR)))))
|
||||
(or (reverse (scandir directory))
|
||||
'())))
|
||||
(reverse
|
||||
(or (scandir directory)
|
||||
'()))))
|
||||
|
||||
(if socket
|
||||
(let ((display
|
||||
@@ -175,3 +187,44 @@
|
||||
#f))))))
|
||||
(default-value (home-graphical-session-configuration))
|
||||
(description "")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Noctalia
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-noctalia-configuration
|
||||
(noctalia
|
||||
(file-like noctalia-shell)
|
||||
"File-like object to provide @command{/bin/noctalia}."))
|
||||
|
||||
(define home-noctalia-shepherd-service
|
||||
(match-record-lambda <home-noctalia-configuration>
|
||||
(noctalia)
|
||||
(list (shepherd-service
|
||||
(documentation "Start noctalia.")
|
||||
(provision '(noctalia))
|
||||
(requirement '(dbus graphical-session))
|
||||
(modules '((shepherd support)))
|
||||
(start
|
||||
#~(lambda args
|
||||
((make-forkexec-constructor
|
||||
(list #$(file-append noctalia "/bin/noctalia"))
|
||||
#:log-file (in-vicinity %user-log-dir "noctalia.log")
|
||||
;; Inherit graphical session environment.
|
||||
#:environment-variables (environ))
|
||||
args)))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define home-noctalia-service-type
|
||||
(service-type
|
||||
(name 'home-noctalia)
|
||||
(extensions
|
||||
(list (service-extension home-profile-service-type
|
||||
(compose list home-noctalia-configuration-noctalia))
|
||||
(service-extension home-shepherd-service-type
|
||||
home-noctalia-shepherd-service)
|
||||
(service-extension home-graphical-session-service-type
|
||||
(const 'wayland))))
|
||||
(default-value (home-noctalia-configuration))
|
||||
(description "Run Noctalia, a lightweight Wayland shell and bar.")))
|
||||
@@ -10,7 +10,7 @@
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix profiles)
|
||||
#:use-module (guix records)
|
||||
#:use-module (guix search-paths)
|
||||
#:autoload (guix self) (make-config.scm)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services configuration)
|
||||
@@ -45,41 +45,21 @@ of Emacs extensions.")
|
||||
(content (manifest
|
||||
(cons (package->manifest-entry emacs)
|
||||
(manifest-entries packages))))))
|
||||
(home-emacs-search-paths
|
||||
(map search-path-specification->sexp
|
||||
(manifest-search-paths
|
||||
(profile-content home-emacs-profile))))
|
||||
(home-emacs-program
|
||||
(program-file "home-emacs-program"
|
||||
(with-imported-modules
|
||||
(source-module-closure
|
||||
'((guix search-paths)
|
||||
(guix build utils)))
|
||||
(cons `((guix config) => ,(make-config.scm))
|
||||
(delete '(guix config)
|
||||
(source-module-closure '((guix profiles)))))
|
||||
#~(begin
|
||||
(use-modules (ice-9 match)
|
||||
(guix search-paths)
|
||||
(guix build utils))
|
||||
(let ((profile #$home-emacs-profile))
|
||||
;; See also (@ (guix profiles) load-profile).
|
||||
(for-each
|
||||
(match-lambda
|
||||
((($ <search-path-specification> variable _ separator) . value)
|
||||
(let ((current (getenv variable)))
|
||||
(setenv variable
|
||||
(if current
|
||||
(if separator
|
||||
(string-append value separator current)
|
||||
value)
|
||||
value)))))
|
||||
(evaluate-search-paths
|
||||
(map sexp->search-path-specification
|
||||
'#$home-emacs-search-paths)
|
||||
(list profile)))
|
||||
(match (command-line)
|
||||
((cmd . args)
|
||||
(apply system*
|
||||
(string-append profile "/bin/" (basename cmd))
|
||||
args)))))))))
|
||||
(guix profiles))
|
||||
(load-profile #$home-emacs-profile)
|
||||
(match (command-line)
|
||||
((cmd . args)
|
||||
(apply system*
|
||||
(string-append #$home-emacs-profile "/bin/" (basename cmd))
|
||||
args))))))))
|
||||
(package
|
||||
(inherit emacs)
|
||||
(name "emacs-wrapper")
|
||||
|
||||
@@ -39,13 +39,15 @@
|
||||
(if (null? config)
|
||||
'()
|
||||
`(("gtk-3.0/settings.ini"
|
||||
,(ini-file "settings.ini" #~'(("Settings" #$@config)))))))
|
||||
,(ini-file "settings.ini"
|
||||
#~'(("Settings" . #$config)))))))
|
||||
|
||||
(define (home-gtk4-xdg-configuration-files config)
|
||||
(if (null? config)
|
||||
'()
|
||||
`(("gtk-4.0/settings.ini"
|
||||
,(ini-file "settings.ini" #~'(("Settings" #$@config)))))))
|
||||
,(ini-file "settings.ini"
|
||||
#~'(("Settings" . #$config)))))))
|
||||
|
||||
(define home-gtk2-service-type
|
||||
(service-type
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2021 Andrew Tropin <andrew@trop.in>
|
||||
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
|
||||
;;; Copyright © 2022 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2024 Nicolas Graves <ngraves@ngraves.fr>
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal home services writable-files-manager)
|
||||
#:use-module (gnu home services)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:autoload (gnu packages gnupg) (guile-gcrypt)
|
||||
#:export (home-writable-files-manager-service-type))
|
||||
|
||||
;;; Based on (gnu home services symlink-manager).
|
||||
;;; This service is a replacement to home-symlink-manager-service-type.
|
||||
;;;
|
||||
;;; Usage:
|
||||
;;;--8<---------------cut here---------------start------------->8---
|
||||
;;; (home-environment
|
||||
;;; (essential-services
|
||||
;;; (cons* (service home-writable-files-manager-service-type)
|
||||
;;; (modify-services ((@@ (gnu home) home-environment-default-essential-services)
|
||||
;;; this-home-environment)
|
||||
;;; (delete home-symlink-manager-service-type)))
|
||||
;;; ...))
|
||||
;;;--8<---------------cut here---------------end--------------->8---
|
||||
;;;
|
||||
;;; Files managed by Guix Home are copied as regular file and made writable.
|
||||
;;; Directories are still symlinked.
|
||||
|
||||
(define (update-writable-files-script)
|
||||
(program-file
|
||||
"update-writable-files"
|
||||
(with-extensions (list guile-gcrypt)
|
||||
(with-imported-modules (source-module-closure
|
||||
'((guix build utils)
|
||||
(guix hash)
|
||||
(guix i18n)))
|
||||
#~(begin
|
||||
(use-modules (ice-9 ftw)
|
||||
(ice-9 match)
|
||||
(srfi srfi-1)
|
||||
(guix hash)
|
||||
(guix i18n)
|
||||
(guix build utils))
|
||||
|
||||
(define home-directory
|
||||
(getenv "HOME"))
|
||||
|
||||
(define xdg-config-home
|
||||
(or (getenv "XDG_CONFIG_HOME")
|
||||
(string-append (getenv "HOME") "/.config")))
|
||||
|
||||
(define xdg-data-home
|
||||
(or (getenv "XDG_DATA_HOME")
|
||||
(string-append (getenv "HOME") "/.local/share")))
|
||||
|
||||
(define backup-directory
|
||||
(string-append home-directory "/" (number->string (current-time))
|
||||
"-guix-home-legacy-configs-backup"))
|
||||
|
||||
(define (preprocess-file file)
|
||||
"If file is in XDG-CONFIGURATION-FILES-DIRECTORY use
|
||||
subdirectory from XDG_CONFIG_HOME to generate a target path."
|
||||
(cond
|
||||
((string-prefix? #$xdg-configuration-files-directory file)
|
||||
(string-append
|
||||
(substring xdg-config-home
|
||||
(1+ (string-length home-directory)))
|
||||
(substring file
|
||||
(string-length #$xdg-configuration-files-directory))))
|
||||
((string-prefix? #$xdg-data-files-directory file)
|
||||
(string-append
|
||||
(substring xdg-data-home
|
||||
(1+ (string-length home-directory)))
|
||||
(substring file
|
||||
(string-length #$xdg-data-files-directory))))
|
||||
(else file)))
|
||||
|
||||
(define (target-file file)
|
||||
;; Return the target of FILE, a config file name sans leading dot
|
||||
;; such as "config/fontconfig/fonts.conf" or "bashrc".
|
||||
(string-append home-directory "/" (preprocess-file file)))
|
||||
|
||||
(define (no-follow-file-exists? file)
|
||||
"Return #t if file exists, even if it's a dangling symlink."
|
||||
(->bool (false-if-exception (lstat file))))
|
||||
|
||||
(define (symlink-to-store? file)
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(store-file-name? (readlink file)))
|
||||
(lambda args
|
||||
(if (= EINVAL (system-error-errno args))
|
||||
#f
|
||||
(apply throw args)))))
|
||||
|
||||
(define (backup-file file)
|
||||
(define backup
|
||||
(string-append backup-directory "/" (preprocess-file file)))
|
||||
|
||||
(define (copy-file* oldfile newfile)
|
||||
"Like 'copy-file', but also copies dangling symlinks."
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(copy-file oldfile newfile))
|
||||
(lambda args
|
||||
(if (and (eq? 'symlink (stat:type (lstat oldfile)))
|
||||
(= ENOENT (system-error-errno args)))
|
||||
(symlink (readlink oldfile) newfile)
|
||||
(apply throw args)))))
|
||||
|
||||
(mkdir-p backup-directory)
|
||||
(format #t (G_ "Backing up ~a...") (target-file file))
|
||||
(mkdir-p (dirname backup))
|
||||
(copy-file* (target-file file) backup)
|
||||
(delete-file (target-file file))
|
||||
(display (G_ " done\n")))
|
||||
|
||||
(define (cleanup-writable-files home-generation)
|
||||
;; Delete from $HOME files that originate in HOME-GENERATION, the
|
||||
;; store item containing a home generation.
|
||||
(define config-file-directory
|
||||
;; Note: Trailing slash is needed because "files" is a symlink.
|
||||
(string-append home-generation "/" #$home-files-directory "/"))
|
||||
|
||||
(define (strip file)
|
||||
(string-drop file
|
||||
(+ 1 (string-length config-file-directory))))
|
||||
|
||||
(define (source-file file)
|
||||
(readlink (string-append config-file-directory file)))
|
||||
|
||||
(format #t (G_ "Cleaning up writable files from previous home at ~a.~%")
|
||||
home-generation)
|
||||
(newline)
|
||||
|
||||
(file-system-fold
|
||||
(const #t)
|
||||
(lambda (file stat _) ;leaf
|
||||
(let ((source (source-file (strip file)))
|
||||
(target (target-file (strip file))))
|
||||
(when (no-follow-file-exists? target)
|
||||
;; DO NOT remove the file if it is different from the one
|
||||
;; we'll create later, it will be backed up later during
|
||||
;; create-writable-files phase.
|
||||
(if (or (symlink-to-store? target)
|
||||
(equal?
|
||||
(file-hash* (if (symbolic-link? target) file source))
|
||||
(file-hash* target)))
|
||||
(begin
|
||||
(format #t (G_ "Removing ~a...") target)
|
||||
(delete-file target)
|
||||
(display (G_ " done\n")))
|
||||
(format
|
||||
#t
|
||||
(G_ "Skipping ~a (file changed)... done\n")
|
||||
target)))))
|
||||
|
||||
(const #t) ;down
|
||||
(lambda (directory stat _) ;up
|
||||
(unless (string=? directory config-file-directory)
|
||||
(let ((directory (target-file (strip directory))))
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(rmdir directory)
|
||||
(format #t (G_ "Removed ~a.\n") directory))
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(cond
|
||||
((= ENOTEMPTY errno)
|
||||
(format
|
||||
#t
|
||||
(G_ "Skipping ~a (not an empty directory)... done\n")
|
||||
directory))
|
||||
;; This happens when the directory is a mounted device.
|
||||
((= EBUSY errno)
|
||||
(format
|
||||
#t
|
||||
(G_ "Skipping ~a (underlying device is busy)... done\n")
|
||||
directory))
|
||||
((= ENOENT errno) #t)
|
||||
((= ENOTDIR errno) #t)
|
||||
(else
|
||||
(apply throw args)))))))))
|
||||
(const #t) ;skip
|
||||
(const #t) ;error
|
||||
#t ;init
|
||||
config-file-directory
|
||||
lstat)
|
||||
|
||||
(display (G_ "Cleanup finished.\n\n")))
|
||||
|
||||
(define (create-writable-files home-generation)
|
||||
;; Create in $HOME writable files for the files in HOME-GENERATION.
|
||||
(define config-file-directory
|
||||
;; Note: Trailing slash is needed because "files" is a symlink.
|
||||
(string-append home-generation "/" #$home-files-directory "/"))
|
||||
|
||||
(define (strip file)
|
||||
(string-drop file
|
||||
(+ 1 (string-length config-file-directory))))
|
||||
|
||||
(define (source-file file)
|
||||
(readlink (string-append config-file-directory file)))
|
||||
|
||||
(file-system-fold
|
||||
(const #t) ;enter?
|
||||
(lambda (file stat result) ;leaf
|
||||
(let ((source (source-file (strip file)))
|
||||
(target (target-file (strip file))))
|
||||
(when (no-follow-file-exists? target)
|
||||
(backup-file (strip file)))
|
||||
(format #t (G_ "Copying ~a -> ~a...")
|
||||
source target)
|
||||
(if (or (not (file-exists? source))
|
||||
(file-is-directory? source))
|
||||
(symlink source target)
|
||||
(begin
|
||||
(copy-file source target)
|
||||
(make-file-writable target)))
|
||||
(display (G_ " done\n"))))
|
||||
(lambda (directory stat result) ;down
|
||||
(unless (string=? directory config-file-directory)
|
||||
(let ((target (target-file (strip directory))))
|
||||
(when (and (no-follow-file-exists? target)
|
||||
(not (file-is-directory? target)))
|
||||
(backup-file (strip directory)))
|
||||
|
||||
(catch 'system-error
|
||||
(lambda ()
|
||||
(mkdir target))
|
||||
(lambda args
|
||||
(let ((errno (system-error-errno args)))
|
||||
(unless (= EEXIST errno)
|
||||
(format #t (G_ "failed to create directory ~a: ~s~%")
|
||||
target (strerror errno))
|
||||
(apply throw args))))))))
|
||||
(const #t) ;up
|
||||
(const #t) ;skip
|
||||
(const #t) ;error
|
||||
#t ;init
|
||||
config-file-directory))
|
||||
|
||||
#$%initialize-gettext
|
||||
|
||||
(let* ((home (string-append home-directory "/.guix-home"))
|
||||
(pivot (string-append home ".new"))
|
||||
(new-home (getenv "GUIX_NEW_HOME"))
|
||||
(old-home (getenv "GUIX_OLD_HOME")))
|
||||
(when old-home
|
||||
(cleanup-writable-files old-home))
|
||||
|
||||
(create-writable-files new-home)
|
||||
|
||||
(symlink new-home pivot)
|
||||
(rename-file pivot home)
|
||||
|
||||
(display (G_" done\nFinished updating writable files.\n\n"))))))))
|
||||
|
||||
(define (update-writable-files-gexp _)
|
||||
#~(primitive-load #$(update-writable-files-script)))
|
||||
|
||||
(define home-writable-files-manager-service-type
|
||||
(service-type (name 'home-writable-files-manager)
|
||||
(extensions
|
||||
(list
|
||||
(service-extension
|
||||
home-activation-service-type
|
||||
update-writable-files-gexp)))
|
||||
(default-value #f)
|
||||
(description "Provide an @code{update-writable-files} script,
|
||||
which copies files to configuration files, makes them writable and creates
|
||||
symlinks to directories on every activation. If an existing file would be
|
||||
overwritten, backs up that file first.")))
|
||||
@@ -24,7 +24,7 @@
|
||||
(define-public dinit
|
||||
(package
|
||||
(name "dinit")
|
||||
(version "0.21.0")
|
||||
(version "0.23.0")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
@@ -33,7 +33,7 @@
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0fs0sv9pkplwl27bar8ng2b7idpp1bnrmxnf1jkwdigq1ll2xsyw"))))
|
||||
(base32 "0dni69n4115g5d4kjrpx3krgzmclpy5mzs0kms01x9ifzp5kw4yh"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:configure-flags
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages android)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (guix build-system meson)
|
||||
#:use-module (gnu packages android)
|
||||
#:use-module (gnu packages libusb)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages sdl)
|
||||
#:use-module (gnu packages video))
|
||||
|
||||
(define-public scrcpy
|
||||
(package
|
||||
(name "scrcpy")
|
||||
(version "5.0.1")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/Genymobile/scrcpy")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"062fnhm5pj39cxygs276zqw780blfw6rf850r442iw587a63fsyf"))))
|
||||
(build-system meson-build-system)
|
||||
(arguments
|
||||
(list #:configure-flags
|
||||
#~(list (string-append
|
||||
"-Dprebuilt_server="
|
||||
#+(this-package-native-input
|
||||
(string-append "scrcpy-server-v"
|
||||
(package-version this-package)))))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'fix-references
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "app/src/adb/adb.c"
|
||||
(("strdup\\(\"adb\"\\)")
|
||||
(format #f "strdup(~s)"
|
||||
(search-input-file inputs "bin/adb")))))))))
|
||||
(native-inputs
|
||||
(list pkg-config
|
||||
(let ((version (package-version this-package)))
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/Genymobile/scrcpy/releases/download/v"
|
||||
version "/scrcpy-server-v" version))
|
||||
(sha256
|
||||
(base32
|
||||
"0dn57gjn5dizpzbrgf31g969ka9bi0h12d6zx4gj3m8ik3vvckkn"))))))
|
||||
(inputs (list adb ffmpeg libusb sdl3))
|
||||
(home-page "https://github.com/Genymobile/scrcpy")
|
||||
(synopsis "Display and control your Android device")
|
||||
(description
|
||||
"This application mirrors Android devices (video and audio) connected via
|
||||
USB or TCP/IP and allows control using the computer's keyboard and mouse. It
|
||||
does not require root access or an app installed on the device.")
|
||||
(license license:asl2.0)))
|
||||
@@ -27,6 +27,7 @@
|
||||
#:use-module (gnu packages elf)
|
||||
#:use-module (gnu packages gcc)
|
||||
#:use-module (gnu packages glib)
|
||||
#:use-module (gnu packages hardware)
|
||||
#:use-module (gnu packages java)
|
||||
#:use-module (gnu packages nss)
|
||||
#:use-module (gnu packages sync)
|
||||
@@ -40,7 +41,7 @@
|
||||
(define-public cloudflare-warp-bin
|
||||
(package
|
||||
(name "cloudflare-warp-bin")
|
||||
(version "2026.3.846.0")
|
||||
(version "2026.9.3927.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://pkg.cloudflareclient.com"
|
||||
@@ -48,7 +49,7 @@
|
||||
"cloudflare-warp_" version "_amd64.deb"))
|
||||
(sha256
|
||||
(base32
|
||||
"0yvdylcw916hz6wy1y9ah5ajkf4i0ndw7ck0ymqxma74z72101qz"))))
|
||||
"12hfq9yxa9igjif42anxwf3vaf7c518wahkzj87fl6jyf65xn89g"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list
|
||||
@@ -88,7 +89,8 @@
|
||||
inputs (in-vicinity "lib" lib))))
|
||||
'("libdbus-1.so"
|
||||
"libgcc_s.so"
|
||||
"libnspr4.so")))
|
||||
"libnspr4.so"
|
||||
"libtss2-esys.so")))
|
||||
":")))
|
||||
(define (patch-elf file)
|
||||
(format #t "Patching ~a ..." file)
|
||||
@@ -108,7 +110,7 @@
|
||||
(invoke cmd "--version"))))))))
|
||||
(supported-systems '("x86_64-linux"))
|
||||
(native-inputs (list patchelf-0.16))
|
||||
(inputs (list dbus `(,gcc "lib") glibc nspr nss))
|
||||
(inputs (list dbus `(,gcc "lib") glibc nspr nss tpm2-tss))
|
||||
(home-page "https://1.1.1.1/")
|
||||
(synopsis "Cloudflare WARP client")
|
||||
(description
|
||||
@@ -128,7 +130,7 @@ different needs.")
|
||||
(define-public tuwunel-bin
|
||||
(package
|
||||
(name "tuwunel-bin")
|
||||
(version "1.6.0")
|
||||
(version "1.9.4")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -138,7 +140,7 @@ different needs.")
|
||||
(file-name (string-append name "-" version ".zst"))
|
||||
(sha256
|
||||
(base32
|
||||
"052lp7iv9dpcryy9j1vgi9j6l6gd3n8971kmi46js79pxfwsa9x9"))))
|
||||
"18ymxl238xzgwr2mp0d8f173qbik20nkzfdf6949xnny2dnqwqkq"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -187,7 +189,7 @@ the most niche uses.")
|
||||
(define-public komga-bin
|
||||
(package
|
||||
(name "komga-bin")
|
||||
(version "1.24.3")
|
||||
(version "1.30.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -195,7 +197,7 @@ the most niche uses.")
|
||||
"/komga-" version ".jar"))
|
||||
(sha256
|
||||
(base32
|
||||
"16ms8rfr5qqi375qsgl1392jnmxb3bjbcl4p0n59nq6hpx37dipq"))))
|
||||
"0fx40hzbzgpsalwf48yxaa7cpkjkg07pca46pwcv6zl4n1l68wx5"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:install-plan
|
||||
@@ -235,7 +237,7 @@ eBooks.")
|
||||
(define-public navidrome-bin
|
||||
(package
|
||||
(name "navidrome-bin")
|
||||
(version "0.61.2")
|
||||
(version "0.65.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -243,7 +245,7 @@ eBooks.")
|
||||
version "/navidrome_" version "_linux_amd64.tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0ygcbpivp7wmdk4xk1pi6y160scxvqw8dbnjnx092ldm14gakj36"))))
|
||||
"1s53wy7ccm43nhp8hkzkafdm9b2ja7ncnampwal4471hmafm1817"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -315,7 +317,7 @@ monster-in-the-middle}.")
|
||||
(define-public wakapi-bin
|
||||
(package
|
||||
(name "wakapi-bin")
|
||||
(version "2.17.3")
|
||||
(version "2.18.2")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -323,7 +325,7 @@ monster-in-the-middle}.")
|
||||
version "/wakapi_linux_amd64.zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"0lppf1wzx07kv4jh9mjhx9nbwl3kcb4swnhyydsi9llccf60pccn"))))
|
||||
"0fr7948g4ddyzd5ih16w586i689viswzbgykbridvr4sm7q9hkm6"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -363,7 +365,7 @@ coding statistics.")
|
||||
(define-public wakatime-cli-bin
|
||||
(package
|
||||
(name "wakatime-cli-bin")
|
||||
(version "2.2.8")
|
||||
(version "2.28.4")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://github.com/wakatime/wakatime-cli"
|
||||
@@ -371,7 +373,7 @@ coding statistics.")
|
||||
"/wakatime-cli-linux-amd64.zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"1zrhnzwr7mzl5skgb7y5fqhm9a57xry4v90j3bj3vi7x33rg5vxq"))))
|
||||
"0i83azdzxlmbvm8ffqzs3z3dkpmq474pis8fv6z0xjv097yakpz1"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -413,15 +415,15 @@ to WakaTime, which is used by all WakaTime text editor plugins.")
|
||||
(define-public grafana-bin
|
||||
(package
|
||||
(name "grafana-bin")
|
||||
(version "12.4.2")
|
||||
(version "13.2.4")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://dl.grafana.com/grafana/release/"
|
||||
version "/grafana_" version "_"
|
||||
"23531306697_linux_amd64.tar.gz"))
|
||||
"38252365904_linux_amd64.tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"07sr78wi5nqlsx1nfj87bzgq29hcflqm6r5f5xcn9gq3m00b4h7j"))))
|
||||
"1awjgdcg79k7rzrx0q73nd5fda7q38jp19jfgrh751fqiyc6b1y4"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -450,7 +452,7 @@ metrics no matter where they are stored.")
|
||||
(define-public prometheus-bin
|
||||
(package
|
||||
(name "prometheus-bin")
|
||||
(version "3.11.2")
|
||||
(version "3.16.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append "https://github.com/prometheus/prometheus"
|
||||
@@ -458,7 +460,7 @@ metrics no matter where they are stored.")
|
||||
"/prometheus-" version ".linux-amd64.tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"19j4l46k8vwsdzifk17sn5ajdrdj3zdvs9rd60lr640dx4gflhzn"))))
|
||||
"0d0gdsfl9yvn1hs2vz68zxdjhdz6ngajy1kzzzhh4b1a8w4p0wk8"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -502,7 +504,7 @@ observed.")
|
||||
(define-public mimir-bin
|
||||
(package
|
||||
(name "mimir-bin")
|
||||
(version "3.0.4")
|
||||
(version "3.2.3")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -510,7 +512,7 @@ observed.")
|
||||
version "/mimir-linux-amd64"))
|
||||
(sha256
|
||||
(base32
|
||||
"09bhfbax659p1svzk8gq37vckqd62xsr219ab8f4r36c74ml3vz8"))))
|
||||
"17rhn69z3vvkxhfjr14gv7zx22x1spgf1cyj8gc0zidwy09d8wzj"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system))
|
||||
@@ -542,7 +544,7 @@ multi-tenant, long-term storage for Prometheus.")
|
||||
(define-public loki-bin
|
||||
(package
|
||||
(name "loki-bin")
|
||||
(version "3.7.1")
|
||||
(version "3.7.11")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -550,7 +552,7 @@ multi-tenant, long-term storage for Prometheus.")
|
||||
version "/loki-linux-amd64.zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"0w5aarm1vbyn2l2mzqbd90g1azqq5y1swwkvj57bgm95lrips0pg"))))
|
||||
"0ydgjphmqy2ihf1ff7la254si270g82kpazaq8j1yz1s40h3q1l5"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:install-plan
|
||||
@@ -576,7 +578,7 @@ rather a set of labels for each log stream.")
|
||||
(package
|
||||
(inherit %binary-source)
|
||||
(name "alloy")
|
||||
(version "1.15.1")
|
||||
(version "1.22.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -584,13 +586,13 @@ rather a set of labels for each log stream.")
|
||||
version "/alloy-linux-amd64.zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"0b5qp8301l367jnqqqd64s61g529c6pjw93f8ayhm4a2dnawygll"))))))
|
||||
"1ybn64yg57bla7wny2bxa1dcgbx6ham770kccgynz6wcn7z7glb2"))))))
|
||||
|
||||
(define-public %alloy-source-aarch64-linux
|
||||
(package
|
||||
(inherit %binary-source)
|
||||
(name "alloy")
|
||||
(version "1.15.1")
|
||||
(version "1.22.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -598,7 +600,7 @@ rather a set of labels for each log stream.")
|
||||
version "/alloy-linux-arm64.zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"0yrx1sxqshcly4bigc30jpfcq9d1dnmp31mwchn6jazddsbadbmi"))))))
|
||||
"1lva8f7shynbgp06ic3d046yp94vhxcmffcmikgzfgjxq9xlsb6c"))))))
|
||||
|
||||
(define-public alloy-bin
|
||||
(binary-package
|
||||
@@ -635,6 +637,7 @@ rather a set of labels for each log stream.")
|
||||
(name "alloy"))
|
||||
(with-directory-excursion dest
|
||||
(invoke "patchelf" "--set-interpreter" ld.so name)
|
||||
(invoke "patchelf" "--set-rpath" (dirname ld.so) name)
|
||||
(chmod name #o555)))))
|
||||
(add-after 'patch-elf 'install-extras
|
||||
(lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
|
||||
@@ -658,7 +661,7 @@ rather a set of labels for each log stream.")
|
||||
(append (if (%current-target-system)
|
||||
(list this-package)
|
||||
'())
|
||||
(list patchelf unzip)))
|
||||
(list patchelf-0.16 unzip)))
|
||||
(supported-systems '("x86_64-linux" "aarch64-linux"))
|
||||
(home-page "https://grafana.com/oss/alloy-opentelemetry-collector/")
|
||||
(synopsis
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
(define-public limine
|
||||
(package
|
||||
(name "limine")
|
||||
(version "11.3.1")
|
||||
(version "12.11.3")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
@@ -47,7 +47,7 @@
|
||||
"/download/v" version "/limine-" version ".tar.xz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0d0221xc3374xq6bx26dkmidcf6slxc6dq6qnjdc3lrx3xda21jw"))))
|
||||
"1wsjv099nf8hg5irlhj71pxin7c5skpgvkplgrnh1mcwsj10m4ay"))))
|
||||
(build-system gnu-build-system)
|
||||
(arguments
|
||||
(list #:tests? #f
|
||||
@@ -84,8 +84,7 @@
|
||||
(description
|
||||
"Limine is a multiprotocol bootloader and boot manager. It's also used as
|
||||
the reference implementation for the Limine boot protocol.")
|
||||
(license license:bsd-2)
|
||||
(properties '((disable-updater? . #t)))))
|
||||
(license license:bsd-2)))
|
||||
|
||||
|
||||
;;;
|
||||
@@ -103,7 +102,7 @@ the reference implementation for the Limine boot protocol.")
|
||||
(define-public systemd-stub
|
||||
(package
|
||||
(name "systemd-stub")
|
||||
(version "260.1")
|
||||
(version "262.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -112,7 +111,7 @@ the reference implementation for the Limine boot protocol.")
|
||||
(file-name (git-file-name "name" version))
|
||||
(sha256
|
||||
(base32
|
||||
"1az9sswsyfyw7m4if1mmxyamw8xnb0i3gg1bng4c9kz3bgga6hhm"))))
|
||||
"1a5n1h3pkha5id2mdpl8b07dggrga4zvm6w4yw30xdv63mmgplh4"))))
|
||||
(build-system meson-build-system)
|
||||
(arguments
|
||||
(list #:tests? #f
|
||||
@@ -146,7 +145,7 @@ Supports measured and/or verified boot environments.")
|
||||
(define-public ukify
|
||||
(package
|
||||
(name "ukify")
|
||||
(version "260.1")
|
||||
(version "262.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -155,7 +154,7 @@ Supports measured and/or verified boot environments.")
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1az9sswsyfyw7m4if1mmxyamw8xnb0i3gg1bng4c9kz3bgga6hhm"))))
|
||||
"1a5n1h3pkha5id2mdpl8b07dggrga4zvm6w4yw30xdv63mmgplh4"))))
|
||||
(build-system pyproject-build-system)
|
||||
(arguments
|
||||
(list #:phases
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
(define bitwarden
|
||||
(package
|
||||
(name "bitwarden")
|
||||
(version "2026.3.0")
|
||||
(version "2026.10.0")
|
||||
(source (origin
|
||||
(method url-fetch/zipbomb)
|
||||
(uri (string-append "https://github.com/bitwarden/clients"
|
||||
@@ -28,7 +28,7 @@
|
||||
"/dist-firefox-" version ".zip"))
|
||||
(sha256
|
||||
(base32
|
||||
"1jsc9w8w1vix7gzcrlxg3aslqnr27hwhaqvf0slhc7s3dgwnfrqq"))))
|
||||
"0k8c1wfq9yzgyq7whj5gbp00pbkr4a7aklkd3ybczi4zws1d55v8"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:install-plan
|
||||
@@ -103,7 +103,7 @@ results are added in a sidebar next to search engine results.")
|
||||
(define ohmyech
|
||||
(package
|
||||
(name "ohmyech")
|
||||
(version "1.2")
|
||||
(version "1.5")
|
||||
(properties
|
||||
'((addon-id . "{46b8ab0b-8adf-4e43-ad67-acef5a8d45c9}")
|
||||
(hidden? . #t)
|
||||
@@ -112,11 +112,11 @@ results are added in a sidebar next to search engine results.")
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/27justin/ohmyech")
|
||||
(commit "aa0cf4cc5c4bcb6ce508d8a4e7ee4c95c2e63cbe")))
|
||||
(commit "1faea936f6507580c6b2bd04dc57449398c799f4")))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1cqgfv2q7shisi9ijac5s85xy9q2rz9f9hxwq3q41vfgrcvd8zng"))
|
||||
"0r1kipfy3afgc0jabav7q7h90d153nly1iakn4pfrwf8401n4qsi"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
#~(substitute* "manifest.json"
|
||||
|
||||
@@ -11,11 +11,3 @@
|
||||
#:use-module (guix git-download)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages ci))
|
||||
|
||||
(define-public cuirass/dolly
|
||||
(package
|
||||
(inherit
|
||||
(package-with-extra-patches cuirass
|
||||
(rosenthal-patches "cuirass-templates-Add-more-forges.patch")))
|
||||
(name "cuirass-dolly")
|
||||
(properties '((disable-updater? . #t)))))
|
||||
@@ -13,8 +13,8 @@
|
||||
|
||||
(define-public dnsmasq-china-list
|
||||
;; No version.
|
||||
(let ((commit "7da1a5a5885c3f19dd000aa76a25e457352dd696")
|
||||
(revision "21"))
|
||||
(let ((commit "c79474a5445e7ebbde7275648b1078a0582510ab")
|
||||
(revision "22"))
|
||||
(package
|
||||
(name "dnsmasq-china-list")
|
||||
(version (git-version "0.0.0" revision commit))
|
||||
@@ -26,7 +26,7 @@
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"04dgra5123k94k0q1v9f7rmk3zdzc429hkr6jvn1lx4cxfcs0zfq"))))
|
||||
"0ifgkg7l31623q46cx0ymcfvw4gkmnir47z2xdn203icwic6224y"))))
|
||||
(build-system copy-build-system)
|
||||
(arguments
|
||||
(list #:install-plan
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
(define-module (rosenthal packages emacs-xyz)
|
||||
;; Utilities
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
@@ -13,7 +14,10 @@
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system emacs)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages emacs-build)
|
||||
#:use-module (gnu packages emacs-xyz)
|
||||
#:use-module (gnu packages gcc)
|
||||
#:use-module (gnu packages pdf)
|
||||
#:use-module (rosenthal packages version-control))
|
||||
|
||||
(define-public emacs-caddyfile-mode
|
||||
@@ -44,6 +48,32 @@ editing Caddyfiles, configuration files for @code{caddy}.")
|
||||
(properties
|
||||
'((disable-updater? . #t))))))
|
||||
|
||||
(define-public emacs-consult-ghostel
|
||||
(package
|
||||
(name "emacs-consult-ghostel")
|
||||
(version "0.68.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/dakra/ghostel")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1sl9sv4w4ffyh3ga1qwi4y49gk4m00i101xmyy2aq8chn6wc2jqy"))))
|
||||
(build-system emacs-build-system)
|
||||
(arguments
|
||||
(list #:tests? #f ;no tests
|
||||
#:lisp-directory "extensions/consult-ghostel"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(delete 'build)))) ;ghostel isn't packaged
|
||||
(propagated-inputs (list emacs-compat emacs-consult))
|
||||
(home-page "https://github.com/dakra/ghostel")
|
||||
(synopsis "Consult integration for ghostel")
|
||||
(description "This package provides consult integration for ghostel.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
(define-public emacs-eat/dolly
|
||||
(package
|
||||
(inherit
|
||||
@@ -85,29 +115,6 @@ some keybindings are slightly simplified.")
|
||||
(license license:gpl3+)
|
||||
(properties '((disable-updater? . #t)))))
|
||||
|
||||
(define-public emacs-kdl-mode
|
||||
(let ((commit "2d849e298199f490e4894c01764a8a83decd704a")
|
||||
(revision "0"))
|
||||
(package
|
||||
(name "emacs-kdl-mode")
|
||||
(version (git-version "0.0.1" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/taquangtrung/emacs-kdl-mode")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"18va5ipay9grbv84kwq9ji4dn1sabnzydj4hb1mjd9mbbibw1wg4"))))
|
||||
(build-system emacs-build-system)
|
||||
(arguments (list #:tests? #f)) ;No tests.
|
||||
(home-page "https://github.com/taquangtrung/emacs-kdl-mode")
|
||||
(synopsis "Emacs major mode for editing files in the KDL document language")
|
||||
(description "")
|
||||
(license license:gpl3+)
|
||||
(properties '((disable-updater? . #t))))))
|
||||
|
||||
(define-public emacs-magit-delta/dolly
|
||||
(package
|
||||
(inherit
|
||||
@@ -121,22 +128,32 @@ some keybindings are slightly simplified.")
|
||||
(name "emacs-magit-delta-dolly")
|
||||
(properties '((disable-updater? . #t)))))
|
||||
|
||||
(define-public emacs-majutsu/dolly
|
||||
(let ((commit "aebd5acdecd1fa6de249dabd274b963cd73d3bfc")
|
||||
(revision "2"))
|
||||
(define-deprecated-package emacs-majutsu/dolly "emacs-majutsu-dolly" emacs-majutsu)
|
||||
|
||||
(define-public emacs-msgpack
|
||||
(let ((commit "5353a7b2da854c843cbec4536996242001f63471")
|
||||
(revision "0"))
|
||||
(package
|
||||
(inherit emacs-majutsu)
|
||||
(name "emacs-majutsu-dolly")
|
||||
(version (git-version "0.6.0" revision commit))
|
||||
(name "emacs-msgpack")
|
||||
(version (git-version "0.1.1" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/0WD0/majutsu")
|
||||
(url "https://github.com/xuchunyang/msgpack.el")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1m5w49j9z61lbcz1bdx03iamnb7pkg2zfmqf6dzm19zlhg5489mk"))))
|
||||
"08pr8ijvfpnzx4bxbj8cjmibk2mlx0ksjwm3dv3lzp3i6cg5mhsw"))))
|
||||
(build-system emacs-build-system)
|
||||
(arguments
|
||||
(list #:test-command ''("ert-runner" "msgpack-tests.el")))
|
||||
(native-inputs (list emacs-ert-runner))
|
||||
(home-page "https://github.com/xuchunyang/msgpack.el")
|
||||
(synopsis "Read and write MessagePack object in Emacs")
|
||||
(description
|
||||
"This package provides an Emacs Lisp library for MessagePack.")
|
||||
(license license:gpl3+)
|
||||
(properties '((disable-updater? . #t))))))
|
||||
|
||||
(define-public emacs-pcmpl-tailscale
|
||||
@@ -164,6 +181,38 @@ and it's subcommands.")
|
||||
(properties
|
||||
'((disable-updater? . #t))))))
|
||||
|
||||
(define-deprecated-package emacs-reader emacs-emureader)
|
||||
|
||||
(define-public emacs-tramp-rpc
|
||||
(package
|
||||
(name "emacs-tramp-rpc")
|
||||
(version "0.17.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/ArthurHeymans/emacs-tramp-rpc")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"13bjnazn2mgvw4pywkxz2m2lld7ga2i3f88srpdsr23mb1bbxfxa"))))
|
||||
(build-system emacs-build-system)
|
||||
(arguments
|
||||
(list #:lisp-directory "lisp"
|
||||
#:test-command ''("bash" "../test/run-tests.sh" "--protocol")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(delete 'patch-el-files))))
|
||||
(native-inputs (list emacs-tramp))
|
||||
(propagated-inputs (list emacs-msgpack))
|
||||
(home-page "https://github.com/ArthurHeymans/emacs-tramp-rpc")
|
||||
(synopsis "TRAMP backend using RPC")
|
||||
(description
|
||||
"This package provides a TRAMP backend that uses a custom RPC server
|
||||
instead of parsing shell command output. This significantly improves
|
||||
performance for remote file operations.")
|
||||
(license license:gpl3+)))
|
||||
|
||||
;; https://issues.guix.gnu.org/59552
|
||||
(define-public emacs-wakatime-mode
|
||||
;; No release since May 5, 2015.
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages file-systems)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix git-download)
|
||||
#:use-module (gnu packages file-systems))
|
||||
|
||||
(define-public zfs-cachyos
|
||||
(let ((commit "fb48c76e17d3e0092fbba430a9eec1960e1b9961")
|
||||
(revision "0"))
|
||||
(package/inherit zfs
|
||||
(name "zfs-cachyos")
|
||||
(version (git-version "2.4.5" revision commit))
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/CachyOS/zfs")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "1zb3rs40fhkhn2fd3g5aspm50cy4xvg84ah84h5brz6abvfr1rg4")))))))
|
||||
@@ -44,7 +44,7 @@
|
||||
(define-public prismlauncher/dolly
|
||||
(package
|
||||
(name "prismlauncher-dolly")
|
||||
(version "11.0.2")
|
||||
(version "12.0.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -54,7 +54,7 @@
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1qzzfaz4k5c3wlgf53v0cpkg5fw24hfknm7j41hkbihrajgv6nxn"))
|
||||
"1awbh6ib0hh2x1xr37bc2vkcd1wm7w7hxxlyz0ga52zxjhgsbrcx"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet
|
||||
'(substitute* "launcher/CMakeLists.txt"
|
||||
@@ -101,6 +101,7 @@
|
||||
"libX11.so"
|
||||
"libXcursor.so"
|
||||
"libXext.so"
|
||||
"libXi.so"
|
||||
"libXrandr.so"
|
||||
"libXxf86vm.so"
|
||||
;; openal
|
||||
@@ -124,6 +125,7 @@
|
||||
libarchive
|
||||
libusb
|
||||
libx11
|
||||
libxi
|
||||
libxcursor
|
||||
libxext
|
||||
libxrandr
|
||||
|
||||
@@ -15,34 +15,20 @@
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages guile-xyz))
|
||||
|
||||
(define-public guile-toml
|
||||
(let ((commit "ecb24deb407ef76ef7cf7e9f0115060c98366a6b")
|
||||
(revision "0"))
|
||||
(package
|
||||
(name "guile-toml")
|
||||
(version (git-version "0.0.0" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/hylophile/guile-toml")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1iqxivxcb0dcjbd5ba3c0g3mj71b32qjxfdmljyv9r297yykfd02"))
|
||||
(patches
|
||||
(rosenthal-patches "guile-toml-support-boolean.patch"))))
|
||||
(build-system guile-build-system)
|
||||
(arguments
|
||||
(list #:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'avoid-test-installation
|
||||
(lambda _
|
||||
(delete-file-recursively "test"))))))
|
||||
(native-inputs (list guile-3.0))
|
||||
(propagated-inputs (list guile-json-4))
|
||||
(home-page "https://github.com/hylophile/guile-toml")
|
||||
(synopsis "TOML module for GNU Guile")
|
||||
(description "")
|
||||
(license license:gpl3+)
|
||||
(properties '((disable-updater? . #t))))))
|
||||
(define-public guile-toml/dolly
|
||||
(package
|
||||
(inherit guile-toml)
|
||||
(name "guile-toml")
|
||||
(version "1.0")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/hylophile/guile-toml")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0nyxj9gz0v5n2whi5wikidz5d5a7hf181vwnlr0v1l67xvxhxv1d"))
|
||||
(patches
|
||||
(rosenthal-patches "guile-toml-support-boolean.patch"))))
|
||||
(properties '((disable-updater? . #t)))))
|
||||
@@ -0,0 +1,308 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages linux)
|
||||
;; Guile builtins
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
;; Utilities
|
||||
#:use-module (guix diagnostics)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix download)
|
||||
#:use-module (guix git-download)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages linux)
|
||||
#:export (default-initrd-configs
|
||||
cachyos-configs))
|
||||
|
||||
(define* (default-initrd-configs
|
||||
#:optional
|
||||
(system (or (%current-target-system)
|
||||
(%current-system))))
|
||||
"Kernel configurations required by 'default-linux-libre-initrd-modules'."
|
||||
`("CONFIG_NLS_ISO8859_1=m"
|
||||
|
||||
"CONFIG_CRYPTO_SERPENT=m"
|
||||
"CONFIG_CRYPTO_WP512=m"
|
||||
"CONFIG_DM_CRYPT=m"
|
||||
|
||||
"CONFIG_BLK_DEV_NVME=m"
|
||||
"CONFIG_MMC_BLOCK=m"
|
||||
"CONFIG_SATA_AHCI=m"
|
||||
"CONFIG_USB_STORAGE=m"
|
||||
"CONFIG_USB_UAS=m"
|
||||
,@(if (string-match "^(x86_64|i[3-6]86)-" system)
|
||||
'("CONFIG_PATA_ACPI=m"
|
||||
"CONFIG_PATA_ATIIXP=m"
|
||||
"CONFIG_SCSI_ISCI=m")
|
||||
'())
|
||||
|
||||
"CONFIG_HW_RANDOM_VIRTIO=m"
|
||||
"CONFIG_SCSI_VIRTIO=m"
|
||||
"CONFIG_VIRTIO_BALLOON=m"
|
||||
"CONFIG_VIRTIO_BLK=m"
|
||||
"CONFIG_VIRTIO_CONSOLE=m"
|
||||
"CONFIG_VIRTIO_MMIO=m"
|
||||
"CONFIG_VIRTIO_NET=m"
|
||||
"CONFIG_VIRTIO_PCI=m"
|
||||
|
||||
"CONFIG_HID_GENERIC=m"
|
||||
"CONFIG_USB_HID=m"
|
||||
,@(if (target-riscv64? system)
|
||||
'()
|
||||
'("CONFIG_HID_APPLE=m"))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; linux-cachyos
|
||||
;;; https://github.com/CachyOS/linux-cachyos
|
||||
;;;
|
||||
|
||||
(define* (cachyos-configs #:key (major-version "6")
|
||||
cachy-config?
|
||||
cpusched
|
||||
cc-harder?
|
||||
per-gov?
|
||||
tcp-bbr3?
|
||||
HZ-ticks
|
||||
tickrate
|
||||
preempt
|
||||
hugepage
|
||||
processor-opt)
|
||||
`(,@(match processor-opt
|
||||
('generic
|
||||
'("CONFIG_GENERIC_CPU=y"
|
||||
"CONFIG_MZEN4"
|
||||
"CONFIG_X86_NATIVE_CPU"))
|
||||
('zen4
|
||||
'("CONFIG_GENERIC_CPU"
|
||||
"CONFIG_MZEN4=y"
|
||||
"CONFIG_X86_NATIVE_CPU"))
|
||||
('native
|
||||
'("CONFIG_GENERIC_CPU"
|
||||
"CONFIG_MZEN4"
|
||||
"CONFIG_X86_NATIVE_CPU=y"))
|
||||
(_ '()))
|
||||
,@(if cachy-config?
|
||||
'("CONFIG_CACHY=y")
|
||||
'())
|
||||
,@(match cpusched
|
||||
((or 'cachyos 'bore 'hardened)
|
||||
'("CONFIG_SCHED_BORE=y"))
|
||||
('bmq
|
||||
'("CONFIG_SCHED_ALT=y"
|
||||
"CONFIG_SCHED_BMQ=y"))
|
||||
('eevdf
|
||||
'())
|
||||
('rt
|
||||
'("CONFIG_PREEMPT_RT=y"))
|
||||
('rt-bore
|
||||
'("CONFIG_SCHED_BORE=y"
|
||||
"CONFIG_PREEMPT_RT=y"))
|
||||
(_ '()))
|
||||
,@(match HZ-ticks
|
||||
((or 100 250 500 600 750 1000)
|
||||
`("CONFIG_HZ_300"
|
||||
,(format #f "CONFIG_HZ_~a=y" HZ-ticks)
|
||||
,(format #f "CONFIG_HZ=~a" HZ-ticks)))
|
||||
(300
|
||||
'("CONFIG_HZ_300=y"
|
||||
"CONFIG_HZ=300"))
|
||||
(_ '()))
|
||||
,@(if per-gov?
|
||||
'("CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL"
|
||||
"CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y")
|
||||
'())
|
||||
,@(match tickrate
|
||||
('periodic
|
||||
'("CONFIG_NO_HZ_IDLE"
|
||||
"CONFIG_NO_HZ_FULL"
|
||||
"CONFIG_NO_HZ"
|
||||
"CONFIG_NO_HZ_COMMON"
|
||||
"CONFIG_HZ_PERIODIC=y"))
|
||||
('idle
|
||||
'("CONFIG_HZ_PERIODIC"
|
||||
"CONFIG_NO_HZ_FULL"
|
||||
"CONFIG_NO_HZ_IDLE=y"
|
||||
"CONFIG_NO_HZ"
|
||||
"CONFIG_NO_HZ_COMMON"))
|
||||
('full
|
||||
'("CONFIG_HZ_PERIODIC"
|
||||
"CONFIG_NO_HZ_IDLE"
|
||||
"CONFIG_CONTEXT_TRACKING_FORCE"
|
||||
"CONFIG_NO_HZ_FULL=y"
|
||||
"CONFIG_NO_HZ=y"
|
||||
"CONFIG_NO_HZ_COMMON=y"
|
||||
"CONFIG_CONTEXT_TRACKING=y")))
|
||||
,@(if (not (member cpusched '(rt rt-bore)))
|
||||
(if (version>=? major-version "7.0")
|
||||
(match preempt
|
||||
('full
|
||||
'("CONFIG_PREEMPT=y"
|
||||
"CONFIG_PREEMPT_LAZY"))
|
||||
('lazy
|
||||
'("CONFIG_PREEMPT"
|
||||
"CONFIG_PREEMPT_LAZY=y"))
|
||||
(_ '()))
|
||||
(match preempt
|
||||
('full
|
||||
'("CONFIG_PREEMPT_DYNAMIC=y"
|
||||
"CONFIG_PREEMPT=y"
|
||||
"CONFIG_PREEMPT_VOLUNTARY"
|
||||
"CONFIG_PREEMPT_LAZY"
|
||||
"CONFIG_PREEMPT_NONE"))
|
||||
('lazy
|
||||
'("CONFIG_PREEMPT_DYNAMIC=y"
|
||||
"CONFIG_PREEMPT"
|
||||
"CONFIG_PREEMPT_VOLUNTARY"
|
||||
"CONFIG_PREEMPT_LAZY=y"
|
||||
"CONFIG_PREEMPT_NONE"))
|
||||
('voluntary
|
||||
'("CONFIG_PREEMPT_DYNAMIC"
|
||||
"CONFIG_PREEMPT=y"
|
||||
"CONFIG_PREEMPT_VOLUNTARY=y"
|
||||
"CONFIG_PREEMPT_LAZY"
|
||||
"CONFIG_PREEMPT_NONE"))
|
||||
('none
|
||||
'("CONFIG_PREEMPT_DYNAMIC"
|
||||
"CONFIG_PREEMPT"
|
||||
"CONFIG_PREEMPT_VOLUNTARY"
|
||||
"CONFIG_PREEMPT_LAZY"
|
||||
"CONFIG_PREEMPT_NONE=y"))
|
||||
(_ '())))
|
||||
'())
|
||||
,@(if cc-harder?
|
||||
'("CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE"
|
||||
"CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3=y")
|
||||
'())
|
||||
,@(if tcp-bbr3?
|
||||
'("CONFIG_TCP_CONG_CUBIC=m"
|
||||
"CONFIG_DEFAULT_CUBIC"
|
||||
"CONFIG_TCP_CONG_BBR=y"
|
||||
"CONFIG_DEFAULT_BBR=y"
|
||||
"CONFIG_DEFAULT_TCP_CONG=\"bbr\""
|
||||
"CONFIG_NET_SCH_FQ_CODEL=m"
|
||||
"CONFIG_NET_SCH_FQ=y"
|
||||
"CONFIG_DEFAULT_FQ_CODEL"
|
||||
"CONFIG_DEFAULT_FQ=y")
|
||||
'())
|
||||
,@(match hugepage
|
||||
('always
|
||||
'("CONFIG_TRANSPARENT_HUGEPAGE_MADVISE"
|
||||
"CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y"))
|
||||
('madvise
|
||||
'("CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS"
|
||||
"CONFIG_TRANSPARENT_HUGEPAGE_MADVISE=y"))
|
||||
(_ '()))
|
||||
,@(if (version>=? major-version "7.0")
|
||||
'()
|
||||
'("CONFIG_USER_NS=y"))))
|
||||
|
||||
(define (%kernel-config commit hash)
|
||||
(let ((source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://codeberg.org/hako/kernel-config.git")
|
||||
(commit commit)))
|
||||
(file-name (string-append "kernel-config." (string-take commit 7)))
|
||||
(hash
|
||||
(if (content-hash? hash)
|
||||
hash
|
||||
(content-hash hash))))))
|
||||
(lambda (path)
|
||||
(file-append source path))))
|
||||
|
||||
(define-public linux-cachyos-lts-server
|
||||
(let* ((version "6.18.65-1")
|
||||
(config
|
||||
(%kernel-config
|
||||
"30ca31f1a4b05d9c42f1b9482f6a7419b12453be"
|
||||
(base32 "0qb8mgrj458xxjp3m050lf03wf4j2nz4jpxix068cv0pnvlj3y3k")))
|
||||
(kernel
|
||||
(customize-linux
|
||||
#:name "linux-cachyos-lts-server"
|
||||
#:source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/CachyOS/linux/releases/download/cachyos-"
|
||||
version "/cachyos-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "102ad9k412166b6kdaiql15dynanqm11gppagpi1zx4cz80lwkm0")))
|
||||
#:defconfig (config "/defconfig_server")
|
||||
#:configs
|
||||
(string-join
|
||||
(append (cachyos-configs
|
||||
#:major-version (version-major version)
|
||||
#:cachy-config? #f
|
||||
#:cpusched 'eevdf
|
||||
#:cc-harder? #t
|
||||
#:per-gov? #f
|
||||
#:tcp-bbr3? #t
|
||||
#:HZ-ticks 300
|
||||
#:tickrate 'full
|
||||
#:preempt 'none
|
||||
#:hugepage 'madvise
|
||||
#:processor-opt 'generic)
|
||||
(default-initrd-configs))
|
||||
"\n"))))
|
||||
(package
|
||||
(inherit kernel)
|
||||
(version version)
|
||||
(home-page "https://cachyos.org/")
|
||||
(synopsis "CachyOS Linux kernel (lts + server)")
|
||||
(description "")
|
||||
(supported-systems '("x86_64-linux"))
|
||||
(properties
|
||||
(cons '(disable-updater? . #t)
|
||||
(package-properties kernel))))))
|
||||
|
||||
(define-public linux-cachyos-bore-zen4
|
||||
(let* ((version "7.3.6-1")
|
||||
(config
|
||||
(%kernel-config
|
||||
"f45de89952cd52542e3a3cbf4fcedaa75d817e89"
|
||||
(base32 "12xhs53ihg4k1vgx042acfri174mblbfrcp0199i3fbl0vy0xpaz")))
|
||||
(kernel
|
||||
(customize-linux
|
||||
#:name "linux-cachyos-bore-zen4"
|
||||
#:source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/CachyOS/linux/releases/download/cachyos-"
|
||||
version "/cachyos-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "0gvgp0hwnrdgxs07wlz474c40g15z1r3aq7dq1yi4nn5p09yhp7v"))
|
||||
(patches (map config '("/patches/bore-cachy-7.3.patch"))))
|
||||
#:defconfig (config "/defconfig_desktop")
|
||||
#:configs
|
||||
(string-join
|
||||
(append (cachyos-configs
|
||||
#:major-version (version-major version)
|
||||
#:cachy-config? #t
|
||||
#:cpusched 'bore
|
||||
#:cc-harder? #t
|
||||
#:per-gov? #f
|
||||
#:tcp-bbr3? #t
|
||||
#:HZ-ticks 1000
|
||||
#:tickrate 'full
|
||||
#:preempt 'full
|
||||
#:hugepage 'always
|
||||
#:processor-opt 'zen4)
|
||||
(default-initrd-configs))
|
||||
"\n"))))
|
||||
(package
|
||||
(inherit kernel)
|
||||
(version version)
|
||||
(home-page "https://cachyos.org/")
|
||||
(synopsis "CachyOS Linux kernel (bore + znver4)")
|
||||
(description "")
|
||||
(supported-systems '("x86_64-linux"))
|
||||
(properties
|
||||
(cons '(disable-updater? . #t)
|
||||
(package-properties kernel))))))
|
||||
@@ -11,9 +11,12 @@
|
||||
#:use-module (guix git-download)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system pyproject)
|
||||
#:use-module (rosenthal build-system go-vendored)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages crypto)
|
||||
#:use-module (gnu packages databases)
|
||||
#:use-module (gnu packages golang)
|
||||
#:use-module (gnu packages monitoring)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module (gnu packages python-build)
|
||||
@@ -62,7 +65,7 @@ users.")
|
||||
(define-public mautrix-telegram
|
||||
(package
|
||||
(name "mautrix-telegram")
|
||||
(version "0.15.3")
|
||||
(version "0.2611.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -71,58 +74,25 @@ users.")
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0ivhp827ypngq3p8m5bmiv1nk2x2c4y0z1c37rczjmq941dnlw63"))))
|
||||
(build-system pyproject-build-system)
|
||||
"19r2z4h5p6q86jskszdq4i4nwfg4ww94xk9i0qfbpqx11j6xyy6g"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list #:tests? #f ;No test suite.
|
||||
(list #:go go-1.27
|
||||
#:vendor-hash
|
||||
(base32 "05rl044xci0hlcijrsm7zbvc6brhy332fpw59kzsdjz03rfx6avg")
|
||||
#:install-source? #f
|
||||
#:import-path "./cmd/mautrix-telegram"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'install 'install-extras
|
||||
(add-after 'install 'wrap-binary
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let* ((bindir (in-vicinity #$output "bin"))
|
||||
(etcdir (in-vicinity #$output "etc/mautrix-telegram"))
|
||||
(bin (in-vicinity bindir "mautrix-telegram"))
|
||||
(cfg (in-vicinity #$output "example-config.yaml")))
|
||||
(for-each mkdir-p (list bindir etcdir))
|
||||
(install-file cfg etcdir)
|
||||
(delete-file cfg)
|
||||
(call-with-output-file bin
|
||||
(lambda (port)
|
||||
(format port "~
|
||||
#!/bin/sh
|
||||
PATH=~a:~a:$PATH
|
||||
~a -m mautrix_telegram \"$@\"~%"
|
||||
(dirname (dirname (search-input-file inputs "bin/ffmpeg")))
|
||||
(dirname (dirname (search-input-file inputs "bin/lottieconverter")))
|
||||
(search-input-file inputs "bin/python3"))))
|
||||
(chmod bin #o555)))))))
|
||||
|
||||
(native-inputs
|
||||
(list python-setuptools))
|
||||
(propagated-inputs
|
||||
(list python-asyncpg
|
||||
python-commonmark
|
||||
python-aiosqlite
|
||||
python-magic
|
||||
python-mako
|
||||
python-mautrix
|
||||
python-ruamel.yaml
|
||||
python-tulir-telethon))
|
||||
(inputs
|
||||
(list ffmpeg
|
||||
lottie-converter
|
||||
python
|
||||
python-aiodns
|
||||
python-aiosqlite
|
||||
python-brotli
|
||||
python-olm
|
||||
python-phonenumbers
|
||||
python-pillow
|
||||
python-prometheus-client
|
||||
python-pycryptodome
|
||||
python-qrcode
|
||||
python-socks
|
||||
python-unpaddedbase64))
|
||||
(wrap-program (in-vicinity #$output "bin/mautrix-telegram")
|
||||
`("PATH" ":" prefix
|
||||
,(map (lambda (cmd)
|
||||
(dirname (search-input-file inputs cmd)))
|
||||
'("bin/ffmpeg"
|
||||
"bin/lottieconverter")))))))))
|
||||
(inputs (list bash-minimal ffmpeg lottie-converter olm))
|
||||
(synopsis "Matrix-Telegram hybrid puppeting/relaybot bridge")
|
||||
(description
|
||||
"This package provides a Matrix-Telegram hybrid puppeting/relaybot
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#:use-module (rosenthal utils download)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system go)
|
||||
#:use-module (rosenthal build-system go-vendored)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages dns)
|
||||
@@ -23,25 +24,22 @@
|
||||
(define-public cloudflared
|
||||
(package
|
||||
(name "cloudflared")
|
||||
(version "2026.3.0")
|
||||
(version "2026.10.7")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/cloudflare/cloudflared")
|
||||
(commit version)))
|
||||
(file-name (git-file-name name version))
|
||||
;; TODO: Unbundle vendored dependencies.
|
||||
;; (modules '((guix build utils)))
|
||||
;; (snippet '(delete-file-recursively "vendor"))
|
||||
(sha256
|
||||
(base32
|
||||
"1j71qzxg50kn2hnxrfgny9n6clm45sg9pz1y96z50w48jxjvlrx0"))))
|
||||
(build-system go-build-system)
|
||||
"1nyihh0z4l81w60phmlv0pqsjw29pr2v2f8byc9qasqs4qy9q8db"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list #:go go-1.24
|
||||
(list #:go go-1.27
|
||||
#:vendor-hash (base32 "0dqgcmrlbd0c5mi0msgb6iz6nkrhasdh0gnmifn9l8fnwqis87va")
|
||||
#:install-source? #f
|
||||
#:import-path "github.com/cloudflare/cloudflared/cmd/cloudflared"
|
||||
#:unpack-path "github.com/cloudflare/cloudflared"
|
||||
#:import-path "./cmd/cloudflared"
|
||||
#:build-flags
|
||||
#~(list (string-append
|
||||
"-ldflags="
|
||||
@@ -49,12 +47,9 @@
|
||||
" -X github.com/cloudflare/cloudflared/cmd/cloudflared/updater.BuiltForPackageManager=Guix"))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-before 'build 'disable-cgo
|
||||
(lambda _
|
||||
(setenv "CGO_ENABLED" "0")))
|
||||
(add-after 'install 'install-documentation
|
||||
(lambda _
|
||||
(let ((src "src/github.com/cloudflare/cloudflared/cloudflared_man_template")
|
||||
(let ((src "cloudflared_man_template")
|
||||
(dst (string-append #$output "/share/man/man1/cloudflared.1")))
|
||||
(substitute* src
|
||||
(("\\$\\{VERSION\\}") #$(package-version this-package)))
|
||||
@@ -74,7 +69,7 @@ origin can remain as closed as possible.")
|
||||
(define-public mihomo
|
||||
(package
|
||||
(name "mihomo")
|
||||
(version "1.19.23")
|
||||
(version "1.19.34")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -83,36 +78,22 @@ origin can remain as closed as possible.")
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"01l46zgjy62j600i2dz9kql8ir720gcqi5dfdrqv152py5zr79nh"))))
|
||||
(build-system go-build-system)
|
||||
"1aisnsbc6jr4fd913pwzhcb9mxnqcfwwrfd6m4zzlzhxkbwnbiz6"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:go go-1.27
|
||||
#:vendor-hash (base32 "1cpw11jrmxilqs6zrb3qdkqrnndrk33b6v0q4g3mrbpj8dfmdmyv")
|
||||
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
|
||||
#:go go-1.26
|
||||
#:install-source? #f
|
||||
#:import-path "."
|
||||
#:build-flags
|
||||
#~(list "-tags" "with_gvisor"
|
||||
(string-append
|
||||
"-ldflags="
|
||||
" -X github.com/metacubex/mihomo/constant.Version="
|
||||
#$(package-version this-package)))
|
||||
#:modules
|
||||
'((ice-9 match)
|
||||
((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
|
||||
(copy-recursively
|
||||
#+(this-package-native-input "vendored-go-dependencies")
|
||||
"vendor")))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(delete 'check)
|
||||
(add-after 'install 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
@@ -121,17 +102,9 @@ origin can remain as closed as possible.")
|
||||
(invoke mihomo "--help")
|
||||
(invoke mihomo "-v"))))))))
|
||||
(native-inputs
|
||||
(append
|
||||
(list (origin
|
||||
(method (go-mod-vendor #:go go-1.26))
|
||||
(uri (package-source this-package))
|
||||
(file-name "vendored-go-dependencies")
|
||||
(sha256
|
||||
(base32
|
||||
"1lf8wfhqbzrmgg55i54vih896xlif0apwmdbvfv962h5r9jvy6z3"))))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'())))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'()))
|
||||
(home-page "https://wiki.metacubex.one/")
|
||||
(synopsis "Rule-based proxy")
|
||||
(description
|
||||
@@ -144,7 +117,7 @@ bypass network restrictions." )
|
||||
(define-public sing-box
|
||||
(package
|
||||
(name "sing-box")
|
||||
(version "1.13.8")
|
||||
(version "1.14.7")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -153,11 +126,12 @@ bypass network restrictions." )
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0idl0j3f603b3zrs5yzby4bfm8rjs8npymkl9kjs35gqak78v4c1"))))
|
||||
(build-system go-build-system)
|
||||
"0g2pxaxb39dyfjigidqglvnzxpmp154c7k99pmvjkz1d5yr8l9vz"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:go go-1.26
|
||||
#:go go-1.27
|
||||
#:vendor-hash (base32 "1akyjq3hk4igcrflq9ydzdncizvq0ckgkn2y0fd4p08rqxxgvq3l")
|
||||
#:install-source? #f
|
||||
#:import-path "./cmd/sing-box"
|
||||
#:build-flags
|
||||
@@ -175,22 +149,11 @@ bypass network restrictions." )
|
||||
" -X github.com/sagernet/sing-box/constant.Version="
|
||||
#$(package-version this-package)))
|
||||
#:modules
|
||||
'((ice-9 match)
|
||||
((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build utils))
|
||||
(cons '(ice-9 match)
|
||||
%default-go-vendored-modules)
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
|
||||
(copy-recursively
|
||||
#+(this-package-native-input "vendored-go-dependencies")
|
||||
"vendor")))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(add-after 'unpack 'set-tailscale-default-wireguard-port
|
||||
(add-after 'unpack-vendored-dependencies 'set-tailscale-default-wireguard-port
|
||||
(lambda _
|
||||
;; See also: https://tailscale.com/kb/1082/firewall-ports
|
||||
;; https://github.com/tailscale/tailscale/blob/51c11a864b1241d1cf1a736fbc94b0f8c76da563/cmd/tailscaled/tailscaled.go#L102
|
||||
@@ -213,17 +176,9 @@ bypass network restrictions." )
|
||||
("fish" . "share/fish/vendor_completions.d/sing-box.fish")
|
||||
("zsh" . "share/zsh/site-functions/_sing-box")))))))))
|
||||
(native-inputs
|
||||
(append
|
||||
(list (origin
|
||||
(method (go-mod-vendor #:go go-1.26))
|
||||
(uri (package-source this-package))
|
||||
(file-name "vendored-go-dependencies")
|
||||
(sha256
|
||||
(base32
|
||||
"1binghhm6nvgfpj5zay0xnvlay2f015kd28llgm118q5bwlsh27a"))))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'())))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'()))
|
||||
(home-page "https://sing-box.sagernet.org/")
|
||||
(synopsis "Universal proxy platform")
|
||||
(description
|
||||
@@ -261,7 +216,7 @@ a SOCKS5 proxy.")
|
||||
(define-public tailscale
|
||||
(package
|
||||
(name "tailscale")
|
||||
(version "1.96.4")
|
||||
(version "1.104.6")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -270,7 +225,7 @@ a SOCKS5 proxy.")
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0qqlj6cq43h0pr8jg9g956yz5xgg81959vq2kl7n9yqnixyh8w2n"))
|
||||
"1ys6mgbc622vx9ddg3pgjcligpmcdq6syxwa25p99734b76f4pd0"))
|
||||
(patches
|
||||
(rosenthal-patches
|
||||
"tailscale-set-guix-system-PATH-for-SSH.patch"))
|
||||
@@ -280,13 +235,13 @@ a SOCKS5 proxy.")
|
||||
(delete-file-recursively "tool")
|
||||
(substitute* "net/tstun/tun_linux.go"
|
||||
(("/sbin/(modprobe)" _ cmd) cmd))))))
|
||||
(build-system go-build-system)
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:go go-1.27
|
||||
#:vendor-hash (base32 "084cmr6irkspxqvh3bpgjwjhqqgk6kj42pjf0j61rl8glpkjd790")
|
||||
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
|
||||
#:go go-1.26
|
||||
#:install-source? #f
|
||||
#:import-path "."
|
||||
#:build-flags
|
||||
#~(list "-tags" "ts_include_cli"
|
||||
(string-append
|
||||
@@ -296,21 +251,10 @@ a SOCKS5 proxy.")
|
||||
" -X tailscale.com/version.shortStamp="
|
||||
#$(package-version this-package)))
|
||||
#:modules
|
||||
'((ice-9 match)
|
||||
((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build utils))
|
||||
(cons '(ice-9 match)
|
||||
%default-go-vendored-modules)
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
|
||||
(copy-recursively
|
||||
#+(this-package-native-input "vendored-go-dependencies")
|
||||
"vendor")))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(add-after 'unpack 'patch-references
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "client/systray/startup-creator.go"
|
||||
@@ -373,17 +317,9 @@ a SOCKS5 proxy.")
|
||||
"tailscaled"
|
||||
"tsidp"))))))))
|
||||
(native-inputs
|
||||
(append
|
||||
(list (origin
|
||||
(method (go-mod-vendor #:go go-1.26))
|
||||
(uri (package-source this-package))
|
||||
(file-name "vendored-go-dependencies")
|
||||
(sha256
|
||||
(base32
|
||||
"1kj1q82n62x5dx4s9ivnnqi5c711pwyfic0kaykdn2ky8c89c6xf"))))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'())))
|
||||
(if (%current-target-system)
|
||||
(list this-package)
|
||||
'()))
|
||||
(inputs
|
||||
(list desktop-file-utils
|
||||
findutils
|
||||
|
||||
@@ -18,76 +18,77 @@
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages package-management))
|
||||
|
||||
(define-public guix/dolly
|
||||
(package
|
||||
(inherit
|
||||
(package-with-extra-patches guix
|
||||
(rosenthal-patches "guix-change-publish-cache-storage.patch")))
|
||||
(name "guix-dolly")
|
||||
(arguments
|
||||
(substitute-keyword-arguments arguments
|
||||
((#:parallel-build? _ #f) #t)
|
||||
((#:tests? _ #t) #f)))
|
||||
(properties '((disable-updater? . #t)))))
|
||||
|
||||
(define-public mirror-substitutes
|
||||
(let ((commit "e4001938bdec86e16da3b9c455f8d6fb40c1ab06")
|
||||
(revision "0"))
|
||||
(define guix-for-mirror-substitutes
|
||||
(let ((commit "5ceffb60e55b86920fd720817dd24b0e1f900ac1")
|
||||
(revision "7"))
|
||||
(package
|
||||
(name "mirror-substitutes")
|
||||
(version (git-version "0.0.0" revision commit))
|
||||
(inherit guix)
|
||||
(name "guix")
|
||||
(version (git-version "1.5.0" revision commit))
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://codeberg.org/hako/mirror-substitutes.git")
|
||||
(url "https://git.guix.gnu.org/guix.git")
|
||||
(commit commit)))
|
||||
(file-name (git-file-name name version))
|
||||
(file-name (string-append "guix-" version "-checkout"))
|
||||
(sha256
|
||||
(base32
|
||||
"1xbz63akkxz3b0bpqfz2q7sz90raf6nn65cmwa9mzz3alm9avzfj"))))
|
||||
(build-system guile-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:source-directory "modules"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'build 'install
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(define-values (module-dir object-dir)
|
||||
(target-guile-scm+go #$output))
|
||||
(define bindir
|
||||
(in-vicinity #$output "bin"))
|
||||
(with-directory-excursion "scripts"
|
||||
(for-each
|
||||
(lambda (script)
|
||||
(substitute* script
|
||||
(("/usr/(bin/env) -S guix" _ env)
|
||||
(format #f "~a -S ~a"
|
||||
(search-input-file inputs env)
|
||||
(if (string-suffix? "query-substitutes" script)
|
||||
"guix"
|
||||
(search-input-file inputs "bin/guix")))))
|
||||
(install-file script bindir)
|
||||
(with-directory-excursion bindir
|
||||
(wrap-program script
|
||||
`("GUILE_LOAD_PATH" prefix
|
||||
(,module-dir))
|
||||
`("GUILE_LOAD_COMPILED_PATH" prefix
|
||||
(,object-dir)))))
|
||||
(find-files "."))))))))
|
||||
(native-inputs
|
||||
(list bash-minimal
|
||||
guile-3.0-latest
|
||||
guix))
|
||||
(inputs
|
||||
(list bash-minimal
|
||||
coreutils-minimal
|
||||
guix))
|
||||
(home-page "https://codeberg.org/hako/mirror-substitutes")
|
||||
(synopsis
|
||||
"Mirror Guix substitutes without relying on remote server implementation")
|
||||
(description
|
||||
"This package provides commands to mirror substitutes for Guix and Nix
|
||||
without relying on the implementation of remote server.")
|
||||
(license license:gpl3+)
|
||||
(properties '((disable-updater? . #t))))))
|
||||
"0nb0xhd2jlg613d3z3br6yl3xj75b4vlyw9y45pwg8zrq02kjajd")))))))
|
||||
|
||||
(define-public mirror-substitutes
|
||||
(package
|
||||
(name "mirror-substitutes")
|
||||
(version "0.0.3")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://codeberg.org/hako/mirror-substitutes.git")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1qf2180bj36py05wz031m5fk2xmzwyf2cl8nhcnny63ghkm27m7j"))))
|
||||
(build-system guile-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:source-directory "modules"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'build 'install
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(define-values (module-dir object-dir)
|
||||
(target-guile-scm+go #$output))
|
||||
(define bindir
|
||||
(in-vicinity #$output "bin"))
|
||||
(with-directory-excursion "scripts"
|
||||
(for-each
|
||||
(lambda (script)
|
||||
(substitute* script
|
||||
(("/usr/(bin/env) -S guix" _ env)
|
||||
(format #f "~a -S ~a"
|
||||
(search-input-file inputs env)
|
||||
(if (string-suffix? "query-substitutes" script)
|
||||
"guix"
|
||||
(search-input-file inputs "bin/guix")))))
|
||||
(install-file script bindir)
|
||||
(with-directory-excursion bindir
|
||||
(wrap-program script
|
||||
`("GUILE_LOAD_PATH" prefix
|
||||
(,module-dir))
|
||||
`("GUILE_LOAD_COMPILED_PATH" prefix
|
||||
(,object-dir)))))
|
||||
(find-files "."))))))))
|
||||
(native-inputs
|
||||
(list bash-minimal
|
||||
guile-3.0-latest
|
||||
guix-for-mirror-substitutes))
|
||||
(inputs
|
||||
(list bash-minimal
|
||||
coreutils-minimal
|
||||
guix-for-mirror-substitutes))
|
||||
(home-page "https://codeberg.org/hako/mirror-substitutes")
|
||||
(synopsis "Mirror Guix substitutes")
|
||||
(description
|
||||
"This package provides a collection of commands to help mirror Guix / Nix
|
||||
substitutes (binary cache) from any upstream server.")
|
||||
(license license:gpl3+)))
|
||||
@@ -1,53 +0,0 @@
|
||||
From 90bf62f411590cc0b813e6f62c3a0ef89cf17d1f Mon Sep 17 00:00:00 2001
|
||||
From: Hilton Chain <hako@ultrarare.space>
|
||||
Date: Sun, 30 Nov 2025 12:13:36 +0800
|
||||
Subject: [PATCH] templates: Add more forges.
|
||||
|
||||
---
|
||||
src/cuirass/templates.scm | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/cuirass/templates.scm b/src/cuirass/templates.scm
|
||||
index 1cf7ebf..042d46a 100644
|
||||
--- a/src/cuirass/templates.scm
|
||||
+++ b/src/cuirass/templates.scm
|
||||
@@ -1526,7 +1526,9 @@ (define %vcs-web-views
|
||||
("git.guix.gnu.org" ,labhub-url) ;alias for codeberg.org
|
||||
("gitlab.com" ,labhub-url)
|
||||
("gitlab.inria.fr" ,labhub-url)
|
||||
- ("github.com" ,labhub-url))))
|
||||
+ ("github.com" ,labhub-url)
|
||||
+ ("git.sr.ht" ,labhub-url)
|
||||
+ ("git.guix.moe" ,labhub-url))))
|
||||
|
||||
(define %vcs-web-commit-range-views
|
||||
;; List of host names and corresponding URL to display a commit range.
|
||||
@@ -1541,7 +1543,13 @@ (define %vcs-web-commit-range-views
|
||||
(if (string-suffix? ".git" repository-url)
|
||||
(string-drop-right repository-url 4)
|
||||
repository-url)
|
||||
- "/compare/" commit1 ".." commit2))))
|
||||
+ "/compare/" commit1 ".." commit2)))
|
||||
+ (sourcehut-url (lambda (repository-url _ commit2)
|
||||
+ (string-append
|
||||
+ (if (string-suffix? ".git" repository-url)
|
||||
+ (string-drop-right repository-url 4)
|
||||
+ repository-url)
|
||||
+ "/log/?from=" commit2))))
|
||||
`(("git.savannah.gnu.org"
|
||||
,(lambda (repository-url commit1 commit2)
|
||||
(string-append (string-replace-substring repository-url
|
||||
@@ -1552,7 +1560,9 @@ (define %vcs-web-commit-range-views
|
||||
("git.guix.gnu.org" ,github-url) ;alias for codeberg.org
|
||||
("gitlab.com" ,gitlab-url)
|
||||
("gitlab.inria.fr" ,gitlab-url)
|
||||
- ("github.com" ,github-url))))
|
||||
+ ("github.com" ,github-url)
|
||||
+ ("git.sr.ht" ,sourcehut-url)
|
||||
+ ("git.guix.moe" ,github-url))))
|
||||
|
||||
(define* (commit-hyperlink url commit
|
||||
#:optional (text commit))
|
||||
--
|
||||
2.52.0
|
||||
|
||||
@@ -1,263 +0,0 @@
|
||||
From 4d8509b60d17cc5d242d0bb157beef123dd28923 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <4d8509b60d17cc5d242d0bb157beef123dd28923.1769270645.git.hako@ultrarare.space>
|
||||
From: Hilton Chain <hako@ultrarare.space>
|
||||
Date: Sat, 23 Aug 2025 14:07:19 +0800
|
||||
Subject: [PATCH] publish: Store cache in a layout identical to HTTP endpoints.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This allows serving substitutes using a file server.
|
||||
|
||||
Original layout:
|
||||
--8<---------------cut here---------------start------------->8---
|
||||
/path/to/publish/cache
|
||||
├── hashes
|
||||
│ ├── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb
|
||||
│ └── ql2nxr2b587kjydfwivjsnhmqya957bq
|
||||
└── nar
|
||||
├── none
|
||||
│ ├── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb-hello-2.12.2.narinfo
|
||||
│ └── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb-hello-2.12.2.nar
|
||||
└── zstd
|
||||
├── ql2nxr2b587kjydfwivjsnhmqya957bq-helix-25.01.1.narinfo
|
||||
└── ql2nxr2b587kjydfwivjsnhmqya957bq-helix-25.01.1.nar
|
||||
--8<---------------cut here---------------end--------------->8---
|
||||
|
||||
Modified layout:
|
||||
--8<---------------cut here---------------start------------->8---
|
||||
/path/to/publish/cache
|
||||
├── hashes
|
||||
│ ├── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb
|
||||
│ └── ql2nxr2b587kjydfwivjsnhmqya957bq
|
||||
├── nar
|
||||
│ ├── none
|
||||
│ │ └── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb-hello-2.12.2
|
||||
│ └── zstd
|
||||
│ └── ql2nxr2b587kjydfwivjsnhmqya957bq-helix-25.01.1
|
||||
├── k0pin1y1r0vdkdbg3lwjqc52hpwjbdyb.narinfo
|
||||
└── ql2nxr2b587kjydfwivjsnhmqya957bq.narinfo
|
||||
--8<---------------cut here---------------end--------------->8---
|
||||
|
||||
Change-Id: I07689f08eef23c5cd4494451678f4e1ad709f1b3
|
||||
---
|
||||
guix/scripts/publish.scm | 21 +++++++-----------
|
||||
tests/publish.scm | 48 ++++++++++++++++++++--------------------
|
||||
2 files changed, 32 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
|
||||
index 1143cd29cfd..24b7f40cbd7 100644
|
||||
--- a/guix/scripts/publish.scm
|
||||
+++ b/guix/scripts/publish.scm
|
||||
@@ -47,6 +47,7 @@ (define-module (guix scripts publish)
|
||||
#:use-module (guix base32)
|
||||
#:use-module (guix base64)
|
||||
#:use-module (guix config)
|
||||
+ #:use-module (guix records)
|
||||
#:use-module (gcrypt hash)
|
||||
#:use-module (guix pki)
|
||||
#:use-module (gcrypt pk-crypto)
|
||||
@@ -306,8 +307,6 @@ (define* (store-item->recutils store-item
|
||||
(let ((url (encode-and-join-uri-path
|
||||
`(,@(split-and-decode-uri-path nar-path)
|
||||
,@(match compression
|
||||
- (($ <compression> 'none)
|
||||
- '())
|
||||
(($ <compression> type)
|
||||
(list (symbol->string type))))
|
||||
,(basename store-item)))))
|
||||
@@ -424,16 +423,13 @@ (define* (render-narinfo store request hash
|
||||
|
||||
(define* (nar-cache-file directory item
|
||||
#:key (compression %no-compression))
|
||||
- (string-append directory "/"
|
||||
+ (string-append directory "/nar/"
|
||||
(symbol->string (compression-type compression))
|
||||
- "/" (basename item) ".nar"))
|
||||
+ "/" (basename item)))
|
||||
|
||||
(define* (narinfo-cache-file directory item
|
||||
#:key (compression %no-compression))
|
||||
- (string-append directory "/"
|
||||
- (symbol->string (compression-type compression))
|
||||
- "/" (basename item)
|
||||
- ".narinfo"))
|
||||
+ (string-append directory "/" (string-take (basename item) 32) ".narinfo"))
|
||||
|
||||
(define (hash-part-mapping-cache-file directory hash)
|
||||
(string-append directory "/hashes/" hash))
|
||||
@@ -533,11 +529,9 @@ (define* (render-narinfo/cached store request hash
|
||||
requested using POOL."
|
||||
(define (delete-entry narinfo)
|
||||
;; Delete NARINFO and the corresponding nar from CACHE.
|
||||
- (let* ((nar (string-append (string-drop-right narinfo
|
||||
- (string-length ".narinfo"))
|
||||
- ".nar"))
|
||||
- (base (basename narinfo ".narinfo"))
|
||||
- (hash (string-take base (string-index base #\-)))
|
||||
+ (let* ((path (uri-decode (assoc-ref (call-with-input-file narinfo recutils->alist) "URL")))
|
||||
+ (nar (in-vicinity (dirname narinfo) path))
|
||||
+ (hash (basename narinfo ".narinfo"))
|
||||
(mapping (hash-part-mapping-cache-file cache hash)))
|
||||
(delete-file* narinfo)
|
||||
(delete-file* nar)
|
||||
@@ -1044,6 +1038,7 @@ (define (string->compression-type string)
|
||||
("gzip" 'gzip)
|
||||
("lzip" 'lzip)
|
||||
("zstd" 'zstd)
|
||||
+ ("none" 'none)
|
||||
(_ #f)))
|
||||
|
||||
(define (effective-compression requested-type compressions)
|
||||
diff --git a/tests/publish.scm b/tests/publish.scm
|
||||
index 3c80c50d515..52c6f6d10c4 100644
|
||||
--- a/tests/publish.scm
|
||||
+++ b/tests/publish.scm
|
||||
@@ -173,7 +173,7 @@ (define %gzip-magic-bytes
|
||||
(canonical-sexp->string
|
||||
(signed-string unsigned-info))))))
|
||||
(format #f "~aSignature: 1;~a;~a
|
||||
-URL: nar/~a
|
||||
+URL: nar/none/~a
|
||||
Compression: none
|
||||
FileSize: ~a\n"
|
||||
unsigned-info (gethostname) signature
|
||||
@@ -223,7 +223,7 @@ (define %gzip-magic-bytes
|
||||
(canonical-sexp->string
|
||||
(signed-string unsigned-info))))))
|
||||
(format #f "~aSignature: 1;~a;~a
|
||||
-URL: nar/~a
|
||||
+URL: nar/none/~a
|
||||
Compression: none
|
||||
FileSize: ~a~%"
|
||||
unsigned-info (gethostname) signature
|
||||
@@ -332,7 +332,7 @@ (define %gzip-magic-bytes
|
||||
(recutils->alist body)))))
|
||||
|
||||
(test-equal "/*.narinfo for a compressed file"
|
||||
- '("none" "nar") ;compression-less nar
|
||||
+ '("none" "nar/none") ;compression-less nar
|
||||
;; Assume 'guix publish -C' is already running on port 6799.
|
||||
(let* ((item (add-text-to-store %store "fake.tar.gz"
|
||||
"This is a fake compressed file."))
|
||||
@@ -378,7 +378,7 @@ (define %gzip-magic-bytes
|
||||
(test-equal "custom nar path"
|
||||
;; Serve nars at /foo/bar/chbouib instead of /nar.
|
||||
(list `(("StorePath" . ,%item)
|
||||
- ("URL" . ,(string-append "foo/bar/chbouib/" (basename %item)))
|
||||
+ ("URL" . ,(string-append "foo/bar/chbouib/none/" (basename %item)))
|
||||
("Compression" . "none"))
|
||||
200
|
||||
404)
|
||||
@@ -403,7 +403,7 @@ (define %gzip-magic-bytes
|
||||
(recutils->alist body))
|
||||
(response-code (http-get nar-url))
|
||||
(response-code
|
||||
- (http-get (string-append base "nar/" (basename %item))))))))
|
||||
+ (http-get (string-append base "nar/none/" (basename %item))))))))
|
||||
|
||||
(test-equal "/nar/ with properly encoded '+' sign"
|
||||
"Congrats!"
|
||||
@@ -479,10 +479,10 @@ (define %gzip-magic-bytes
|
||||
(part (store-path-hash-part %item))
|
||||
(url (string-append base part ".narinfo"))
|
||||
(nar-url (string-append base "nar/gzip/" (basename %item)))
|
||||
- (cached (string-append cache "/gzip/" (basename %item)
|
||||
+ (cached (string-append cache "/" part
|
||||
".narinfo"))
|
||||
- (nar (string-append cache "/gzip/"
|
||||
- (basename %item) ".nar"))
|
||||
+ (nar (string-append cache "/nar/gzip/"
|
||||
+ (basename %item)))
|
||||
(response (http-get url)))
|
||||
(and (= 404 (response-code response))
|
||||
|
||||
@@ -535,15 +535,15 @@ (define %gzip-magic-bytes
|
||||
(url (string-append base part ".narinfo"))
|
||||
(nar-url (cute string-append "nar/" <> "/"
|
||||
(basename %item)))
|
||||
- (cached (cute string-append cache "/" <> "/"
|
||||
- (basename %item) ".narinfo"))
|
||||
- (nar (cute string-append cache "/" <> "/"
|
||||
- (basename %item) ".nar"))
|
||||
+ (cached (string-append cache "/"
|
||||
+ part ".narinfo"))
|
||||
+ (nar (cute string-append cache "/nar/" <> "/"
|
||||
+ (basename %item)))
|
||||
(response (http-get url)))
|
||||
- (wait-for-file (cached "gzip"))
|
||||
+ (wait-for-file cached)
|
||||
(let* ((body (http-get-port url))
|
||||
(narinfo (recutils->alist body))
|
||||
- (uncompressed (string-append base "nar/"
|
||||
+ (uncompressed (string-append base "nar/none/"
|
||||
(basename %item))))
|
||||
(and (file-exists? (nar "gzip"))
|
||||
(file-exists? (nar "lzip"))
|
||||
@@ -576,7 +576,7 @@ (define %gzip-magic-bytes
|
||||
(list #t
|
||||
(* 42 3600) ;TTL on narinfo
|
||||
`(("StorePath" . ,item)
|
||||
- ("URL" . ,(string-append "nar/" (basename item)))
|
||||
+ ("URL" . ,(string-append "nar/none/" (basename item)))
|
||||
("Compression" . "none"))
|
||||
200 ;nar/…
|
||||
(* 42 3600) ;TTL on nar/…
|
||||
@@ -595,10 +595,10 @@ (define %gzip-magic-bytes
|
||||
(let* ((base "http://localhost:6796/")
|
||||
(part (store-path-hash-part item))
|
||||
(url (string-append base part ".narinfo"))
|
||||
- (cached (string-append cache "/none/"
|
||||
- (basename item) ".narinfo"))
|
||||
- (nar (string-append cache "/none/"
|
||||
- (basename item) ".nar"))
|
||||
+ (cached (string-append cache "/"
|
||||
+ part ".narinfo"))
|
||||
+ (nar (string-append cache "/nar/none/"
|
||||
+ (basename item)))
|
||||
(response (http-get url)))
|
||||
(and (= 404 (response-code response))
|
||||
|
||||
@@ -607,7 +607,7 @@ (define %gzip-magic-bytes
|
||||
(body (http-get-port url))
|
||||
(compressed (http-get (string-append base "nar/gzip/"
|
||||
(basename item))))
|
||||
- (uncompressed (http-get (string-append base "nar/"
|
||||
+ (uncompressed (http-get (string-append base "nar/none/"
|
||||
(basename item))))
|
||||
(narinfo (recutils->alist body)))
|
||||
(list (file-exists? nar)
|
||||
@@ -650,8 +650,8 @@ (define %gzip-magic-bytes
|
||||
(item (add-text-to-store %store "random" (random-text)))
|
||||
(part (store-path-hash-part item))
|
||||
(url (string-append base part ".narinfo"))
|
||||
- (cached (string-append cache "/gzip/"
|
||||
- (basename item)
|
||||
+ (cached (string-append cache "/"
|
||||
+ part
|
||||
".narinfo"))
|
||||
(response (http-get url)))
|
||||
(and (= 200 (response-code response)) ;we're below the threshold
|
||||
@@ -676,7 +676,7 @@ (define %gzip-magic-bytes
|
||||
(part (store-path-hash-part item))
|
||||
(narinfo (string-append base part ".narinfo"))
|
||||
(nar (string-append base "nar/gzip/" (basename item)))
|
||||
- (cached (string-append cache "/gzip/" (basename item)
|
||||
+ (cached (string-append cache "/" part
|
||||
".narinfo")))
|
||||
;; We're below the default cache bypass threshold, so NAR and NARINFO
|
||||
;; should immediately return 200. The NARINFO request should trigger
|
||||
@@ -712,7 +712,7 @@ (define %gzip-magic-bytes
|
||||
(part (store-path-hash-part item))
|
||||
(narinfo (string-append base part ".narinfo"))
|
||||
(nar (string-append base "nar/gzip/" (basename item)))
|
||||
- (cached (string-append cache "/gzip/" (basename item)
|
||||
+ (cached (string-append cache "/" part
|
||||
".narinfo")))
|
||||
;; The first response used to be 500 and to terminate the daemon
|
||||
;; connection as a side effect.
|
||||
|
||||
base-commit: 5dbab32115de3276f582bcb801fd9f88abe0d397
|
||||
--
|
||||
2.52.0
|
||||
|
||||
-86
@@ -1,86 +0,0 @@
|
||||
From e72cfa6d925a3e2fa216e6e5e91cd8e737edc5fe Mon Sep 17 00:00:00 2001
|
||||
From: Hilton Chain <hako@ultrarare.space>
|
||||
Date: Sun, 12 Apr 2026 21:59:49 +0800
|
||||
Subject: [PATCH] Revert "cli: put editor-*.jjdescription file in /tmp instead
|
||||
of .jj/repo/"
|
||||
|
||||
This reverts commit 146900a071153a32ae2764a3380726c08f1e14f6.
|
||||
---
|
||||
CHANGELOG.md | 3 ---
|
||||
cli/src/cli_util.rs | 4 +++-
|
||||
cli/tests/test_describe_command.rs | 8 ++++----
|
||||
3 files changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/CHANGELOG.md b/CHANGELOG.md
|
||||
index 76b291acf..27aa0226c 100644
|
||||
--- a/CHANGELOG.md
|
||||
+++ b/CHANGELOG.md
|
||||
@@ -1608,9 +1608,6 @@ Thanks to the people who made this release happen!
|
||||
|
||||
* `jj git push -c`/`--change` no longer moves existing local bookmarks.
|
||||
|
||||
-* The `editor-*.jjdescription` files passed to your editor by e.g. `jj describe`
|
||||
- are now written to your system's temporary directory instead of `.jj/repo/`.
|
||||
-
|
||||
### Deprecations
|
||||
|
||||
* `git.subprocess = false` has been deprecated, and the old `libgit2`
|
||||
diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs
|
||||
index 94681d0ee..8779fa31d 100644
|
||||
--- a/cli/src/cli_util.rs
|
||||
+++ b/cli/src/cli_util.rs
|
||||
@@ -1687,8 +1687,10 @@ to the current parents may contain changes from multiple commits.
|
||||
}
|
||||
|
||||
/// Loads text editor from the settings.
|
||||
+ ///
|
||||
+ /// Temporary files will be created in the repository directory.
|
||||
pub fn text_editor(&self) -> Result<TextEditor, ConfigGetError> {
|
||||
- TextEditor::from_settings(self.settings())
|
||||
+ Ok(TextEditor::from_settings(self.settings())?.with_temp_dir(self.repo_path()))
|
||||
}
|
||||
|
||||
pub fn resolve_single_op(&self, op_str: &str) -> Result<Operation, OpsetEvaluationError> {
|
||||
diff --git a/cli/tests/test_describe_command.rs b/cli/tests/test_describe_command.rs
|
||||
index d75d4fbab..195faafde 100644
|
||||
--- a/cli/tests/test_describe_command.rs
|
||||
+++ b/cli/tests/test_describe_command.rs
|
||||
@@ -152,7 +152,7 @@ fn test_describe() -> TestResult {
|
||||
insta::with_settings!({
|
||||
filters => [
|
||||
(r"\bEditor '[^']*'", "Editor '<redacted>'"),
|
||||
- (r"in .*(editor-)[^.]*(\.jjdescription)\b", "in <redacted>$1<redacted>$2"),
|
||||
+ (r"\b(editor-)[^.]*(\.jjdescription)\b", "$1<redacted>$2"),
|
||||
("exit code", "exit status"), // Windows
|
||||
],
|
||||
}, {
|
||||
@@ -160,7 +160,7 @@ fn test_describe() -> TestResult {
|
||||
------- stderr -------
|
||||
Error: Failed to edit description
|
||||
Caused by: Editor '<redacted>' exited with exit status: 1
|
||||
- Hint: Edited description is left in <redacted>editor-<redacted>.jjdescription
|
||||
+ Hint: Edited description is left in $TEST_ENV/repo/.jj/repo/editor-<redacted>.jjdescription
|
||||
[EOF]
|
||||
[exit status: 1]
|
||||
");
|
||||
@@ -496,7 +496,7 @@ fn test_describe_multiple_commits() -> TestResult {
|
||||
insta::with_settings!({
|
||||
filters => [
|
||||
(r"\bEditor '[^']*'", "Editor '<redacted>'"),
|
||||
- (r"in .*(editor-)[^.]*(\.jjdescription)\b", "in <redacted>$1<redacted>$2"),
|
||||
+ (r"\b(editor-)[^.]*(\.jjdescription)\b", "$1<redacted>$2"),
|
||||
("exit code", "exit status"), // Windows
|
||||
],
|
||||
}, {
|
||||
@@ -504,7 +504,7 @@ fn test_describe_multiple_commits() -> TestResult {
|
||||
------- stderr -------
|
||||
Error: Failed to edit description
|
||||
Caused by: Editor '<redacted>' exited with exit status: 1
|
||||
- Hint: Edited description is left in <redacted>editor-<redacted>.jjdescription
|
||||
+ Hint: Edited description is left in $TEST_ENV/repo/.jj/repo/editor-<redacted>.jjdescription
|
||||
[EOF]
|
||||
[exit status: 1]
|
||||
");
|
||||
--
|
||||
2.52.0
|
||||
|
||||
@@ -1,28 +1,47 @@
|
||||
From 06ab33a4317d41953ad167bfabd5b5ff4e001fee Mon Sep 17 00:00:00 2001
|
||||
From 1e845f9a5c5854ce6a0f5d66c4a8f997ec881a67 Mon Sep 17 00:00:00 2001
|
||||
From: Hilton Chain <hako@ultrarare.space>
|
||||
Date: Wed, 29 Oct 2025 18:58:27 +0800
|
||||
Date: Sat, 10 Oct 2026 09:17:00 +0800
|
||||
Subject: [PATCH] Set Guix System PATH for Tailscale SSH.
|
||||
|
||||
---
|
||||
ssh/tailssh/user.go | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
ssh/tailssh/user_unix.go | 2 ++
|
||||
version/distro/distro.go | 3 +++
|
||||
2 files changed, 5 insertions(+)
|
||||
|
||||
diff --git a/ssh/tailssh/user.go b/ssh/tailssh/user.go
|
||||
index ac92c762a..fccc5cbf5 100644
|
||||
--- a/ssh/tailssh/user.go
|
||||
+++ b/ssh/tailssh/user.go
|
||||
@@ -109,9 +109,9 @@ func defaultPathForUser(u *user.User) string {
|
||||
return defaultPathForUserOnNixOS(u)
|
||||
diff --git a/ssh/tailssh/user_unix.go b/ssh/tailssh/user_unix.go
|
||||
index d482b09ba..f68ebf82b 100644
|
||||
--- a/ssh/tailssh/user_unix.go
|
||||
+++ b/ssh/tailssh/user_unix.go
|
||||
@@ -102,6 +102,8 @@ func defaultPathForUser(u *userMeta) string {
|
||||
return "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
|
||||
case distro.NixOS:
|
||||
return defaultPathForUserOnNixOS(&u.User)
|
||||
+ case distro.Guix:
|
||||
+ return "/run/privileged/bin:/run/current-system/profile/sbin:/run/current-system/profile/bin"
|
||||
}
|
||||
if isRoot {
|
||||
- return "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
+ return "/run/privileged/bin:/run/current-system/profile/sbin:/run/current-system/profile/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
}
|
||||
- return "/usr/local/bin:/usr/bin:/bin"
|
||||
+ return "/run/privileged/bin:/run/current-system/profile/sbin:/run/current-system/profile/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
}
|
||||
return "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
diff --git a/version/distro/distro.go b/version/distro/distro.go
|
||||
index 5407f8dae..2a6312bf7 100644
|
||||
--- a/version/distro/distro.go
|
||||
+++ b/version/distro/distro.go
|
||||
@@ -34,6 +34,7 @@
|
||||
Alpine = Distro("alpine")
|
||||
UBNT = Distro("ubnt") // Ubiquiti Networks
|
||||
JetKVM = Distro("jetkvm")
|
||||
+ Guix = Distro("guix")
|
||||
)
|
||||
|
||||
func defaultPathForUserOnNixOS(u *user.User) string {
|
||||
var distro lazy.SyncValue[Distro]
|
||||
@@ -112,6 +113,8 @@ func linuxDistro() Distro {
|
||||
return Alpine
|
||||
case runtime.GOARCH == "arm" && isDeviceModel("JetKVM"):
|
||||
return JetKVM
|
||||
+ case have("/run/current-system/parameters"):
|
||||
+ return Guix
|
||||
}
|
||||
return ""
|
||||
}
|
||||
--
|
||||
2.51.0
|
||||
2.55.0
|
||||
|
||||
@@ -13,41 +13,3 @@
|
||||
#:use-module (guix build-system cargo)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages sqlite))
|
||||
|
||||
(define-public atuin
|
||||
(package
|
||||
(name "atuin")
|
||||
(version "18.12.1")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/atuinsh/atuin")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0gm7b4xzvks3fs0i6ijaajq47djr0ydfyac32c2liqdvikq0ncm2"))))
|
||||
(build-system cargo-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:tests? #f ;TODO.
|
||||
#:install-source? #f
|
||||
#:features
|
||||
''("client" "sync" "clipboard" "daemon")
|
||||
#:cargo-install-paths
|
||||
''("crates/atuin")
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-references
|
||||
(lambda _
|
||||
(substitute* (find-files "crates/atuin/src/shell")
|
||||
(("atuin (uuid|history|search)" all)
|
||||
(string-append #$output "/bin/" all))))))))
|
||||
(inputs (cons sqlite (rosenthal-cargo-inputs 'atuin)))
|
||||
(home-page "https://atuin.sh/")
|
||||
(synopsis "Sync, search and backup shell history")
|
||||
(description
|
||||
"Atuin replaces existing shell history with a SQLite database, and records
|
||||
additional context for commands. Additionally, it provides optional and fully
|
||||
encrypted synchronisation of history between machines, via an Atuin server.")
|
||||
(license license:expat)))
|
||||
@@ -0,0 +1,49 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages shellutils)
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix git-download)
|
||||
;; Guix build systems
|
||||
#:use-module (rosenthal build-system go-vendored)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages golang))
|
||||
|
||||
(define-public stinkpot
|
||||
(package
|
||||
(name "stinkpot")
|
||||
(version "0.1.0")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://tangled.org/oppi.li/stinkpot")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"1mnxjg3krvdgxclh4bd757p8wgvx57s9i8zyrppgwhcps1r2ifw2"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(list #:tests? #f ;no tests
|
||||
#:go go-1.27
|
||||
#:vendor-hash
|
||||
(base32 "1kqmw6c2h11wxx4a683k10rzrsydc1pbq5rp3d570nk8bl5c0lr1")
|
||||
#:install-source? #f
|
||||
#:import-path "."
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-references
|
||||
(lambda _
|
||||
(substitute* "main.go"
|
||||
(("stinkpot (add|search)" all)
|
||||
(string-append #$output "/bin/" all))))))))
|
||||
(home-page "https://tangled.org/oppi.li/stinkpot")
|
||||
(synopsis "Search shell history")
|
||||
(description
|
||||
"@command{stinkpot} is an sqlite backed shell-history searcher.")
|
||||
(license license:expat)))
|
||||
@@ -7,11 +7,3 @@
|
||||
#:use-module (rosenthal utils packages)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages rust-apps))
|
||||
|
||||
(define-public jujutsu/dolly
|
||||
(package
|
||||
(inherit
|
||||
(package-with-extra-patches jujutsu
|
||||
(rosenthal-patches
|
||||
"jujutsu-save-jjdescription-file-inside-repository.patch")))
|
||||
(name "jujutsu-dolly")))
|
||||
+109
-217
@@ -1,8 +1,10 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2022, 2025 Hilton Chain <hako@ultrarare.space>
|
||||
;;; Copyright © 2026 Maxim Cournoyer <maxim@guixotic.coop>
|
||||
|
||||
(define-module (rosenthal packages web)
|
||||
;; Utilities
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
@@ -15,18 +17,26 @@
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system cargo)
|
||||
#:use-module (guix build-system copy)
|
||||
#:use-module (guix build-system gnu)
|
||||
#:use-module (guix build-system go)
|
||||
#:use-module (rosenthal build-system go-vendored)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages golang)
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages jemalloc)
|
||||
#:use-module (gnu packages node)
|
||||
#:use-module (gnu packages sqlite)
|
||||
#:use-module (gnu packages ssh)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages web))
|
||||
|
||||
(define-public ai-robots-txt
|
||||
(package
|
||||
(name "ai-robots-txt")
|
||||
(version "1.45")
|
||||
(version "2.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -35,7 +45,7 @@
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0j2nwf6i2fhlhkcqfqnzyiy2x6m974s59yrcy5y4nar5lij6q10z"))
|
||||
"0ssi8zkl17nwbs03drc9pv9zakpid91yrl91v57s290ldjn7bnz5"))
|
||||
(modules '((guix build utils)))
|
||||
(snippet '(delete-file-recursively "code"))))
|
||||
(build-system copy-build-system)
|
||||
@@ -54,148 +64,13 @@
|
||||
website owners block unwanted AI crawlers from accessing their sites.")
|
||||
(license license:expat)))
|
||||
|
||||
(define-public anubis-anti-crawler
|
||||
(package
|
||||
(name "anubis-anti-crawler")
|
||||
(version "1.25.0")
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/TecharoHQ/anubis/releases/download/v"
|
||||
version "/anubis-src-vendor-npm-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0kqp5j0739lpdw55gx4bnnda1b90qlavcdlp8vh9bp014xx84yqj"))))
|
||||
(build-system go-build-system)
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system)) ;FIXME
|
||||
#:go go-1.26
|
||||
#:install-source? #f
|
||||
#:import-path "./cmd/anubis"
|
||||
#:build-flags
|
||||
#~(list (string-append
|
||||
"-ldflags="
|
||||
" -X github.com/TecharoHQ/anubis.Version="
|
||||
#$(package-version this-package)))
|
||||
#:modules
|
||||
'(((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(delete 'check)
|
||||
(add-after 'install 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(let ((cmd (in-vicinity #$output "bin/anubis")))
|
||||
(invoke cmd "--help")
|
||||
(invoke cmd "--version"))))))))
|
||||
(home-page "https://anubis.techaro.lol/")
|
||||
(synopsis "Proof-of-work check to stop crawlers")
|
||||
(description
|
||||
"Anubis checks incoming HTTP requests using one or more challenges in
|
||||
order to protect upstream resources from web crawlers.")
|
||||
(license license:expat)
|
||||
(properties '((upstream-name . "anubis")))))
|
||||
|
||||
(define-public caddy
|
||||
(package
|
||||
(name "caddy")
|
||||
(version "2.11.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/caddyserver/caddy")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"12r6pm6kw23bqa4gkkb85mj7zhw77j0j2w2m1cp28sb1x7rsm0a2"))))
|
||||
(build-system go-build-system)
|
||||
(arguments
|
||||
(list #:go go-1.26
|
||||
#:tests? (not (%current-target-system)) ;TODO: Run test suite.
|
||||
#:install-source? #f
|
||||
#:import-path
|
||||
(if (string=? "caddy" (package-name this-package))
|
||||
"./cmd/caddy"
|
||||
".")
|
||||
#:build-flags
|
||||
#~(list "-tags" "nobadger nomysql nopgx"
|
||||
(string-append
|
||||
"-ldflags="
|
||||
" -X github.com/caddyserver/caddy/v2.CustomVersion="
|
||||
#$(package-version this-package)))
|
||||
#:modules
|
||||
'((ice-9 match)
|
||||
((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)
|
||||
(copy-recursively
|
||||
#+(this-package-native-input "vendored-go-dependencies")
|
||||
"vendor")))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(add-after 'install 'install-extras
|
||||
(lambda _
|
||||
(let ((caddy
|
||||
(or (which "caddy")
|
||||
(in-vicinity #$output "bin/caddy"))))
|
||||
(invoke caddy "manpage" "--directory"
|
||||
(in-vicinity #$output "share/man/man8"))
|
||||
(map
|
||||
(match-lambda
|
||||
((shell . path)
|
||||
(let ((file (in-vicinity #$output path)))
|
||||
(mkdir-p (dirname file))
|
||||
(with-output-to-file file
|
||||
(lambda ()
|
||||
(invoke caddy "completion" shell))))))
|
||||
'(("bash" . "etc/bash_completion.d/caddy")
|
||||
("fish" . "share/fish/vendor_completions.d/caddy.fish")
|
||||
("zsh" . "share/zsh/site-functions/_caddy"))))))
|
||||
(delete 'check)
|
||||
(add-after 'install 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(let ((caddy (in-vicinity #$output "bin/caddy")))
|
||||
(invoke caddy "help")
|
||||
(invoke caddy "version"))))))))
|
||||
(native-inputs
|
||||
(list (origin
|
||||
(method (go-mod-vendor #:go go-1.26))
|
||||
(uri (package-source this-package))
|
||||
(file-name "vendored-go-dependencies")
|
||||
(sha256
|
||||
(base32
|
||||
"1raa53ry78zsxsp81psl60z5rbx9y36gdkayh7dmdlrb460iap6f")))))
|
||||
(home-page "https://caddyserver.com/")
|
||||
(synopsis "Extensible HTTP web server with automatic HTTPS")
|
||||
(description
|
||||
"Caddy is a web server designed for simplicity and ease of use. It is
|
||||
notable for its automatic HTTPS feature, which enables secure connections
|
||||
without requiring complex configuration. Caddy is built with a focus on
|
||||
performance and flexibility, making it suitable for a variety of applications,
|
||||
from serving static websites to running dynamic web applications.")
|
||||
(license license:asl2.0)))
|
||||
(define-deprecated/public-alias anubis-anti-crawler anubis-ai-firewall)
|
||||
|
||||
(define-public caddy/dolly
|
||||
(package
|
||||
(inherit caddy)
|
||||
(name "caddy-dolly")
|
||||
(version "2026.03.29-1")
|
||||
(version "2026.12.03")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
@@ -204,90 +79,107 @@ from serving static websites to running dynamic web applications.")
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"04klhf0plnzldn894c8z5g8v3bmh342pgaq97cslvh6cjm3dwisd"))))
|
||||
(native-inputs
|
||||
(modify-inputs native-inputs
|
||||
(replace "vendored-go-dependencies"
|
||||
(origin
|
||||
(method (go-mod-vendor #:go go-1.26))
|
||||
(uri (package-source this-package))
|
||||
(file-name "vendored-go-dependencies")
|
||||
(sha256
|
||||
(base32
|
||||
"0zjp5i2si8qkww8632rxhd4y1y39bycn111pydm70n02q3jwir27"))))))
|
||||
"1348g60fcyzjkbb61pw0rg4xmyydpbdx7bnij6hnpa0wlv1bjq4z"))))
|
||||
(build-system go-vendored-build-system)
|
||||
(arguments
|
||||
(substitute-keyword-arguments arguments
|
||||
((#:go _ #f) go-1.27)
|
||||
((#:import-path _ #f) ".")
|
||||
((#:vendor-hash _ #f)
|
||||
(base32 "0xkh4gdw3qadag3gbw4l674p5knvarmkx51365m25cfg2fv5kawf"))))
|
||||
(native-inputs '())
|
||||
(inputs '())
|
||||
(propagated-inputs '())
|
||||
(home-page "https://git.guix.moe/hako/caddy")
|
||||
(properties '((disable-updater? . #t)))))
|
||||
|
||||
;; https://codeberg.org/guix/guix/pulls/9006
|
||||
(define-public forgejo
|
||||
(package
|
||||
(name "forgejo")
|
||||
(version "14.0.4")
|
||||
;; TODO: Address npm dependencies and fetch from git.
|
||||
(source (origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://codeberg.org/forgejo/forgejo/releases/download/v"
|
||||
version "/forgejo-src-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0mjmns7yqhhkqc3jcg8bffs64zj4b52hy2v1lvr14pq162r6wcil"))))
|
||||
(build-system go-build-system)
|
||||
(version "16.0.6")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
;; XXX: We build from the release tarball for now, which includes all
|
||||
;; of the needed Go dependencies.
|
||||
;; TODO: "Unbundle" the index.js and index.css by building them with
|
||||
;; webpack. This cannot currently be done because of missing Node
|
||||
;; modules.
|
||||
(uri (string-append "https://codeberg.org/forgejo/forgejo/"
|
||||
"releases/download/v" version
|
||||
"/forgejo-src-" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
"0c56zxadj8rpn9xj7i3l97z2xh0w318vwrbxmb1nw071qh5krs8g"))))
|
||||
(build-system gnu-build-system)
|
||||
(outputs (list "out" "data"))
|
||||
(arguments
|
||||
(list #:tests? (not (%current-target-system)) ;TODO: Run test suite.
|
||||
#:go go-1.26
|
||||
#:install-source? #f
|
||||
#:import-path "."
|
||||
#:build-flags
|
||||
#~(list (string-append
|
||||
"-ldflags="
|
||||
" -X main.ReleaseVersion=" #$(package-version this-package)
|
||||
" -X main.Version=" #$(package-version this-package)
|
||||
" -X main.ForgejoVersion=" #$(package-version this-package)
|
||||
" -X forgejo.org/modules/setting.AppWorkPath=/var/lib/forgejo"
|
||||
" -X forgejo.org/modules/setting.CustomPath=" #$output "/etc/forgejo"
|
||||
" -X forgejo.org/modules/setting.CustomConf=/etc/forgejo/app.ini"))
|
||||
#:modules
|
||||
'(((guix build gnu-build-system) #:prefix gnu:)
|
||||
(guix build go-build-system)
|
||||
(guix build union)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(replace 'unpack
|
||||
(lambda args
|
||||
(unsetenv "GO111MODULE")
|
||||
(apply (assoc-ref gnu:%standard-phases 'unpack) args)))
|
||||
(replace 'install-license-files
|
||||
(assoc-ref gnu:%standard-phases 'install-license-files))
|
||||
(add-after 'install 'rename-binary
|
||||
(lambda _
|
||||
(rename-file (in-vicinity #$output "bin/forgejo.org")
|
||||
(in-vicinity #$output "bin/forgejo"))))
|
||||
(add-after 'install 'install-extras
|
||||
(lambda _
|
||||
(mkdir-p (in-vicinity #$output "/etc/forgejo"))
|
||||
(copy-file "custom/conf/app.example.ini"
|
||||
(in-vicinity #$output "etc/forgejo/app.ini"))
|
||||
(for-each
|
||||
(lambda (dir)
|
||||
(copy-recursively
|
||||
dir (string-append #$output "/etc/forgejo/" dir)))
|
||||
'("options" "public" "templates"))))
|
||||
(delete 'check)
|
||||
(add-after 'rename-binary 'check
|
||||
(lambda* (#:key tests? #:allow-other-keys)
|
||||
(when tests?
|
||||
(let ((forgejo (in-vicinity #$output "bin/forgejo")))
|
||||
(invoke forgejo "--help")
|
||||
(invoke forgejo "--version"))))))))
|
||||
(native-inputs (list git-minimal))
|
||||
(list
|
||||
#:test-target "test-backend" ;test-frontend requires npm modules
|
||||
#:make-flags #~(list "TAGS=sqlite sqlite_unlock_notify") ;sqlite support
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-paths
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "modules/git/hook_generate.go"
|
||||
(("/usr/bin/env")
|
||||
(search-input-file inputs "bin/env")))))
|
||||
(add-after 'unpack 'set-static-root-path
|
||||
(lambda _
|
||||
(substitute* "modules/setting/server.go"
|
||||
(("StaticRootPath = AppWorkPath")
|
||||
(format #f "StaticRootPath = ~s" #$output:data)))))
|
||||
(add-after 'unpack 'disable-problematic-tests
|
||||
(lambda _
|
||||
(for-each
|
||||
delete-file
|
||||
;; Theses tests require internet.
|
||||
'("modules/hcaptcha/hcaptcha_test.go"
|
||||
"modules/updatechecker/update_checker_test.go"
|
||||
"services/migrations/migrate_test.go"
|
||||
"services/migrations/allowlist/is_migrate_allowed_test.go"
|
||||
;; The 'TestGetDirectorySize' test expects 8037
|
||||
;; entries, finds 7597 for unknown reasons.
|
||||
"modules/repository/create_test.go"))))
|
||||
(replace 'configure
|
||||
(lambda _
|
||||
(setenv "CC" "gcc")
|
||||
(setenv "CGO_ENABLED" "1")
|
||||
(setenv "GOTOOLCHAIN" "local") ;use 'go' from Guix
|
||||
(setenv "HOME" (getcwd))
|
||||
(invoke "git" "init"))) ;for tests
|
||||
(add-after 'install 'post-install
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(rename-file "go/bin/forgejo.org" "go/bin/forgejo")
|
||||
(let ((forgejo (string-append #$output "/bin/forgejo")))
|
||||
(install-file "go/bin/forgejo" (dirname forgejo))
|
||||
(wrap-program forgejo
|
||||
`("PATH" prefix
|
||||
,(map (lambda (c)
|
||||
(dirname
|
||||
(search-input-file inputs
|
||||
(string-append "bin/" c))))
|
||||
'("git" "gzip" "sh" "ssh"))))
|
||||
(substitute* forgejo ;avoid stripping argv[0] in wrapper
|
||||
(("exec -a \"\\$\\{0##\\*/\\}\" ")
|
||||
"exec ")))
|
||||
;; Install data files.
|
||||
(copy-recursively "options"
|
||||
(string-append #$output:data "/options"))
|
||||
(copy-recursively "public"
|
||||
(string-append #$output:data "/public"))
|
||||
(copy-recursively "templates"
|
||||
(string-append #$output:data "/templates")))))))
|
||||
(native-inputs (list git go-1.26 openssh node sqlite))
|
||||
(inputs (list bash coreutils git gzip openssh))
|
||||
(home-page "https://forgejo.org/")
|
||||
(synopsis "Lightweight software forge")
|
||||
(synopsis "Self-hosted, lightweight software forge")
|
||||
(description
|
||||
"Forgejo is a self-hosted, lightweight software forge designed to
|
||||
facilitate collaborative software development. It is built to be easy to
|
||||
install and maintain, making it an ideal choice for teams and organizations
|
||||
looking for a reliable platform to manage their software projects.")
|
||||
(license license:gpl3+)
|
||||
(properties
|
||||
'((disable-updater? . #t)))))
|
||||
"Forgejo is a lightweight software forge that aims to be easy to self-host
|
||||
and maintain. It offers a rich web API for accessing its data. ALong the usual
|
||||
forge features such as issues and pull requests tracking, it also includes
|
||||
simple software project management features like roles, scopes, and time
|
||||
tracking to ease collaboration.")
|
||||
(license license:expat)
|
||||
(properties '((disable-updater? . #t)))))
|
||||
@@ -1,175 +1,94 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2025 Hilton Chain <hako@ultrarare.space>
|
||||
;;; Copyright © 2025-2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal packages wm)
|
||||
;; Utilities
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((guix licenses) #:prefix license:)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (rosenthal utils cargo)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix git-download)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system cargo)
|
||||
#:use-module (guix build-system copy)
|
||||
#:use-module (guix build-system meson)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages audio)
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (gnu packages calendar)
|
||||
#:use-module (gnu packages cpp)
|
||||
#:use-module (gnu packages crypto)
|
||||
#:use-module (gnu packages curl)
|
||||
#:use-module (gnu packages fontutils)
|
||||
#:use-module (gnu packages freedesktop)
|
||||
#:use-module (gnu packages gl)
|
||||
#:use-module (gnu packages glib)
|
||||
#:use-module (gnu packages gnome)
|
||||
#:use-module (gnu packages gtk)
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages hardware)
|
||||
#:use-module (gnu packages imagemagick)
|
||||
#:use-module (gnu packages image)
|
||||
#:use-module (gnu packages jemalloc)
|
||||
#:use-module (gnu packages linux)
|
||||
#:use-module (gnu packages llvm)
|
||||
#:use-module (gnu packages markup)
|
||||
#:use-module (gnu packages maths)
|
||||
#:use-module (gnu packages multiprecision)
|
||||
#:use-module (gnu packages pkg-config)
|
||||
#:use-module (gnu packages polkit)
|
||||
#:use-module (gnu packages python)
|
||||
#:use-module (gnu packages qt)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages wm)
|
||||
#:use-module (gnu packages xdisorg))
|
||||
#:use-module (gnu packages pulseaudio)
|
||||
#:use-module (gnu packages stb)
|
||||
#:use-module (gnu packages window-management)
|
||||
#:use-module (gnu packages xdisorg)
|
||||
#:use-module (gnu packages xml))
|
||||
|
||||
(define-public noctalia-shell
|
||||
(define-public noctalia-greeter
|
||||
(package
|
||||
(name "noctalia-shell")
|
||||
(version "4.7.7")
|
||||
(name "noctalia-greeter")
|
||||
(version "1.7.2")
|
||||
(source (origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/noctalia-dev/noctalia-shell")
|
||||
(url "https://github.com/noctalia-dev/noctalia-greeter")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32
|
||||
"0pchvsd89js4q7k10q621w3jqndv6raw6zy0px2b43ygh2kcpk22"))))
|
||||
(build-system copy-build-system)
|
||||
"04rbq6ld830grz5i3r7sr40fnh36ml6wf9vqpmxic1akwa9zff8y"))))
|
||||
(build-system meson-build-system)
|
||||
(arguments
|
||||
(list
|
||||
#:install-plan
|
||||
#~'(("." "etc/xdg/quickshell/noctalia-shell"))
|
||||
#:imported-modules
|
||||
`((guix build qt-utils)
|
||||
,@%copy-build-system-modules)
|
||||
#:modules
|
||||
'((srfi srfi-26)
|
||||
(guix build copy-build-system)
|
||||
(guix build qt-utils)
|
||||
(guix build utils))
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'patch-references
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(substitute* "Services/Power/IdleInhibitorService.qml"
|
||||
(("systemd-inhibit")
|
||||
(search-input-file inputs "bin/elogind-inhibit")))))
|
||||
(add-after 'unpack 'reduce-output-size
|
||||
(lambda _
|
||||
(delete-file-recursively "Assets/Screenshots")))
|
||||
(add-after 'install 'make-wrapper
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let ((script "noctalia-shell"))
|
||||
(with-output-to-file script
|
||||
(lambda ()
|
||||
(format #t "~
|
||||
#!~a
|
||||
exec ~a --config ~a/etc/xdg/quickshell/noctalia-shell \"$@\"~%"
|
||||
(search-input-file inputs "bin/sh")
|
||||
(search-input-file inputs "bin/quickshell")
|
||||
#$output)))
|
||||
(wrap-script script
|
||||
`("PATH"
|
||||
suffix
|
||||
,(map (compose dirname
|
||||
(cut search-input-file inputs <>))
|
||||
'("bin/bluetoothctl"
|
||||
"bin/brightnessctl"
|
||||
"bin/cliphist"
|
||||
"bin/convert"
|
||||
"bin/ddcutil"
|
||||
"bin/fastfetch"
|
||||
"bin/fc-list"
|
||||
"bin/find"
|
||||
"bin/getent"
|
||||
"bin/git"
|
||||
"bin/grep"
|
||||
"bin/khal"
|
||||
"bin/ls"
|
||||
"bin/nmcli"
|
||||
"bin/python3"
|
||||
"bin/sh"
|
||||
"bin/which"
|
||||
"bin/wl-paste"
|
||||
"bin/wlsunset"
|
||||
"bin/wtype"
|
||||
"bin/xdg-open"))))
|
||||
(chmod script #o555)
|
||||
(install-file script (in-vicinity #$output "bin")))))
|
||||
(add-after 'make-wrapper 'qt-wrap
|
||||
(lambda args
|
||||
(apply wrap-all-qt-programs
|
||||
#:qtbase #$(this-package-input "qtbase")
|
||||
args))))))
|
||||
(list #:build-type "release"
|
||||
#:phases
|
||||
#~(modify-phases %standard-phases
|
||||
(add-after 'unpack 'prepare-for-build
|
||||
(lambda _
|
||||
;; Adjust import paths for STB headers packaged in Guix.
|
||||
(substitute* (find-files "." "\\.cpp$|^meson\\.build$")
|
||||
(("\\bstb/stb_") "stb_"))
|
||||
;; Reproducibility.
|
||||
(substitute* "meson.build"
|
||||
(("'-march=native', '-mtune=native',") ""))
|
||||
;; Patch build-time references.
|
||||
(substitute* "tests/greeter_login_flow_test.py"
|
||||
(("/bin/sh") (which "sh"))))))))
|
||||
(native-inputs (list pkg-config wayland))
|
||||
(inputs
|
||||
(list bash-minimal
|
||||
bluez
|
||||
brightnessctl
|
||||
cliphist
|
||||
coreutils-minimal
|
||||
ddcutil
|
||||
elogind
|
||||
fastfetch-minimal
|
||||
findutils
|
||||
(list cairo
|
||||
fontconfig
|
||||
git-minimal
|
||||
glibc
|
||||
grep
|
||||
guile-3.0
|
||||
imagemagick
|
||||
khal
|
||||
network-manager
|
||||
noctalia-qs
|
||||
python-minimal
|
||||
qtbase
|
||||
qtmultimedia
|
||||
qtwayland
|
||||
which
|
||||
wl-clipboard
|
||||
wlsunset
|
||||
wtype
|
||||
xdg-utils))
|
||||
freetype
|
||||
glib
|
||||
harfbuzz
|
||||
jemalloc
|
||||
libjxl
|
||||
(librsvg-for-system)
|
||||
libwebp
|
||||
libxkbcommon
|
||||
libxml2
|
||||
mesa
|
||||
nlohmann-json
|
||||
pango
|
||||
stb-image-resize2
|
||||
tomlplusplus
|
||||
wayland
|
||||
wayland-protocols
|
||||
wlroots))
|
||||
(home-page "https://noctalia.dev/")
|
||||
(synopsis "Wayland desktop shell")
|
||||
(synopsis "Login greeter for greetd")
|
||||
(description
|
||||
"Noctalia is a minimal desktop shell designed for Wayland, built on the
|
||||
@code{quickshell} framework. It offers a customizable and clean user interface,
|
||||
supporting various Wayland compositors like @code{niri}, @code{hyprland}, and
|
||||
@code{sway}.")
|
||||
"Noctalia Greeter is a minimal login greeter for greetd that matches the
|
||||
look and feel of Noctalia Shell")
|
||||
(license license:expat)))
|
||||
|
||||
(define-public noctalia-qs
|
||||
(package
|
||||
(inherit quickshell)
|
||||
(name "noctalia-qs")
|
||||
(version "0.0.12")
|
||||
(source
|
||||
(origin
|
||||
(method git-fetch)
|
||||
(uri (git-reference
|
||||
(url "https://github.com/noctalia-dev/noctalia-qs")
|
||||
(commit (string-append "v" version))))
|
||||
(file-name (git-file-name name version))
|
||||
(sha256
|
||||
(base32 "0zbqq9qgdsk5r2y4hag5p6276f67pq2w9imihdirvgnx0kclzlpg"))))
|
||||
(inputs
|
||||
(modify-inputs inputs
|
||||
(prepend glib polkit)))
|
||||
(home-page "https://noctalia.dev/")
|
||||
(synopsis "QtQuick-based desktop shell toolkit (Noctalia fork)")))
|
||||
@@ -5,14 +5,112 @@
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils contract combinators)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils records)
|
||||
#:use-module (rosenthal utils packages)
|
||||
;; Guix System
|
||||
#:use-module (gnu system keyboard)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services base)
|
||||
#:use-module (gnu services dbus)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages bash)
|
||||
#:use-module (rosenthal packages admin)
|
||||
#:export (greetd-tuigreet-session))
|
||||
#:use-module (rosenthal packages wm)
|
||||
#:export (noctalia-greeter-configuration
|
||||
noctalia-greeter-service-type
|
||||
greetd-noctalia-greeter-session
|
||||
|
||||
greetd-tuigreet-session))
|
||||
|
||||
|
||||
;;;
|
||||
;;; noctalia-greeter
|
||||
;;;
|
||||
|
||||
(define-record-type/dolly <noctalia-greeter-configuration>
|
||||
noctalia-greeter-configuration
|
||||
make-noctalia-greeter-configuration
|
||||
noctalia-greeter-configuration?
|
||||
this-noctalia-greeter-configuration
|
||||
(package
|
||||
noctalia-greeter-configuration-package
|
||||
(default noctalia-greeter)
|
||||
(contract file-like?)
|
||||
(documentation
|
||||
"Noctalia greeter package."))
|
||||
(keyboard-layout
|
||||
noctalia-greeter-configuration-keyboard-layout
|
||||
(default #f)
|
||||
(contract (or/c #f keyboard-layout?))
|
||||
(documentation
|
||||
"Keyboard layout to use in a Noctalia greeter session.")))
|
||||
|
||||
(define (noctalia-greeter-activation-service _)
|
||||
#~(mkdir-p/perms "/var/lib/noctalia-greeter" (getpwnam "greeter") #o750))
|
||||
|
||||
(define noctalia-greeter-special-files-service
|
||||
(match-record-lambda/dolly <noctalia-greeter-configuration>
|
||||
(keyboard-layout)
|
||||
(if keyboard-layout
|
||||
(let* ((name (keyboard-layout-name keyboard-layout))
|
||||
(variant (keyboard-layout-variant keyboard-layout))
|
||||
(options (keyboard-layout-options keyboard-layout))
|
||||
(layout
|
||||
`(("layout" . ,name)
|
||||
,@(if variant
|
||||
`(("variant" . ,variant))
|
||||
'())
|
||||
,@(if (null? options)
|
||||
'()
|
||||
`(("options" . ,(string-join options ",")))))))
|
||||
`(("/var/lib/noctalia-greeter/greeter.toml"
|
||||
,(toml-file "greeter.toml"
|
||||
`(("keyboard" . ,layout))))))
|
||||
'())))
|
||||
|
||||
(define noctalia-greeter-service-type
|
||||
(service-type
|
||||
(name 'noctalia-greeter)
|
||||
(extensions
|
||||
(list (service-extension activation-service-type
|
||||
noctalia-greeter-activation-service)
|
||||
(service-extension special-files-service-type
|
||||
noctalia-greeter-special-files-service)
|
||||
(service-extension polkit-service-type
|
||||
(compose list noctalia-greeter-configuration-package))
|
||||
(service-extension profile-service-type
|
||||
(compose list noctalia-greeter-configuration-package))))
|
||||
(default-value (noctalia-greeter-configuration))
|
||||
(description "Set up environment for @command{noctalia-greeter-session}.")))
|
||||
|
||||
(define-record-type/dolly <greetd-noctalia-greeter-session>
|
||||
greetd-noctalia-greeter-session
|
||||
make-greetd-noctalia-greeter-session
|
||||
greetd-noctalia-greeter-session?
|
||||
this-greetd-noctalia-greeter-session
|
||||
(noctalia-greeter-session
|
||||
greetd-noctalia-greeter-session-noctalia-greeter-session
|
||||
(default (file-append noctalia-greeter "/bin/noctalia-greeter-session"))
|
||||
(contract (or/c file-like? string?))
|
||||
(documentation
|
||||
"@command{noctalia-greeter-session} executable file.")))
|
||||
|
||||
(define-gexp-compiler (greetd-noctalia-greeter-session-compiler
|
||||
(session <greetd-noctalia-greeter-session>)
|
||||
system target)
|
||||
(match-record/dolly session <greetd-noctalia-greeter-session> (noctalia-greeter-session)
|
||||
(lower-object
|
||||
(program-file "noctalia-greeter-wrapper"
|
||||
#~(execl #$noctalia-greeter-session #$noctalia-greeter-session)))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; tuigreet
|
||||
;;;
|
||||
|
||||
(define-record-type* <greetd-tuigreet-session>
|
||||
greetd-tuigreet-session make-greetd-tuigreet-session
|
||||
|
||||
@@ -274,14 +274,17 @@ headers. This can expose sensitive information in your logs.")
|
||||
(file-like wakapi-bin)
|
||||
"The wakapi package.")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"Association list of Wakapi configurations.")
|
||||
(no-serialization))
|
||||
|
||||
(define home-wakapi-shepherd-service
|
||||
(match-record-lambda <home-wakapi-configuration>
|
||||
(wakapi config)
|
||||
(let ((config-file (yaml-file "wakapi.yaml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "wakapi.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(documentation "Run wakapi.")
|
||||
(provision '(wakapi))
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages fcitx5)
|
||||
#:use-module (gnu packages fonts)
|
||||
#:autoload (gnu packages glib) (glib)
|
||||
#:use-module (gnu packages gnome)
|
||||
#:use-module (gnu packages guile)
|
||||
#:use-module (gnu packages hardware)
|
||||
@@ -46,7 +47,7 @@
|
||||
#:use-module (gnu packages networking)
|
||||
#:use-module (gnu packages polkit)
|
||||
#:use-module (gnu packages qt)
|
||||
#:use-module (gnu packages wm)
|
||||
#:use-module (gnu packages window-management)
|
||||
#:use-module (gnu packages xorg)
|
||||
#:use-module (rosenthal packages authentication)
|
||||
#:use-module (rosenthal packages wm)
|
||||
@@ -65,9 +66,6 @@
|
||||
home-niri-configuration
|
||||
home-niri-service-type
|
||||
|
||||
home-noctalia-shell-configuration
|
||||
home-noctalia-shell-service-type
|
||||
|
||||
home-bb-auth-service-type
|
||||
home-polkit-gnome-service-type
|
||||
|
||||
@@ -192,7 +190,7 @@
|
||||
"xim?"))))))
|
||||
|
||||
;; https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland
|
||||
(define %home-fcitx5-environment-variables
|
||||
(define home-fcitx5-environment-variables-service
|
||||
(match-record-lambda <home-fcitx5-configuration>
|
||||
(wayland-frontend?)
|
||||
`(("XMODIFIERS" . "@im=fcitx")
|
||||
@@ -201,29 +199,34 @@
|
||||
'(("QT_IM_MODULES" . "wayland;fcitx"))
|
||||
'(("GTK_IM_MODULE" . "fcitx"))))))
|
||||
|
||||
(define home-fcitx5-gtk2
|
||||
(define home-fcitx5-gtk2-service
|
||||
(match-record-lambda <home-fcitx5-configuration>
|
||||
(wayland-frontend?)
|
||||
(if wayland-frontend?
|
||||
`(("gtk-im-module" . ,(format #f "~s" "fcitx")))
|
||||
'())))
|
||||
|
||||
(define home-fcitx5-gtk3
|
||||
(define home-fcitx5-gtk3-service
|
||||
(match-record-lambda <home-fcitx5-configuration>
|
||||
(wayland-frontend?)
|
||||
(if wayland-frontend?
|
||||
`(("gtk-im-module" . "fcitx"))
|
||||
'())))
|
||||
|
||||
(define %home-fcitx5-profile
|
||||
(define home-fcitx5-profile-service
|
||||
(match-record-lambda <home-fcitx5-configuration>
|
||||
(fcitx5 utilities themes input-method-editors wayland-frontend?)
|
||||
(append (list fcitx5 fcitx5-gtk fcitx5-qt)
|
||||
(if wayland-frontend?
|
||||
'()
|
||||
(list `(,fcitx5-gtk "gtk2")
|
||||
`(,fcitx5-gtk "gtk3")
|
||||
fcitx5-gtk4))
|
||||
utilities
|
||||
themes
|
||||
input-method-editors)))
|
||||
|
||||
(define %home-fcitx5-shepherd
|
||||
(define home-fcitx5-shepherd-service
|
||||
(match-record-lambda <home-fcitx5-configuration>
|
||||
(fcitx5)
|
||||
(list (shepherd-service
|
||||
@@ -244,17 +247,17 @@
|
||||
(name 'home-fcitx5)
|
||||
(extensions
|
||||
(list (service-extension home-environment-variables-service-type
|
||||
%home-fcitx5-environment-variables)
|
||||
home-fcitx5-environment-variables-service)
|
||||
(service-extension home-gtk2-service-type
|
||||
home-fcitx5-gtk2)
|
||||
home-fcitx5-gtk2-service)
|
||||
(service-extension home-gtk3-service-type
|
||||
home-fcitx5-gtk3)
|
||||
home-fcitx5-gtk3-service)
|
||||
(service-extension home-gtk4-service-type
|
||||
home-fcitx5-gtk3)
|
||||
home-fcitx5-gtk3-service)
|
||||
(service-extension home-profile-service-type
|
||||
%home-fcitx5-profile)
|
||||
home-fcitx5-profile-service)
|
||||
(service-extension home-shepherd-service-type
|
||||
%home-fcitx5-shepherd)))
|
||||
home-fcitx5-shepherd-service)))
|
||||
(default-value (home-fcitx5-configuration))
|
||||
(description "Run fcitx5, an input method framework.")))
|
||||
|
||||
@@ -351,22 +354,36 @@
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-niri-configuration
|
||||
(niri
|
||||
(file-like niri)
|
||||
"")
|
||||
(config
|
||||
maybe-file-like
|
||||
""))
|
||||
|
||||
(define (validated-niri-config niri file)
|
||||
(computed-file "niri.kdl"
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(invoke #+(file-append niri "/bin/niri") "validate"
|
||||
"--config" #$file)
|
||||
(copy-file #$file #$output)))))
|
||||
|
||||
(define %home-niri-xdg-config
|
||||
(match-record-lambda <home-niri-configuration>
|
||||
(config)
|
||||
(niri config)
|
||||
(if (maybe-value-set? config)
|
||||
`(("niri/config.kdl" ,config))
|
||||
`(("niri/config.kdl" ,(validated-niri-config niri config)))
|
||||
'())))
|
||||
|
||||
(define home-niri-service-type
|
||||
(service-type
|
||||
(name 'home-niri)
|
||||
(extensions
|
||||
(list (service-extension home-xdg-configuration-files-service-type
|
||||
(list (service-extension home-profile-service-type
|
||||
(compose list home-niri-configuration-niri))
|
||||
(service-extension home-xdg-configuration-files-service-type
|
||||
%home-niri-xdg-config)))
|
||||
(default-value (home-niri-configuration))
|
||||
(description
|
||||
@@ -378,54 +395,11 @@ compositor.")))
|
||||
;;; Noctalia
|
||||
;;;
|
||||
|
||||
(define-configuration/no-serialization home-noctalia-shell-configuration
|
||||
(noctalia-shell
|
||||
(file-like noctalia-shell)
|
||||
"File-like object to provide @command{/bin/noctalia-shell}."))
|
||||
(define-deprecated/public-alias home-noctalia-shell-configuration
|
||||
(@ (rosenthal home services desktop) home-noctalia-configuration))
|
||||
|
||||
;; Create ~/.config/noctalia directory, otherwise Noctalia shell won't show up
|
||||
;; on initial startup.
|
||||
(define (%home-noctalia-shell-activation _)
|
||||
(with-imported-modules (source-module-closure '((guix build utils)))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((xdg-config-home
|
||||
(or (getenv "XDG_CONFIG_HOME")
|
||||
(in-vicinity (getenv "HOME") ".config"))))
|
||||
(mkdir-p (in-vicinity xdg-config-home "noctalia"))))))
|
||||
|
||||
(define %home-noctalia-shell-shepherd
|
||||
(match-record-lambda <home-noctalia-shell-configuration>
|
||||
(noctalia-shell)
|
||||
(list (shepherd-service
|
||||
(documentation "Start noctalia-shell.")
|
||||
(provision '(noctalia-shell))
|
||||
(requirement '(dbus graphical-session))
|
||||
(modules '((shepherd support)))
|
||||
(start
|
||||
#~(lambda args
|
||||
((make-forkexec-constructor
|
||||
(list #$(file-append noctalia-shell "/bin/noctalia-shell"))
|
||||
#:log-file (in-vicinity %user-log-dir "noctalia-shell.log")
|
||||
;; Inherit graphical session environment.
|
||||
#:environment-variables (environ))
|
||||
args)))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define home-noctalia-shell-service-type
|
||||
(service-type
|
||||
(name 'home-noctalia-shell)
|
||||
(extensions
|
||||
(list (service-extension home-profile-service-type
|
||||
(compose list home-noctalia-shell-configuration-noctalia-shell))
|
||||
(service-extension home-activation-service-type
|
||||
%home-noctalia-shell-activation)
|
||||
(service-extension home-shepherd-service-type
|
||||
%home-noctalia-shell-shepherd)
|
||||
(service-extension home-graphical-session-service-type
|
||||
(const 'wayland))))
|
||||
(default-value (home-noctalia-shell-configuration))
|
||||
(description "")))
|
||||
(define-deprecated/public-alias home-noctalia-shell-service-type
|
||||
(@ (rosenthal home services desktop) home-noctalia-service-type))
|
||||
|
||||
|
||||
;;;
|
||||
@@ -563,7 +537,7 @@ compositor.")))
|
||||
(string "Adwaita")
|
||||
"")
|
||||
(font
|
||||
(string "Sans")
|
||||
(string "sans-serif 11")
|
||||
"")
|
||||
(cursor-theme
|
||||
(string "Adwaita")
|
||||
@@ -575,6 +549,14 @@ compositor.")))
|
||||
(string "Default")
|
||||
""))
|
||||
|
||||
(define home-theme-activation-service
|
||||
(match-record-lambda <home-theme-configuration>
|
||||
(icon-theme cursor-theme font)
|
||||
#~(let ((gsettings #$(file-append (gexp-input glib "bin") "/bin/gsettings")))
|
||||
(system* gsettings "set" "org.gnome.desktop.interface" "icon-theme" #$icon-theme)
|
||||
(system* gsettings "set" "org.gnome.desktop.interface" "cursor-theme" #$cursor-theme)
|
||||
(system* gsettings "set" "org.gnome.desktop.interface" "font-name" #$font))))
|
||||
|
||||
(define (%home-theme-environment-variables _)
|
||||
'(("QT_QPA_PLATFORMTHEME" . "gtk3")
|
||||
("QT_WAYLAND_DECORATION" . "adwaita")))
|
||||
@@ -583,7 +565,6 @@ compositor.")))
|
||||
(match-record-lambda <home-theme-configuration>
|
||||
(packages)
|
||||
(cons* adwaita-icon-theme
|
||||
hicolor-icon-theme
|
||||
packages)))
|
||||
|
||||
(define home-theme-icons-config
|
||||
@@ -591,7 +572,7 @@ compositor.")))
|
||||
(icon-theme)
|
||||
(ini-file "index.theme"
|
||||
#~'(("icon theme"
|
||||
("Inherits" . #$icon-theme))))))
|
||||
. (("Inherits" . #$icon-theme)))))))
|
||||
|
||||
(define (home-theme-files config)
|
||||
`((".icons/default/index.theme"
|
||||
@@ -621,11 +602,22 @@ compositor.")))
|
||||
("gtk-cursor-theme-size" . ,cursor-size)
|
||||
("gtk-key-theme-name" . ,key-theme))))
|
||||
|
||||
(define home-theme-gtk4
|
||||
(match-record-lambda <home-theme-configuration>
|
||||
(icon-theme font cursor-theme cursor-size key-theme)
|
||||
`(("gtk-theme-name" . "Adwaita")
|
||||
("gtk-icon-theme-name" . ,icon-theme)
|
||||
("gtk-font-name" . ,font)
|
||||
("gtk-cursor-theme-name" . ,cursor-theme)
|
||||
("gtk-cursor-theme-size" . ,cursor-size))))
|
||||
|
||||
(define home-theme-service-type
|
||||
(service-type
|
||||
(name 'home-theme)
|
||||
(extensions
|
||||
(list (service-extension home-environment-variables-service-type
|
||||
(list (service-extension home-activation-service-type
|
||||
home-theme-activation-service)
|
||||
(service-extension home-environment-variables-service-type
|
||||
%home-theme-environment-variables)
|
||||
(service-extension home-profile-service-type
|
||||
%home-theme-profile)
|
||||
@@ -638,7 +630,7 @@ compositor.")))
|
||||
(service-extension home-gtk3-service-type
|
||||
home-theme-gtk3)
|
||||
(service-extension home-gtk4-service-type
|
||||
home-theme-gtk3)))
|
||||
home-theme-gtk4)))
|
||||
(default-value (home-theme-configuration))
|
||||
(description "Set up desktop themes.")))
|
||||
|
||||
@@ -705,15 +697,6 @@ compositor.")))
|
||||
(define %rosenthal-skeletons
|
||||
`((".config/emacs/init.el"
|
||||
,(local-file "../examples/emacs/init.el"))
|
||||
(".config/emacs/init-fonts.el"
|
||||
,(local-file "../examples/emacs/init-fonts.el"))
|
||||
(".config/emacs/init-interface.el"
|
||||
,(local-file "../examples/emacs/init-interface.el"))
|
||||
(".config/emacs/init-editing.el"
|
||||
,(local-file "../examples/emacs/init-editing.el"))
|
||||
(".config/emacs/init-miscellaneous.el"
|
||||
,(local-file "../examples/emacs/init-miscellaneous.el"))
|
||||
|
||||
(".config/fcitx5/config"
|
||||
,(local-file "../examples/dot-config/fcitx5/config"))
|
||||
(".config/htop/htoprc"
|
||||
@@ -726,18 +709,12 @@ compositor.")))
|
||||
,@(default-skeletons)))
|
||||
|
||||
(define %rosenthal-skeletons-installer
|
||||
`((".config/noctalia/settings.json"
|
||||
,(local-file "../examples/dot-config/noctalia/settings.json"))
|
||||
`((".local/state/noctalia/.setup-complete"
|
||||
,(plain-file "empty" ""))
|
||||
(".local/state/noctalia/settings.toml"
|
||||
,(local-file "../examples/dot-config/noctalia/settings.toml"))
|
||||
(".config/wezterm/wezterm.lua"
|
||||
,(local-file "../examples/dot-config/wezterm/wezterm.lua"))
|
||||
;; Prevent Noctalia shell initial screen.
|
||||
(".cache/noctalia/shell-state.json"
|
||||
,(json-file "noctalia-shell-state.json"
|
||||
#~'(("changelogState"
|
||||
("lastSeenVersion"
|
||||
. #$(string-append "v" (package-version noctalia-shell))))
|
||||
("telemetry"
|
||||
("instanceId" . "")))))
|
||||
,@%rosenthal-skeletons))
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils predicates)
|
||||
;; Guix System
|
||||
#:use-module (gnu system accounts)
|
||||
#:use-module (gnu system shadow)
|
||||
@@ -19,14 +20,14 @@
|
||||
#:export (gamemode-service-type
|
||||
gamemode-configuration))
|
||||
|
||||
(define-maybe gexp)
|
||||
(define-maybe file-object-or-file-config)
|
||||
|
||||
(define-configuration/no-serialization gamemode-configuration
|
||||
(gamemode
|
||||
(file-like gamemode)
|
||||
"@code{gamemode} package to use.")
|
||||
(config
|
||||
maybe-gexp
|
||||
maybe-file-object-or-file-config
|
||||
""))
|
||||
|
||||
(define (gamemode-account-service config)
|
||||
@@ -39,7 +40,9 @@
|
||||
(gamemode config)
|
||||
`(("gamemode.ini"
|
||||
,(if (maybe-value-set? config)
|
||||
(ini-file "gamemode.ini" config)
|
||||
(if (file-config? config)
|
||||
(ini-file "gamemode.ini" config)
|
||||
config)
|
||||
(file-append (package-source gamemode) "/example/gamemode.ini")))
|
||||
("security/limits.d/10-gamemode.conf"
|
||||
,(file-append gamemode "/etc/security/limits.d/10-gamemode.conf")))))
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils predicates)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services admin)
|
||||
@@ -91,7 +92,7 @@
|
||||
(file-like goimapnotify)
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(wait
|
||||
(integer 1)
|
||||
@@ -109,7 +110,10 @@
|
||||
(define home-goimapnotify-shepherd
|
||||
(match-record-lambda <home-goimapnotify-configuration>
|
||||
(goimapnotify config wait shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file (yaml-file "goimapnotify.yaml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "goimapnotify.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement shepherd-requirement)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils predicates)
|
||||
;; Guix System
|
||||
#:use-module (gnu system shadow)
|
||||
@@ -34,7 +35,7 @@
|
||||
(string "http://localhost:8008")
|
||||
"")
|
||||
(config
|
||||
file-like
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -69,22 +70,26 @@
|
||||
(define heisenbridge-shepherd
|
||||
(match-record-lambda <heisenbridge-configuration>
|
||||
(heisenbridge config homeserver shepherd-provision shepherd-requirement auto-start?)
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(user-processes networking ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append heisenbridge "/bin/heisenbridge")
|
||||
"--config" #$config #$homeserver)
|
||||
#:user "heisenbridge"
|
||||
#:group "heisenbridge"
|
||||
#:environment-variables
|
||||
'("PATH=/run/current-system/profile/bin"
|
||||
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?)
|
||||
(actions (list (shepherd-configuration-action config)))))))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "heisenbridge.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(user-processes networking ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append heisenbridge "/bin/heisenbridge")
|
||||
"--config" #$config-file #$homeserver)
|
||||
#:user "heisenbridge"
|
||||
#:group "heisenbridge"
|
||||
#:environment-variables
|
||||
'("PATH=/run/current-system/profile/bin"
|
||||
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?)
|
||||
(actions (list (shepherd-configuration-action config-file))))))))
|
||||
|
||||
(define heisenbridge-service-type
|
||||
(service-type
|
||||
@@ -106,7 +111,7 @@
|
||||
(file-like mautrix-telegram)
|
||||
"")
|
||||
(config
|
||||
file-like
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -153,20 +158,24 @@
|
||||
(define mautrix-telegram-shepherd
|
||||
(match-record-lambda <mautrix-telegram-configuration>
|
||||
(mautrix-telegram config shepherd-provision shepherd-requirement auto-start?)
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement
|
||||
`(user-processes networking postgresql ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append mautrix-telegram "/bin/mautrix-telegram")
|
||||
"--no-update" "--config" #$config)
|
||||
#:user "mautrix-telegram"
|
||||
#:group "mautrix-telegram"
|
||||
#:directory "/var/lib/mautrix-telegram"))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?)
|
||||
(actions (list (shepherd-configuration-action config)))))))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "mautrix-telegram.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement
|
||||
`(user-processes networking postgresql ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append mautrix-telegram "/bin/mautrix-telegram")
|
||||
"--no-update" "--config" #$config-file)
|
||||
#:user "mautrix-telegram"
|
||||
#:group "mautrix-telegram"
|
||||
#:directory "/var/lib/mautrix-telegram"))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?)
|
||||
(actions (list (shepherd-configuration-action config-file))))))))
|
||||
|
||||
(define mautrix-telegram-service-type
|
||||
(service-type
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
(file-like grafana-bin)
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(postgresql-password-file
|
||||
string
|
||||
@@ -157,7 +157,10 @@
|
||||
(define grafana-shepherd
|
||||
(match-record-lambda <grafana-configuration>
|
||||
(grafana config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file (ini-file "grafana.ini" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(ini-file "grafana.ini" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback postgresql user-processes
|
||||
@@ -197,7 +200,7 @@
|
||||
(file-like loki-bin)
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -244,7 +247,10 @@
|
||||
(define loki-shepherd
|
||||
(match-record-lambda <loki-configuration>
|
||||
(loki config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file (yaml-file "loki.yaml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "loki.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback user-processes ,@shepherd-requirement))
|
||||
@@ -281,7 +287,7 @@
|
||||
(file-like mimir-bin)
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -328,7 +334,10 @@
|
||||
(define mimir-shepherd
|
||||
(match-record-lambda <mimir-configuration>
|
||||
(mimir config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file (yaml-file "mimir.yaml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "mimir.yaml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback user-processes ,@shepherd-requirement))
|
||||
@@ -368,7 +377,7 @@
|
||||
(string "0.0.0.0:9090")
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -415,7 +424,10 @@
|
||||
(define prometheus-shepherd
|
||||
(match-record-lambda <prometheus-configuration>
|
||||
(prometheus listen-address config shepherd-provision shepherd-requirement auto-start?)
|
||||
(let ((config-file (yaml-file "prometheus.yml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "prometheus.yml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(loopback user-processes ,@shepherd-requirement))
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
;; Utilities
|
||||
#:use-module (guix diagnostics)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix i18n)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils predicates)
|
||||
;; Guix System
|
||||
@@ -91,12 +93,18 @@
|
||||
;;; sing-box
|
||||
;;;
|
||||
|
||||
(define-maybe file-object)
|
||||
(define-maybe string)
|
||||
|
||||
(define-configuration/no-serialization sing-box-configuration
|
||||
(sing-box
|
||||
(file-like sing-box)
|
||||
"")
|
||||
(config-file
|
||||
file-object
|
||||
maybe-file-object
|
||||
"")
|
||||
(config-directory
|
||||
maybe-string
|
||||
"")
|
||||
(data-directory
|
||||
(string "/var/lib/sing-box")
|
||||
@@ -136,21 +144,33 @@
|
||||
|
||||
(define sing-box-shepherd-service
|
||||
(match-record-lambda <sing-box-configuration>
|
||||
(sing-box data-directory config-file
|
||||
(sing-box data-directory config-file config-directory
|
||||
shepherd-provision shepherd-requirement log-file auto-start?)
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(user-processes ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append sing-box "/bin/sing-box")
|
||||
"--config" #$config-file
|
||||
"--directory" #$data-directory
|
||||
"--disable-color"
|
||||
"run")
|
||||
#:log-file #$log-file))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?)))))
|
||||
(let ((config-file-set? (maybe-value-set? config-file))
|
||||
(config-dir-set? (maybe-value-set? config-directory)))
|
||||
(when (eqv? config-file-set? config-dir-set?)
|
||||
(leave (G_ "'~a': exactly one of '~a' or '~a' must be set~%")
|
||||
"sing-box-configuration"
|
||||
"config-file"
|
||||
"config-directory"))
|
||||
(list (shepherd-service
|
||||
(provision shepherd-provision)
|
||||
(requirement `(user-processes ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(file-append sing-box "/bin/sing-box")
|
||||
#$@(if config-file-set?
|
||||
(list "--config" config-file)
|
||||
'())
|
||||
#$@(if config-dir-set?
|
||||
(list "--config-directory" config-directory)
|
||||
'())
|
||||
"--directory" #$data-directory
|
||||
"--disable-color"
|
||||
"run")
|
||||
#:log-file #$log-file))
|
||||
(stop #~(make-kill-destructor))
|
||||
(auto-start? auto-start?))))))
|
||||
|
||||
(define sing-box-service-type
|
||||
(service-type
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal services nix)
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
;; Guix System
|
||||
#:use-module (gnu system pam)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services shepherd)
|
||||
;; Guix Home - services
|
||||
#:use-module (gnu home services)
|
||||
#:use-module (gnu home services shells)
|
||||
#:use-module (gnu home services shepherd)
|
||||
;; Guix packages
|
||||
#:autoload (gnu packages package-management) (guix)
|
||||
#:export (nix-search-paths-service-type
|
||||
home-nix-search-paths-service-type))
|
||||
|
||||
(define (nix-search-paths-activation config)
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(mkdir-p (dirname #$config)))))
|
||||
|
||||
(define (nix-search-paths-environment-extension config)
|
||||
`(("LOCALE_ARCHIVE" . ,(in-vicinity config "lib/locale/locale-archive"))))
|
||||
|
||||
(define* (nix-search-paths-shepherd-extension #:key home?)
|
||||
(lambda (config)
|
||||
(list (shepherd-service
|
||||
(documentation
|
||||
"Build Nix profile and symlink it to the specified path.")
|
||||
(requirement
|
||||
(if home?
|
||||
'()
|
||||
'(user-processes nix-daemon networking)))
|
||||
(provision '(build-nix-profile))
|
||||
(one-shot? #t)
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$(if home?
|
||||
"build-nix-profile"
|
||||
"/run/current-system/profile/bin/build-nix-profile")
|
||||
#$config)))))))
|
||||
|
||||
;; TODO: Avoid duplicating search paths from the system profile.
|
||||
(define* (nix-search-paths-profile-extension #:key home?)
|
||||
(lambda (config)
|
||||
(list (mixed-text-file "nix-search-paths.sh" "\
|
||||
eval \"$(" guix "/bin/guix package --search-paths=suffix"
|
||||
" -p " (if home?
|
||||
"~/.guix-home/profile"
|
||||
"/run/current-system/profile")
|
||||
" -p " config ")\""))))
|
||||
|
||||
(define nix-search-paths-service-type
|
||||
(service-type
|
||||
(name 'nix-search-paths)
|
||||
(extensions
|
||||
(list (service-extension session-environment-service-type
|
||||
nix-search-paths-environment-extension)
|
||||
(service-extension activation-service-type
|
||||
nix-search-paths-activation)
|
||||
(service-extension shepherd-root-service-type
|
||||
(nix-search-paths-shepherd-extension))
|
||||
(service-extension etc-profile-d-service-type
|
||||
(nix-search-paths-profile-extension))))
|
||||
(default-value "/nix/var/nix/profiles/guix-system-nix-profile")
|
||||
(description "Set up search paths for @code{with-nix-profile}.")))
|
||||
|
||||
(define home-nix-search-paths-service-type
|
||||
(service-type
|
||||
(inherit nix-search-paths-service-type)
|
||||
(name 'home-nix-search-paths)
|
||||
(extensions
|
||||
(list (service-extension home-environment-variables-service-type
|
||||
nix-search-paths-environment-extension)
|
||||
(service-extension home-activation-service-type
|
||||
nix-search-paths-activation)
|
||||
(service-extension home-shepherd-service-type
|
||||
(nix-search-paths-shepherd-extension #:home? #t))
|
||||
(service-extension home-shell-profile-service-type
|
||||
(nix-search-paths-profile-extension #:home? #t))))
|
||||
(default-value "/var/tmp/guix-home-nix-profile")))
|
||||
|
||||
(define-service-type-mapping
|
||||
nix-search-paths-service-type => home-nix-search-paths-service-type)
|
||||
@@ -12,6 +12,7 @@
|
||||
#:use-module (guix i18n)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils packages)
|
||||
#:use-module (rosenthal utils records)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services configuration)
|
||||
@@ -20,13 +21,16 @@
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages rust-apps)
|
||||
#:use-module (gnu packages shellutils)
|
||||
#:use-module (rosenthal packages rust-apps)
|
||||
#:use-module (rosenthal packages shellutils)
|
||||
#:export (home-fish-plugin-atuin-service-type
|
||||
home-atuin-configuration
|
||||
|
||||
home-fish-plugin-direnv-service-type
|
||||
home-direnv-configuration
|
||||
|
||||
home-fish-plugin-stinkpot-service-type
|
||||
home-stinkpot-configuration
|
||||
|
||||
home-fish-plugin-zoxide-service-type
|
||||
home-zoxide-configuration))
|
||||
|
||||
@@ -109,6 +113,41 @@ end\n"))))))
|
||||
(define-deprecated/public-alias home-direnv-service-type
|
||||
home-fish-plugin-direnv-service-type)
|
||||
|
||||
|
||||
;;;
|
||||
;;; stinkpot
|
||||
;;;
|
||||
|
||||
(define-record-type/dolly <home-stinkpot-configuration>
|
||||
home-stinkpot-configuration
|
||||
make-home-stinkpot-configuration
|
||||
home-stinkpot-configuration?
|
||||
this-home-stinkpot-configuration
|
||||
(stinkpot
|
||||
home-stinkpot-configuration-stinkpot
|
||||
(default stinkpot)
|
||||
(contract file-like?)))
|
||||
|
||||
(define home-stinkpot-fish-service
|
||||
(match-record-lambda/dolly <home-stinkpot-configuration>
|
||||
(stinkpot)
|
||||
(home-fish-extension
|
||||
(config
|
||||
(list (mixed-text-file "stinkpot.fish" "\
|
||||
status is-interactive
|
||||
and begin
|
||||
" stinkpot "/bin/stinkpot init fish | source
|
||||
end\n"))))))
|
||||
|
||||
(define home-fish-plugin-stinkpot-service-type
|
||||
(service-type
|
||||
(name 'home-stinkpot)
|
||||
(extensions
|
||||
(list (service-extension home-fish-service-type
|
||||
home-stinkpot-fish-service)))
|
||||
(default-value (home-stinkpot-configuration))
|
||||
(description "Set up @command{stinkpot} for Fish shell.")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; zoxide
|
||||
|
||||
+324
-122
@@ -5,9 +5,15 @@
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix modules)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix profiles)
|
||||
#:use-module (guix records)
|
||||
#:use-module (rosenthal utils contract combinators)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (rosenthal utils predicates)
|
||||
#:use-module (rosenthal utils records)
|
||||
;; Guix origin methods
|
||||
#:use-module (guix download)
|
||||
;; Guix System
|
||||
#:use-module (gnu system privilege)
|
||||
#:use-module (gnu system shadow)
|
||||
@@ -19,9 +25,12 @@
|
||||
#:use-module (gnu services databases)
|
||||
#:use-module (gnu services docker)
|
||||
#:use-module (gnu services shepherd)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system copy)
|
||||
;; Guix packages
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages guile-xyz)
|
||||
#:use-module (gnu packages password-utils)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages video)
|
||||
#:use-module (gnu packages web)
|
||||
@@ -39,6 +48,9 @@
|
||||
jellyfin-configuration
|
||||
jellyfin-service-type
|
||||
|
||||
jellyfin-oci-configuration
|
||||
jellyfin-oci-service-type
|
||||
|
||||
komga-configuration
|
||||
komga-service-type
|
||||
|
||||
@@ -166,6 +178,7 @@
|
||||
;;; Forgejo
|
||||
;;;
|
||||
|
||||
(define-maybe string)
|
||||
|
||||
(define list-of-file-likes?
|
||||
(list-of file-like?))
|
||||
@@ -178,10 +191,10 @@
|
||||
(list-of-file-likes (list git git-lfs))
|
||||
"@code{git} and extension packages to install.")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(postgresql-password-file
|
||||
string
|
||||
maybe-string
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
@@ -212,46 +225,66 @@
|
||||
(list (postgresql-role
|
||||
(name "forgejo")
|
||||
(create-database? #t)
|
||||
(password-file postgresql-password-file)))))
|
||||
(password-file
|
||||
(if (maybe-value-set? postgresql-password-file)
|
||||
postgresql-password-file
|
||||
#f))))))
|
||||
|
||||
(define forgejo-activation
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((user (getpwnam "forgejo")))
|
||||
(for-each
|
||||
(lambda (dir)
|
||||
(mkdir-p dir)
|
||||
(chown dir (passwd:uid user) (passwd:gid user))
|
||||
(chmod dir #o750))
|
||||
'("/var/lib/forgejo" "/var/log/forgejo")))))
|
||||
(use-modules (srfi srfi-26))
|
||||
(for-each (cute mkdir-p/perms <> (getpwnam "forgejo") #o750)
|
||||
'("/var/lib/forgejo" "/var/log/forgejo"))))
|
||||
|
||||
(define forgejo-shepherd-service
|
||||
(match-record-lambda <forgejo-configuration>
|
||||
(forgejo config)
|
||||
(let ((config-file (ini-file "forgejo.ini" config)))
|
||||
(list (shepherd-service
|
||||
(documentation "Run Forgejo.")
|
||||
(provision '(forgejo))
|
||||
(requirement '(loopback postgresql))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list "/run/current-system/profile/bin/forgejo"
|
||||
"--config" #$config-file)
|
||||
#:user "forgejo"
|
||||
#:group "forgejo"
|
||||
#:log-file "/var/log/forgejo.log"
|
||||
#:environment-variables
|
||||
'("GIT_EXEC_PATH=/run/current-system/profile/libexec/git-core"
|
||||
"GIT_SSL_CAINFO=/run/current-system/profile/etc/ssl/certs/ca-certificates.crt"
|
||||
"HOME=/var/lib/forgejo"
|
||||
"PATH=/run/current-system/profile/bin"
|
||||
"SSL_CERT_DIR=/run/current-system/profile/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt")
|
||||
#:resource-limits '((nofile 524288 524288))))
|
||||
(stop
|
||||
#~(make-kill-destructor))
|
||||
(actions
|
||||
(list (shepherd-configuration-action config-file))))))))
|
||||
(forgejo git-packages config)
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(ini-file "forgejo.ini" config)
|
||||
config))
|
||||
(git-profile
|
||||
(profile
|
||||
(name "forgejo-git-profile")
|
||||
(content (packages->manifest git-packages)))))
|
||||
(list
|
||||
(shepherd-service
|
||||
(documentation "Run Forgejo.")
|
||||
(provision '(forgejo))
|
||||
(requirement '(user-processes postgresql loopback))
|
||||
(start
|
||||
#~(lambda _
|
||||
(define (forgejo-run . options)
|
||||
(let ((command
|
||||
(cons* #$(file-append forgejo "/bin/forgejo")
|
||||
"--config" #$config-file
|
||||
options))
|
||||
(args
|
||||
(list #:user "forgejo"
|
||||
#:group "forgejo"
|
||||
#:log-file
|
||||
(if (null? options)
|
||||
"/var/log/forgejo.log"
|
||||
"/var/log/forgejo-init.log")
|
||||
#:environment-variables
|
||||
(list "HOME=/var/lib/forgejo"
|
||||
"SSL_CERT_DIR=/etc/ssl/certs"
|
||||
"SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"
|
||||
"GIT_SSL_CAINFO=/etc/ssl/certs/ca-certificates.crt"
|
||||
(format #f "GIT_EXEC_PATH=~a/libexec/git-core" #$git-profile)
|
||||
(format #f "PATH=/run/current-system/profile/bin:~a/bin" #$git-profile))
|
||||
#:resource-limits '((nofile 524288 524288)))))
|
||||
(if (null? options)
|
||||
(apply fork+exec-command command args)
|
||||
(unless (zero? (apply spawn-command command args))
|
||||
(error "failed to run forgejo command" command)))))
|
||||
(forgejo-run "migrate")
|
||||
(forgejo-run "admin" "regenerate" "hooks")
|
||||
(forgejo-run "admin" "regenerate" "keys")
|
||||
(forgejo-run "doctor" "check" "--all")
|
||||
(forgejo-run)))
|
||||
(stop #~(make-kill-destructor))
|
||||
(actions (list (shepherd-configuration-action config-file))))))))
|
||||
|
||||
(define forgejo-service-type
|
||||
(service-type
|
||||
@@ -261,10 +294,6 @@
|
||||
forgejo-account)
|
||||
(service-extension postgresql-role-service-type
|
||||
forgejo-postgresql-role)
|
||||
(service-extension profile-service-type
|
||||
(lambda (config)
|
||||
(cons (forgejo-configuration-forgejo config)
|
||||
(forgejo-configuration-git-packages config))))
|
||||
(service-extension activation-service-type
|
||||
(const forgejo-activation))
|
||||
(service-extension shepherd-root-service-type
|
||||
@@ -282,7 +311,7 @@
|
||||
(file-like iocaine)
|
||||
"")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"")
|
||||
(log-file
|
||||
(string "/var/log/iocaine.log")
|
||||
@@ -323,7 +352,10 @@
|
||||
(define iocaine-etc
|
||||
(match-record-lambda <iocaine-configuration>
|
||||
(config)
|
||||
`(("iocaine/iocaine.toml" ,(toml-file "iocaine.toml" config)))))
|
||||
`(("iocaine/iocaine.toml"
|
||||
,(if (file-config? config)
|
||||
(toml-file "iocaine.toml" config)
|
||||
config)))))
|
||||
|
||||
(define iocaine-shepherd-service
|
||||
(match-record-lambda <iocaine-configuration>
|
||||
@@ -370,13 +402,148 @@ test its configuration file."))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Jellyfin
|
||||
;;; Jellyfin media system (Native, currently written for the Nix package).
|
||||
;;;
|
||||
|
||||
(define-record-type/dolly <jellyfin-configuration>
|
||||
jellyfin-configuration
|
||||
make-jellyfin-configuration
|
||||
jellyfin-configuration?
|
||||
this-jellyfin-configuration
|
||||
(jellyfin
|
||||
jellyfin-configuration-jellyfin
|
||||
(contract (or/c file-like? string?))
|
||||
(documentation
|
||||
"Jellyfin executable file."))
|
||||
;; See also: https://jellyfin.org/docs/general/administration/configuration/#server-paths
|
||||
(data-directory
|
||||
jellyfin-configuration-data-directory
|
||||
(default "/var/lib/jellyfin")
|
||||
(contract string?)
|
||||
(documentation
|
||||
"Directory for all Jellyfin data."))
|
||||
(config-directory
|
||||
jellyfin-configuration-config-directory
|
||||
(thunked)
|
||||
(default (in-vicinity
|
||||
(jellyfin-configuration-data-directory this-jellyfin-configuration)
|
||||
"config"))
|
||||
(contract string?)
|
||||
(documentation
|
||||
"Directory for the server configuration files."))
|
||||
(cache-directory
|
||||
jellyfin-configuration-cache-directory
|
||||
(thunked)
|
||||
(default (in-vicinity
|
||||
(jellyfin-configuration-data-directory this-jellyfin-configuration)
|
||||
"cache"))
|
||||
(contract string?)
|
||||
(documentation
|
||||
"Directory for the server cache."))
|
||||
(log-directory
|
||||
jellyfin-configuration-log-directory
|
||||
(thunked)
|
||||
(default (in-vicinity
|
||||
(jellyfin-configuration-data-directory this-jellyfin-configuration)
|
||||
"log"))
|
||||
(contract string?)
|
||||
(documentation
|
||||
"Directory for Jellyfin logs."))
|
||||
|
||||
(user
|
||||
jellyfin-configuration-user
|
||||
(default #f)
|
||||
(contract (or/c #f integer?))
|
||||
(documentation
|
||||
"User account under which Jellyfin runs."))
|
||||
(group
|
||||
jellyfin-configuration-group
|
||||
(default #f)
|
||||
(contract (or/c #f integer?))
|
||||
(documentation
|
||||
"Group under which Jellyfin runs."))
|
||||
(shepherd-requirement
|
||||
jellyfin-configuration-shepherd-requirement
|
||||
(default '())
|
||||
(contract (listof/c symbol?))
|
||||
(documentation
|
||||
"Shepherd services that should be started before this service."))
|
||||
(extra-options
|
||||
jellyfin-configuration-extra-options
|
||||
(default '())
|
||||
(contract (listof/c string?))
|
||||
(documentation
|
||||
"Extra command-line options.")))
|
||||
|
||||
(define jellyfin-account-service
|
||||
(match-record-lambda/dolly <jellyfin-configuration>
|
||||
(data-directory user group)
|
||||
(list (user-group
|
||||
(name "jellyfin")
|
||||
(id group)
|
||||
(system? #t))
|
||||
(user-account
|
||||
(name "jellyfin")
|
||||
(group "jellyfin")
|
||||
(uid user)
|
||||
(comment "Account for Jellyfin media system")
|
||||
(home-directory data-directory)
|
||||
(shell (file-append shadow "/sbin/nologin"))
|
||||
(system? #t)))))
|
||||
|
||||
(define jellyfin-activation-service
|
||||
(match-record-lambda/dolly <jellyfin-configuration>
|
||||
(data-directory config-directory cache-directory log-directory)
|
||||
#~(let ((owner (getpwnam "jellyfin")))
|
||||
(for-each (lambda (dir)
|
||||
(mkdir-p/perms dir owner #o755))
|
||||
'#$(list data-directory
|
||||
config-directory
|
||||
cache-directory
|
||||
log-directory)))))
|
||||
|
||||
(define jellyfin-shepherd-service
|
||||
(match-record-lambda/dolly <jellyfin-configuration>
|
||||
(jellyfin
|
||||
data-directory config-directory cache-directory log-directory
|
||||
shepherd-requirement extra-options)
|
||||
(list (shepherd-service
|
||||
(documentation "Run the Jellyfin media system.")
|
||||
(provision '(jellyfin))
|
||||
(requirement `(networking ,@shepherd-requirement))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$jellyfin
|
||||
"--datadir" #$data-directory
|
||||
"--configdir" #$config-directory
|
||||
"--cachedir" #$cache-directory
|
||||
"--logdir" #$log-directory
|
||||
#$@extra-options)
|
||||
#:user "jellyfin"
|
||||
#:group "jellyfin"
|
||||
#:log-file "/var/log/jellyfin.log"))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define jellyfin-service-type
|
||||
(service-type
|
||||
(name 'jellyfin)
|
||||
(extensions
|
||||
(list (service-extension account-service-type
|
||||
jellyfin-account-service)
|
||||
(service-extension activation-service-type
|
||||
jellyfin-activation-service)
|
||||
(service-extension shepherd-root-service-type
|
||||
jellyfin-shepherd-service)))
|
||||
(description "Run the Jellyfin media system.")))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Jellyfin media system (OCI)
|
||||
;;;
|
||||
|
||||
(define-maybe string)
|
||||
|
||||
(define-configuration jellyfin-configuration
|
||||
(define-configuration jellyfin-oci-configuration
|
||||
(cache-directory
|
||||
(string "/var/cache/jellyfin")
|
||||
"Path to cache directory.")
|
||||
@@ -400,8 +567,8 @@ test its configuration file."))
|
||||
"List of extra options.")
|
||||
(no-serialization))
|
||||
|
||||
(define jellyfin-account
|
||||
(match-record-lambda <jellyfin-configuration>
|
||||
(define jellyfin-oci-account-service
|
||||
(match-record-lambda <jellyfin-oci-configuration>
|
||||
(user-id)
|
||||
(list (user-account
|
||||
(name "jellyfin")
|
||||
@@ -411,8 +578,8 @@ test its configuration file."))
|
||||
(home-directory "/var/empty")
|
||||
(shell (file-append shadow "/sbin/nologin"))))))
|
||||
|
||||
(define jellyfin-activation
|
||||
(match-record-lambda <jellyfin-configuration>
|
||||
(define jellyfin-oci-activation-service
|
||||
(match-record-lambda <jellyfin-oci-configuration>
|
||||
(cache-directory config-directory)
|
||||
#~(let ((user (getpwnam "jellyfin")))
|
||||
(for-each
|
||||
@@ -422,8 +589,8 @@ test its configuration file."))
|
||||
(chown directory (passwd:uid user) (passwd:gid user))))
|
||||
'#$(list cache-directory config-directory)))))
|
||||
|
||||
(define jellyfin-oci
|
||||
(match-record-lambda <jellyfin-configuration>
|
||||
(define jellyfin-oci-oci-service
|
||||
(match-record-lambda <jellyfin-oci-configuration>
|
||||
(cache-directory config-directory
|
||||
proxy-url log-file auto-start? extra-options)
|
||||
(oci-extension
|
||||
@@ -447,17 +614,17 @@ test its configuration file."))
|
||||
(,config-directory . "/config")))
|
||||
(extra-arguments extra-options)))))))
|
||||
|
||||
(define jellyfin-service-type
|
||||
(define jellyfin-oci-service-type
|
||||
(service-type
|
||||
(name 'jellyfin)
|
||||
(name 'jellyfin-oci)
|
||||
(extensions
|
||||
(list (service-extension account-service-type
|
||||
jellyfin-account)
|
||||
jellyfin-oci-account-service)
|
||||
(service-extension activation-service-type
|
||||
jellyfin-activation)
|
||||
jellyfin-oci-activation-service)
|
||||
(service-extension oci-service-type
|
||||
jellyfin-oci)))
|
||||
(default-value (jellyfin-configuration))
|
||||
jellyfin-oci-oci-service)))
|
||||
(default-value (jellyfin-oci-configuration))
|
||||
(description "Run Jellyfin, a media system.")))
|
||||
|
||||
|
||||
@@ -541,7 +708,7 @@ test its configuration file."))
|
||||
(string "misskey/misskey:latest")
|
||||
"Misskey docker image to use.")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"Alist of Misskey configuration, to be serialized to YAML format.")
|
||||
(data-directory
|
||||
(string "/var/lib/misskey")
|
||||
@@ -553,7 +720,7 @@ test its configuration file."))
|
||||
(string "/var/log/misskey.log")
|
||||
"Log file to use.")
|
||||
(postgresql-password-file
|
||||
string
|
||||
maybe-string
|
||||
"")
|
||||
(no-serialization))
|
||||
|
||||
@@ -574,7 +741,10 @@ test its configuration file."))
|
||||
(list (postgresql-role
|
||||
(name "misskey")
|
||||
(create-database? #t)
|
||||
(password-file postgresql-password-file)))))
|
||||
(password-file
|
||||
(if (maybe-value-set? postgresql-password-file)
|
||||
postgresql-password-file
|
||||
#f))))))
|
||||
|
||||
(define misskey-activation
|
||||
(match-record-lambda <misskey-configuration>
|
||||
@@ -589,7 +759,10 @@ test its configuration file."))
|
||||
(define misskey-oci
|
||||
(match-record-lambda <misskey-configuration>
|
||||
(image config data-directory log-file )
|
||||
(let ((config-file (yaml-file "misskey.yaml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(yaml-file "misskey.yaml" config)
|
||||
config)))
|
||||
(oci-extension
|
||||
(containers
|
||||
(list (oci-container-configuration
|
||||
@@ -642,7 +815,7 @@ test its configuration file."))
|
||||
(boolean #t)
|
||||
"")
|
||||
(config
|
||||
(gexp #~'())
|
||||
(file-object-or-file-config #~'())
|
||||
"")
|
||||
(no-serialization))
|
||||
|
||||
@@ -665,11 +838,16 @@ test its configuration file."))
|
||||
(match-record-lambda <navidrome-configuration>
|
||||
(navidrome ffmpeg auto-start? config)
|
||||
(let ((config-file
|
||||
(toml-file "navidrome.toml"
|
||||
#~`(("DataFolder" . "/var/lib/navidrome")
|
||||
("CacheFolder" . "/var/lib/navidrome/cache")
|
||||
("EnableInsightsCollector" . #f)
|
||||
,@#$config))))
|
||||
(if (file-config? config)
|
||||
(toml-file "navidrome.toml"
|
||||
(let ((default-settings
|
||||
'(("DataFolder" . "/var/lib/navidrome")
|
||||
("CacheFolder" . "/var/lib/navidrome/cache")
|
||||
("EnableInsightsCollector" . #f))))
|
||||
(if (gexp? config)
|
||||
#~(append #$default-settings #$config)
|
||||
(append default-settings config))))
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(documentation "Run Navidrome.")
|
||||
(provision '(navidrome))
|
||||
@@ -714,7 +892,7 @@ test its configuration file."))
|
||||
(string "/var/lib/tuwunel")
|
||||
"Directory to create for @code{tuwunel} user.")
|
||||
(config
|
||||
gexp
|
||||
file-object-or-file-config
|
||||
"Configuration file in @code{toml-file} format.")
|
||||
;; Account
|
||||
(group-id
|
||||
@@ -758,7 +936,10 @@ test its configuration file."))
|
||||
(define tuwunel-shepherd
|
||||
(match-record-lambda <tuwunel-configuration>
|
||||
(tuwunel config auto-start? shepherd-requirement)
|
||||
(let ((config-file (toml-file "tuwunel.toml" config)))
|
||||
(let ((config-file
|
||||
(if (file-config? config)
|
||||
(toml-file "tuwunel.toml" config)
|
||||
config)))
|
||||
(list (shepherd-service
|
||||
(provision '(tuwunel))
|
||||
(requirement `(networking user-processes ,@shepherd-requirement))
|
||||
@@ -791,8 +972,31 @@ test its configuration file."))
|
||||
;;; Vaultwarden
|
||||
;;;
|
||||
|
||||
(define vaultwarden-web-vault
|
||||
(package
|
||||
(name "vaultwarden-web-vault")
|
||||
(version "2026.6.4")
|
||||
(source
|
||||
(origin
|
||||
(method url-fetch)
|
||||
(uri (string-append
|
||||
"https://github.com/dani-garcia/bw_web_builds/releases/download/v"
|
||||
version "/bw_web_v" version ".tar.gz"))
|
||||
(sha256
|
||||
(base32 "14lmg7kdm2jcs86vznc0nrpil7w8z20p4123h7476v3m9vniczyl"))))
|
||||
(build-system copy-build-system)
|
||||
(home-page #f)
|
||||
(synopsis #f)
|
||||
(description #f)
|
||||
(license #f)))
|
||||
|
||||
(define-configuration vaultwarden-configuration
|
||||
(vaultwarden
|
||||
(file-like (file-append vaultwarden "/bin/vaultwarden"))
|
||||
"")
|
||||
(web-vault
|
||||
(file-like vaultwarden-web-vault)
|
||||
"")
|
||||
(admin-token
|
||||
maybe-string
|
||||
"Token for the admin interface, preferably an Argon2 PCH string.")
|
||||
@@ -815,7 +1019,10 @@ test its configuration file."))
|
||||
(alist '())
|
||||
"Extra options.")
|
||||
(postgresql-password-file
|
||||
string
|
||||
maybe-string
|
||||
"")
|
||||
(group-id
|
||||
(user-and-group-id #f)
|
||||
"")
|
||||
(user-id
|
||||
(user-and-group-id #f)
|
||||
@@ -824,13 +1031,17 @@ test its configuration file."))
|
||||
|
||||
(define vaultwarden-account
|
||||
(match-record-lambda <vaultwarden-configuration>
|
||||
(user-id)
|
||||
(list (user-account
|
||||
(group-id user-id data-directory)
|
||||
(list (user-group
|
||||
(name "vaultwarden")
|
||||
(group "docker")
|
||||
(id group-id)
|
||||
(system? #t))
|
||||
(user-account
|
||||
(name "vaultwarden")
|
||||
(group "vaultwarden")
|
||||
(uid user-id)
|
||||
(system? #t)
|
||||
(home-directory "/var/empty")
|
||||
(home-directory data-directory)
|
||||
(shell (file-append shadow "/sbin/nologin"))))))
|
||||
|
||||
(define vaultwarden-postgresql-role
|
||||
@@ -839,58 +1050,49 @@ test its configuration file."))
|
||||
(list (postgresql-role
|
||||
(name "vaultwarden")
|
||||
(create-database? #t)
|
||||
(password-file postgresql-password-file)))))
|
||||
(password-file
|
||||
(if (maybe-value-set? postgresql-password-file)
|
||||
postgresql-password-file
|
||||
#f))))))
|
||||
|
||||
(define vaultwarden-activation
|
||||
(match-record-lambda <vaultwarden-configuration>
|
||||
(data-directory log-file)
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((user (getpwnam "vaultwarden")))
|
||||
(unless (file-exists? #$data-directory)
|
||||
(mkdir-p #$data-directory)
|
||||
(chown #$data-directory (passwd:uid user) (passwd:gid user)))
|
||||
(unless (file-exists? #$log-file)
|
||||
(mkdir-p (dirname #$log-file))
|
||||
(call-with-output-file #$log-file
|
||||
(lambda (port)
|
||||
(write-char #\newline port)))
|
||||
(chown #$log-file (passwd:uid user) (passwd:gid user)))))))
|
||||
(data-directory)
|
||||
(with-imported-modules '((gnu build activation))
|
||||
#~(begin
|
||||
(use-modules (gnu build activation))
|
||||
(mkdir-p/perms #$data-directory (getpwnam "vaultwarden") #o700)))))
|
||||
|
||||
(define vaultwarden-oci
|
||||
(define vaultwarden-shepherd-extension
|
||||
(match-record-lambda <vaultwarden-configuration>
|
||||
(admin-token database-url port data-directory log-file proxy-url extra-options)
|
||||
(oci-extension
|
||||
(containers
|
||||
(list (oci-container-configuration
|
||||
(user "vaultwarden")
|
||||
(group "docker")
|
||||
(host-environment
|
||||
`(,@(if (maybe-value-set? admin-token)
|
||||
`(("ADMIN_TOKEN" . ,admin-token))
|
||||
'())
|
||||
("DATABASE_URL" . ,database-url)))
|
||||
(environment
|
||||
`(,@(if (maybe-value-set? proxy-url)
|
||||
`(("HTTP_PROXY" . ,proxy-url))
|
||||
'())
|
||||
("LOG_FILE" . "vaultwarden.log")
|
||||
("ROCKET_PORT" . ,(number->string port))
|
||||
("USE_SYSLOG" . "True")
|
||||
,@extra-options))
|
||||
(image "vaultwarden/server:latest-alpine")
|
||||
(provision "vaultwarden")
|
||||
(requirement '(postgresql))
|
||||
(respawn? #t)
|
||||
(network "host")
|
||||
(volumes
|
||||
`((,data-directory . "/data")
|
||||
(,log-file . "/vaultwarden.log")))
|
||||
(extra-arguments
|
||||
`(,@(if (maybe-value-set? admin-token)
|
||||
'("--env" "ADMIN_TOKEN")
|
||||
'())
|
||||
"--env" "DATABASE_URL"))))))))
|
||||
(vaultwarden web-vault admin-token database-url port data-directory log-file proxy-url extra-options)
|
||||
(list (shepherd-service
|
||||
(provision '(vaultwarden))
|
||||
(requirement '(user-processes loopback postgresql))
|
||||
(modules '((ice-9 match)))
|
||||
(start
|
||||
#~(make-forkexec-constructor
|
||||
(list #$vaultwarden)
|
||||
#:group "vaultwarden"
|
||||
#:user "vaultwarden"
|
||||
#:log-file #$log-file
|
||||
#:environment-variables
|
||||
(map (match-lambda
|
||||
((variable . value)
|
||||
(string-append variable "=" value)))
|
||||
`(#$@(if (maybe-value-set? admin-token)
|
||||
`(("ADMIN_TOKEN" . ,admin-token))
|
||||
'())
|
||||
#$@(if (maybe-value-set? proxy-url)
|
||||
`(("HTTP_PROXY" . ,proxy-url))
|
||||
'())
|
||||
("DATA_FOLDER" . #$data-directory)
|
||||
("WEB_VAULT_FOLDER" . #$web-vault)
|
||||
("DATABASE_URL" . #$database-url)
|
||||
("ROCKET_PORT" . #$(number->string port))
|
||||
("USE_SYSLOG" . "True")
|
||||
#$@extra-options))))
|
||||
(stop #~(make-kill-destructor))))))
|
||||
|
||||
(define vaultwarden-service-type
|
||||
(service-type
|
||||
@@ -902,6 +1104,6 @@ test its configuration file."))
|
||||
vaultwarden-postgresql-role)
|
||||
(service-extension activation-service-type
|
||||
vaultwarden-activation)
|
||||
(service-extension oci-service-type
|
||||
vaultwarden-oci)))
|
||||
(service-extension shepherd-root-service-type
|
||||
vaultwarden-shepherd-extension)))
|
||||
(description "Run Vaultwarden, a Bitwarden compatible server.")))
|
||||
@@ -0,0 +1,97 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils contract)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (guix colors)
|
||||
#:use-module (guix diagnostics)
|
||||
#:use-module (rosenthal utils contract impl)
|
||||
#:use-module (rosenthal utils contract blame)
|
||||
#:use-module (rosenthal utils contract combinators)
|
||||
#:export (apply-contract/guix-record-field
|
||||
contract
|
||||
define/contract))
|
||||
|
||||
#|
|
||||
|
||||
Helpers to attach contracts to values and functions.
|
||||
|
||||
See (rosenthal utils contract impl) for more information.
|
||||
|
||||
|#
|
||||
|
||||
(define (src->location-str src)
|
||||
(match src
|
||||
((_ _ _)
|
||||
(let ((location (source-properties->location src)))
|
||||
(if (supports-hyperlinks? (guix-warning-port))
|
||||
(location->hyperlink location)
|
||||
(location->string location))))
|
||||
(_ #f)))
|
||||
|
||||
(define* (apply-contract contract value positive negative name location
|
||||
#:key context-limit)
|
||||
(let* ((ctc (->contract contract))
|
||||
(ctc-name (contract-name ctc))
|
||||
(checker (contract-checker ctc))
|
||||
(blame
|
||||
(make-blame*
|
||||
#:source location
|
||||
#:value name
|
||||
#:build-name (lambda () ctc-name)
|
||||
#:positive positive
|
||||
#:negative #f
|
||||
#:original? #t
|
||||
#:context-limit context-limit)))
|
||||
(cond
|
||||
(checker
|
||||
(if (checker value)
|
||||
value
|
||||
(raise-blame-error
|
||||
blame #:missing-party negative
|
||||
`(expected: "~a" got: "~s") ctc-name value)))
|
||||
(else
|
||||
(((contract-enforcer ctc) blame) value negative)))))
|
||||
|
||||
(define-syntax apply-contract/guix-record-field
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_ ctc value record-name field-name)
|
||||
(with-syntax ((field-name #'(format #f "(field: ~a)" field-name))
|
||||
(location (src->location-str (syntax-source stx))))
|
||||
;; Use field-name for both positive and negative parties, to ensure the
|
||||
;; error message is always "contract violation".
|
||||
#'(apply-contract ctc value field-name field-name record-name location))))))
|
||||
|
||||
(define-syntax contract
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_ ctc value positive negative name location #:context-limit context-limit)
|
||||
#'(apply-contract ctc value positive negative name location #:context-limit context-limit))
|
||||
((_ ctc value positive negative name location)
|
||||
#'(contract ctc value positive negative name location #:context-limit #f))
|
||||
((_ ctc value positive negative name)
|
||||
(with-syntax ((location (src->location-str (syntax-source stx))))
|
||||
#'(contract ctc value positive negative name location)))
|
||||
((_ ctc value positive negative)
|
||||
#'(contract ctc value positive negative positive))
|
||||
((_ ctc value)
|
||||
#'(contract ctc value 'unknown-definition 'caller)))))
|
||||
|
||||
(define-syntax define/contract
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_ (name . args) ctc body ...)
|
||||
(if (null? #'(body ...))
|
||||
(syntax-violation 'define/contract "missing body" stx)
|
||||
(with-syntax ((value #'(lambda* args body ...)))
|
||||
#'(define name
|
||||
(contract ctc value '(definition: name) 'caller 'name)))))
|
||||
((_ name ctc body ...)
|
||||
(if (null? #'(body ...))
|
||||
(syntax-violation 'define/contract "missing body" stx)
|
||||
(with-syntax ((value #'(begin body ...)))
|
||||
#'(define name
|
||||
(contract ctc value '(definition: name) 'caller 'name))))))))
|
||||
@@ -0,0 +1,704 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
;;; https://github.com/racket/racket/blob/master/racket/collects/racket/contract/private/blame.rkt
|
||||
;;; Copyright © 2010-2019, 2021, 2024 Racket authors
|
||||
;;; Ported from Racket, original copyright notice below:
|
||||
;;;
|
||||
;;; Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
;;; of this software and associated documentation files (the "Software"), to
|
||||
;;; deal in the Software without restriction, including without limitation the
|
||||
;;; rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
;;; sell copies of the Software, and to permit persons to whom the Software is
|
||||
;;; furnished to do so, subject to the following conditions:
|
||||
;;;
|
||||
;;; The above copyright notice and this permission notice shall be included in
|
||||
;;; all copies or substantial portions of the Software.
|
||||
;;;
|
||||
;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
;;; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
;;; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
;;; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
;;; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
;;; FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
;;; IN THE SOFTWARE.
|
||||
|
||||
(define-module (rosenthal utils contract blame)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 regex)
|
||||
#:use-module (ice-9 string-fun)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (srfi srfi-71)
|
||||
#:export (blame?
|
||||
make-blame
|
||||
blame-source
|
||||
blame-positive
|
||||
blame-negative
|
||||
blame-contract
|
||||
blame-value
|
||||
blame-original?
|
||||
blame-swapped?
|
||||
blame-swap
|
||||
blame-replace-negative ;used for indy blame
|
||||
blame-replaced-negative? ;used for indy blame
|
||||
blame-update ;used for option contract transfers
|
||||
blame-add-context
|
||||
;; blame-add-unknown-context
|
||||
blame-context
|
||||
blame-replaced-negative?
|
||||
|
||||
blame-add-missing-party
|
||||
blame-missing-party?
|
||||
;; blame-add-extra-field
|
||||
|
||||
raise-blame-error
|
||||
;; current-blame-format
|
||||
;; exn:fail:contract:blame
|
||||
;; blame-fmt->-string
|
||||
|
||||
;; invariant-assertion-party
|
||||
|
||||
;; NOTE: New interfaces.
|
||||
contract-violation?
|
||||
make-blame*))
|
||||
|
||||
#|
|
||||
|
||||
Blame provides error reporting for the contract system. This module implements
|
||||
its structure and APIs, and currently follows Racket error message conventions.
|
||||
See also:
|
||||
https://docs.racket-lang.org/reference/exns.html#(part._err-msg-conventions)
|
||||
|
||||
|
||||
Blame has a linked structure of <blame> -> <blame> -> ... -> <all-the-info>.
|
||||
|
||||
<all-the-info> records contract information and each <blame> node adds extra
|
||||
context to it. The extra context is combinator-specific (e.g. "the #1 element
|
||||
of"). For higher-order functions, it also includes whether the positive party
|
||||
and negative party are swapped.
|
||||
|
||||
|
||||
The positive party provides a definition, and the negative party uses it. For
|
||||
contracts on higher-order functions, both parties are swapped for function
|
||||
arguments.
|
||||
|
||||
For example, consider the following definition:
|
||||
|
||||
(define/contract (example f)
|
||||
(->/c (->/c number? number?) number?)
|
||||
...)
|
||||
|
||||
The positive party and negative party for ‘example’ will be ‘example’ and
|
||||
‘caller’, respectively.
|
||||
|
||||
‘f’ has a function contract ‘(->/c number? number?)’. As an argument of
|
||||
‘example’, it initially gets ‘example’ for positive and ‘caller’ for negative.
|
||||
|
||||
However the definition of ‘f’ is provided by the caller, so both parties should
|
||||
be swapped: ‘caller’ for positive, and ‘example’ for negative.
|
||||
|
||||
|##|
|
||||
|
||||
‘make-blame’ constructs a blame. (<blame> -> <all-the-info>)
|
||||
|
||||
(define b1
|
||||
(make-blame*
|
||||
#:source #f
|
||||
#:value 'my-function
|
||||
#:build-name (const "(listof/c (listof/c number?))")
|
||||
#:positive 'my-function
|
||||
#:negative 'caller
|
||||
#:original? #t))
|
||||
|
||||
b1
|
||||
=> #<<blame>
|
||||
context-frame: #f
|
||||
swapped?: #f
|
||||
and-more: #<<all-the-info> ...>
|
||||
(blame-swapped? b1)
|
||||
=> #f
|
||||
(blame-positive b1)
|
||||
=> 'my-function
|
||||
(blame-negative b1)
|
||||
=> 'caller
|
||||
(blame-context b1)
|
||||
=> '()
|
||||
(blame-contract b1)
|
||||
=> "(listof/c (listof/c number?))"
|
||||
|
||||
‘blame-add-context’ adds a new head node with extra context. (<blame> -> ...)
|
||||
|
||||
(define b2
|
||||
(blame-add-context b1 "an element of" #:swap? #t))
|
||||
|
||||
b2
|
||||
=> #<<blame>
|
||||
context-frame: "an element of"
|
||||
swapped? #t
|
||||
and-more: #<<blame>
|
||||
context-frame: #f
|
||||
swapped?: #f
|
||||
and-more: #<<all-the-info> ...>>
|
||||
(blame-swapped? b2)
|
||||
=> #t
|
||||
(blame-positive b2)
|
||||
=> 'caller
|
||||
(blame-negative b2)
|
||||
=> 'my-function
|
||||
(blame-context b2)
|
||||
=> '("an element of")
|
||||
(blame-contract b2)
|
||||
=> "(listof/c (listof/c number?))"
|
||||
|
||||
(define b3
|
||||
(blame-add-context b2 "the #1 element of" #:swap? #t))
|
||||
|
||||
b3
|
||||
=> #<<blame>
|
||||
context-frame: "the #1 element of"
|
||||
swapped? #t
|
||||
and-more: #<<blame>
|
||||
context-frame: "an element of"
|
||||
swapped? #t
|
||||
and-more: #<<blame>
|
||||
context-frame: #f
|
||||
swapped?: #f
|
||||
and-more: #<<all-the-info> ...>>
|
||||
(blame-swapped? b3)
|
||||
=> #f
|
||||
(blame-positive b3)
|
||||
=> 'my-function
|
||||
(blame-negative b3)
|
||||
=> 'caller
|
||||
(blame-context b3)
|
||||
=> '("the #1 element of" "an element of")
|
||||
(blame-contract b3)
|
||||
=> "(listof/c (listof/c number?))"
|
||||
|
||||
|#
|
||||
|
||||
|
||||
|
||||
(define-condition-type &contract-violation &message
|
||||
contract-violation?)
|
||||
|
||||
(define-record-type <important>
|
||||
(make-important name sense-swapped?)
|
||||
important?
|
||||
(name important-name) ; any/c
|
||||
(sense-swapped? important-sense-swapped?)) ; boolean?
|
||||
|
||||
(define-record-type <all-the-info>
|
||||
(make-all-the-info positive negative source value build-name important
|
||||
missing-party? context-limit replaced-negative?)
|
||||
all-the-info?
|
||||
(positive all-the-info-positive) ; (or/c #f (listof/c any/c))
|
||||
(negative all-the-info-negative) ; (or/c #f (listof/c any/c))
|
||||
(source all-the-info-source) ; (or/c #f string?)
|
||||
(value all-the-info-value) ; any/c
|
||||
(build-name all-the-info-build-name) ; (->/c string?)
|
||||
(important all-the-info-important) ; important?
|
||||
(missing-party? all-the-info-missing-party?) ; boolean?
|
||||
(context-limit all-the-info-context-limit) ; (or/c #f (and/c integer? (not/c negative?)))
|
||||
(replaced-negative? all-the-info-replaced-negative?)) ; boolean?
|
||||
|
||||
(define (all-the-info-replace-positive all-the-info new-pos)
|
||||
(make-all-the-info
|
||||
(all-the-info-positive new-pos)
|
||||
(all-the-info-negative all-the-info)
|
||||
(all-the-info-source all-the-info)
|
||||
(all-the-info-value all-the-info)
|
||||
(all-the-info-build-name all-the-info)
|
||||
(all-the-info-important all-the-info)
|
||||
(all-the-info-missing-party? all-the-info)
|
||||
(all-the-info-context-limit all-the-info)
|
||||
(all-the-info-replaced-negative? all-the-info)))
|
||||
|
||||
(define (all-the-info-replace-negative all-the-info new-neg)
|
||||
(make-all-the-info
|
||||
(all-the-info-positive all-the-info)
|
||||
(all-the-info-negative new-neg)
|
||||
(all-the-info-source all-the-info)
|
||||
(all-the-info-value all-the-info)
|
||||
(all-the-info-build-name all-the-info)
|
||||
(all-the-info-important all-the-info)
|
||||
(all-the-info-missing-party? all-the-info)
|
||||
(all-the-info-context-limit all-the-info)
|
||||
(all-the-info-replaced-negative? all-the-info)))
|
||||
|
||||
(define-record-type <blame>
|
||||
(%make-blame context-frame swapped? and-more)
|
||||
blame?
|
||||
(context-frame %blame-context-frame) ; (or/c #f string?)
|
||||
(swapped? %blame-swapped?) ; boolean?
|
||||
(and-more %blame-and-more)) ; (or/c blame? all-the-info?)
|
||||
|
||||
(define* (make-blame source value build-name positive negative original?
|
||||
#:key (context-limit #f))
|
||||
(define build/memo-name
|
||||
(let ((name (delay (build-name))))
|
||||
(lambda ()
|
||||
(force name))))
|
||||
|
||||
(define all-the-info
|
||||
(make-all-the-info
|
||||
(and positive (list positive))
|
||||
(and negative (list negative))
|
||||
source
|
||||
value
|
||||
build/memo-name
|
||||
#f
|
||||
(not (and positive negative))
|
||||
context-limit
|
||||
#f))
|
||||
|
||||
(%make-blame
|
||||
#f
|
||||
(not original?)
|
||||
all-the-info))
|
||||
|
||||
(define* (make-blame* #:key source value build-name positive negative original?
|
||||
(context-limit #f))
|
||||
(make-blame source value build-name positive negative original?
|
||||
#:context-limit context-limit))
|
||||
|
||||
(define (blame->all-the-info blame)
|
||||
(let loop ((b blame))
|
||||
(if (blame? b)
|
||||
(loop (%blame-and-more b))
|
||||
b)))
|
||||
|
||||
(define blame-source
|
||||
(compose all-the-info-source blame->all-the-info))
|
||||
(define blame-value
|
||||
(compose all-the-info-value blame->all-the-info))
|
||||
(define (blame-contract blame)
|
||||
((all-the-info-build-name (blame->all-the-info blame))))
|
||||
(define blame-important
|
||||
(compose all-the-info-important blame->all-the-info))
|
||||
(define blame-missing-party?
|
||||
(compose all-the-info-missing-party? blame->all-the-info))
|
||||
(define blame-context-limit
|
||||
(compose all-the-info-context-limit blame->all-the-info))
|
||||
(define blame-replaced-negative?
|
||||
(compose all-the-info-replaced-negative? blame->all-the-info))
|
||||
|
||||
(define (blame-get-info blame getter)
|
||||
(let loop ((b blame)
|
||||
(swapped? #f))
|
||||
(if (blame? b)
|
||||
(loop (%blame-and-more b)
|
||||
(if (%blame-swapped? b)
|
||||
(not swapped?)
|
||||
swapped?))
|
||||
(getter b swapped?))))
|
||||
|
||||
(define (blame-set-info blame setter)
|
||||
(let loop ((b blame)
|
||||
(swap? #f))
|
||||
(if (blame? b)
|
||||
(%make-blame
|
||||
(%blame-context-frame b)
|
||||
(%blame-swapped? b)
|
||||
(loop (%blame-and-more b)
|
||||
(if (%blame-swapped? b)
|
||||
(not swap?)
|
||||
swap?)))
|
||||
(setter b swap?))))
|
||||
|
||||
(define (%blame-positive blame)
|
||||
(blame-get-info
|
||||
blame
|
||||
(lambda (all-the-info swapped?)
|
||||
(if swapped?
|
||||
(all-the-info-negative all-the-info)
|
||||
(all-the-info-positive all-the-info)))))
|
||||
|
||||
(define (%blame-negative blame)
|
||||
(blame-get-info
|
||||
blame
|
||||
(lambda (all-the-info swapped?)
|
||||
(if swapped?
|
||||
(all-the-info-positive all-the-info)
|
||||
(all-the-info-negative all-the-info)))))
|
||||
|
||||
(define (show-blame accessor blame)
|
||||
(match (accessor blame)
|
||||
((x) x)
|
||||
(x x)))
|
||||
(define blame-positive
|
||||
(cut show-blame %blame-positive <>))
|
||||
(define blame-negative
|
||||
(cut show-blame %blame-negative <>))
|
||||
|
||||
(define (ensure-blame-known who blame)
|
||||
(unless (and (%blame-positive blame)
|
||||
(%blame-negative blame))
|
||||
(error who "blame info is not known; positive ~s negative ~s"
|
||||
(%blame-positive blame)
|
||||
(%blame-negative blame))))
|
||||
|
||||
(define (blame-update blame extra-positive extra-negative)
|
||||
(ensure-blame-known 'blame-update blame)
|
||||
(blame-set-info
|
||||
blame
|
||||
(lambda (all-the-info swap?)
|
||||
(if swap?
|
||||
(make-all-the-info
|
||||
(cons extra-negative
|
||||
(all-the-info-positive all-the-info))
|
||||
(cons extra-positive
|
||||
(all-the-info-negative all-the-info))
|
||||
(all-the-info-source all-the-info)
|
||||
(all-the-info-value all-the-info)
|
||||
(all-the-info-build-name all-the-info)
|
||||
(all-the-info-important all-the-info)
|
||||
(all-the-info-missing-party? all-the-info)
|
||||
(all-the-info-context-limit all-the-info)
|
||||
(all-the-info-replaced-negative? all-the-info))
|
||||
(make-all-the-info
|
||||
(cons extra-positive
|
||||
(all-the-info-positive all-the-info))
|
||||
(cons extra-negative
|
||||
(all-the-info-negative all-the-info))
|
||||
(all-the-info-source all-the-info)
|
||||
(all-the-info-value all-the-info)
|
||||
(all-the-info-build-name all-the-info)
|
||||
(all-the-info-important all-the-info)
|
||||
(all-the-info-missing-party? all-the-info)
|
||||
(all-the-info-context-limit all-the-info)
|
||||
(all-the-info-replaced-negative? all-the-info))))))
|
||||
|
||||
(define (blame-swap blame)
|
||||
(%make-blame
|
||||
(%blame-context-frame blame)
|
||||
(not (%blame-swapped? blame))
|
||||
(%blame-and-more blame)))
|
||||
|
||||
(define (blame-swapped? blame)
|
||||
(blame-get-info
|
||||
blame
|
||||
(lambda (_ swapped?) swapped?)))
|
||||
|
||||
(define blame-original?
|
||||
(negate blame-swapped?))
|
||||
|
||||
(define (blame/important-original? blame)
|
||||
(let ((important (blame-important blame)))
|
||||
(cond
|
||||
((equal? (%blame-positive blame)
|
||||
(%blame-negative blame))
|
||||
#f)
|
||||
(important
|
||||
(equal? (important-sense-swapped? important)
|
||||
(blame-original? blame)))
|
||||
(else
|
||||
(blame-original? blame)))))
|
||||
|
||||
(define (blame-replace-negative blame new-neg)
|
||||
(blame-set-info
|
||||
blame
|
||||
(lambda (all-the-info swap?)
|
||||
(if swap?
|
||||
(all-the-info-replace-positive all-the-info new-neg)
|
||||
(all-the-info-replace-negative all-the-info new-neg)))))
|
||||
|
||||
(define (blame-add-missing-party blame missing-party)
|
||||
(if missing-party
|
||||
(begin
|
||||
(unless (blame-missing-party? blame)
|
||||
(error 'blame-add-missing-party "already have the party: ~s; trying to add ~s"
|
||||
(if (blame-swapped? blame)
|
||||
(%blame-positive blame)
|
||||
(%blame-negative blame))
|
||||
missing-party))
|
||||
(blame-set-info
|
||||
blame
|
||||
(lambda (all-the-info _)
|
||||
(make-all-the-info
|
||||
(or (all-the-info-positive all-the-info)
|
||||
(list missing-party))
|
||||
(or (all-the-info-negative all-the-info)
|
||||
(list missing-party))
|
||||
(all-the-info-source all-the-info)
|
||||
(all-the-info-value all-the-info)
|
||||
(all-the-info-build-name all-the-info)
|
||||
(all-the-info-important all-the-info)
|
||||
#f
|
||||
(all-the-info-context-limit all-the-info)
|
||||
(all-the-info-replaced-negative? all-the-info)))))
|
||||
blame))
|
||||
|
||||
(define (blame-context blame)
|
||||
(let loop ((top (%blame-context-frame blame))
|
||||
(b (%blame-and-more blame)))
|
||||
(cond
|
||||
((all-the-info? b)
|
||||
(if top
|
||||
(list top)
|
||||
'()))
|
||||
(else
|
||||
(cons top
|
||||
(loop (%blame-context-frame b)
|
||||
(%blame-and-more b)))))))
|
||||
|
||||
(define* (blame-add-context blame context #:key important swap?)
|
||||
(let ((context-limit (blame-context-limit blame)))
|
||||
(if context-limit
|
||||
(cond
|
||||
((not (zero? context-limit))
|
||||
(let ((limited-blame
|
||||
dropped-swap?
|
||||
(drop-to-limit blame context-limit)))
|
||||
(%make-blame
|
||||
context
|
||||
(not (equal? dropped-swap? swap?))
|
||||
limited-blame)))
|
||||
(swap?
|
||||
(%make-blame
|
||||
(%blame-context-frame blame)
|
||||
(not (%blame-swapped? blame))
|
||||
(%blame-and-more blame)))
|
||||
(else blame))
|
||||
(%make-blame
|
||||
context
|
||||
swap?
|
||||
(if important
|
||||
(let loop ((b blame))
|
||||
(if (blame? b)
|
||||
(%make-blame
|
||||
(%blame-context-frame b)
|
||||
(%blame-swapped? b)
|
||||
(loop (%blame-and-more b)))
|
||||
(make-all-the-info
|
||||
(all-the-info-positive b)
|
||||
(all-the-info-negative b)
|
||||
(all-the-info-source b)
|
||||
(all-the-info-value b)
|
||||
(all-the-info-build-name b)
|
||||
(make-important
|
||||
important
|
||||
(if swap?
|
||||
(not (blame-original? b))
|
||||
(blame-original? b)))
|
||||
(all-the-info-missing-party? b)
|
||||
(all-the-info-context-limit b)
|
||||
(all-the-info-replaced-negative? b))))
|
||||
blame)))))
|
||||
|
||||
(define (drop-to-limit blame context-limit)
|
||||
(define short-enough?
|
||||
(let loop ((b blame)
|
||||
(n (- context-limit 1)))
|
||||
(or (all-the-info? b)
|
||||
(if (zero? n)
|
||||
#f
|
||||
(loop (%blame-and-more b)
|
||||
(- n 1))))))
|
||||
|
||||
(if short-enough?
|
||||
(values blame #f)
|
||||
(let ()
|
||||
(define swapped? #f)
|
||||
(define limited-blame
|
||||
(let outer-loop ((outer-b blame)
|
||||
(n (- context-limit 1)))
|
||||
(if (zero? n)
|
||||
(let inner-loop ((inner-b outer-b)
|
||||
(swap? #f))
|
||||
(if (blame? inner-b)
|
||||
(inner-loop (%blame-and-more inner-b)
|
||||
(if (%blame-swapped? inner-b)
|
||||
(not swap?)
|
||||
swap?))
|
||||
(begin
|
||||
(set! swapped? swap?)
|
||||
inner-b)))
|
||||
(%make-blame
|
||||
(%blame-context-frame outer-b)
|
||||
(%blame-swapped? outer-b)
|
||||
(outer-loop (%blame-and-more outer-b)
|
||||
(- n 1))))))
|
||||
(values limited-blame swapped?))))
|
||||
|
||||
(define* (raise-blame-error raw-blame #:optional x #:key (missing-party #f)
|
||||
#:rest fmt+args)
|
||||
(define blame
|
||||
(if (and (blame-original? raw-blame)
|
||||
(not missing-party))
|
||||
raw-blame
|
||||
(blame-add-missing-party raw-blame missing-party)))
|
||||
|
||||
(define start-of-message
|
||||
(let ((self-or-not
|
||||
(if (blame/important-original? blame)
|
||||
"broke its own contract"
|
||||
"contract violation")))
|
||||
(cond
|
||||
((blame-important blame)
|
||||
(format #f "~a: ~a" (important-name (blame-important blame)) self-or-not))
|
||||
((blame-value blame)
|
||||
(format #f "~a: ~a" (blame-value blame) self-or-not))
|
||||
(else
|
||||
(format #f "~a" self-or-not)))))
|
||||
|
||||
(define custom-message
|
||||
(let loop ((args fmt+args))
|
||||
(match args
|
||||
;; Keyword arguments will be added to #:rest as well, strip them.
|
||||
(((? keyword? kw) arg . rest)
|
||||
(loop rest))
|
||||
((fmt . fmt-args)
|
||||
;; When formatting outputs, please use ~s to mimic Racket ~e.
|
||||
;;
|
||||
;; XXX: ~s doesn't directly map to Racket ~e. With symbol 'x, ~s
|
||||
;; gives ‘x’ but Racket ~e gives ‘'x’, for example.
|
||||
(apply format #f (blame-fmt->string blame fmt) fmt-args)))))
|
||||
|
||||
(define context-lines
|
||||
(let ((context (blame-context blame)))
|
||||
(or (and context
|
||||
(not (null? context))
|
||||
(let loop ((ctx context)
|
||||
(idx 0)
|
||||
(res '()))
|
||||
(if (null? ctx)
|
||||
(reverse res)
|
||||
(loop (cdr ctx)
|
||||
(1+ idx)
|
||||
(cons (if (zero? idx)
|
||||
(format #f " in: ~a~%" (car ctx))
|
||||
(format #f " ~a~%" (car ctx)))
|
||||
res)))))
|
||||
'())))
|
||||
|
||||
(define contract-line
|
||||
(format #f " ~a ~a~%"
|
||||
(if (null? context-lines) "in:" " ")
|
||||
(blame-contract blame)))
|
||||
|
||||
(define from-line
|
||||
(format #f " contract from: ~a~%"
|
||||
(if (blame-original? blame)
|
||||
(last (%blame-positive blame))
|
||||
(last (%blame-negative blame)))))
|
||||
|
||||
(define on-line
|
||||
(or (and (blame-important blame)
|
||||
(blame-value blame)
|
||||
(format #f " contract on: ~a~%" (blame-value blame)))
|
||||
""))
|
||||
|
||||
(define blaming-line
|
||||
(let ((blame-parties (%blame-positive blame)))
|
||||
(match blame-parties
|
||||
((one-party)
|
||||
(format #f " blaming: ~a~%" one-party))
|
||||
((multiple-parties ...)
|
||||
(format #f " blaming multiple parties: ~{~a~%~}~%" multiple-parties)))))
|
||||
|
||||
(define assumption-line
|
||||
" (assuming the contract is correct)")
|
||||
|
||||
(define at-line
|
||||
(or (and=> (blame-source blame)
|
||||
(cut format #f "~% at: ~a" <>))
|
||||
""))
|
||||
|
||||
(raise
|
||||
(condition
|
||||
(&contract-violation
|
||||
(message
|
||||
(format #f "~%~a~a~{~a~}~a~a~a~a~a~a"
|
||||
start-of-message
|
||||
(if (string-null? custom-message) "~%" custom-message)
|
||||
context-lines
|
||||
contract-line
|
||||
from-line
|
||||
on-line
|
||||
blaming-line
|
||||
assumption-line
|
||||
at-line))))))
|
||||
|
||||
(define (blame-fmt->string blame fmt)
|
||||
(define original?
|
||||
(blame/important-original? blame))
|
||||
|
||||
(define (tag->str+newline? key val)
|
||||
(define* (kv->str key val)
|
||||
(string-append key " " val))
|
||||
|
||||
(match key
|
||||
;; Racket doesn't use ‘got’, but ‘expected’ vs ‘got’ sounds more natural
|
||||
;; considering directions.
|
||||
((or 'given: 'got:)
|
||||
(values (kv->str (if original? "produced:" "given:") val)
|
||||
#t))
|
||||
((or 'given 'got)
|
||||
(values (kv->str (if original? "produced" "given") val)
|
||||
#f))
|
||||
('expected:
|
||||
(values (kv->str (if original? "promised:" "expected:") val)
|
||||
#t))
|
||||
('expected
|
||||
(values (kv->str (if original? "promised" "expected") val)
|
||||
#f))
|
||||
('received:
|
||||
(values (kv->str (if original? "supplied:" "received:") val)
|
||||
#t))))
|
||||
|
||||
(define (normalize-continued-error-message str)
|
||||
"If STR contains newline (unless at the end), ensure there's a space next to
|
||||
it."
|
||||
(define (not-space? x)
|
||||
(not (equal? x #\space)))
|
||||
|
||||
(define str-newline-normalized
|
||||
(string-replace-substring str "~%" "\n"))
|
||||
|
||||
(if (string-contains str-newline-normalized "\n")
|
||||
(let loop ((chars (string->list str-newline-normalized))
|
||||
(result '()))
|
||||
(if (null? chars)
|
||||
(list->string (reverse result))
|
||||
(match chars
|
||||
((#\newline (? not-space? next) . rest)
|
||||
(loop rest
|
||||
(append (reverse (list #\newline #\space next))
|
||||
result)))
|
||||
((first . rest)
|
||||
(loop rest
|
||||
(cons first result))))))
|
||||
str-newline-normalized))
|
||||
|
||||
(define (build-string old new newline?)
|
||||
(if newline?
|
||||
(string-append old "\n " new)
|
||||
(let ((old (if (string-null? old) ";\n" old))
|
||||
(new (normalize-continued-error-message new)))
|
||||
(if (or (string-suffix? " " old)
|
||||
(string-match "^[\n ]" new))
|
||||
(string-append old new)
|
||||
(string-append old " " new)))))
|
||||
|
||||
(if (string? fmt)
|
||||
fmt
|
||||
(let loop ((strs fmt)
|
||||
(result ""))
|
||||
(if (null? strs)
|
||||
(if (string-null? result)
|
||||
result
|
||||
(string-append result "\n"))
|
||||
(match strs
|
||||
(((? symbol? key) (? string? val) . rest)
|
||||
(let ((str newline? (tag->str+newline? key val)))
|
||||
(loop rest
|
||||
(build-string result str newline?))))
|
||||
((str . rest)
|
||||
(loop rest
|
||||
(build-string result str #f))))))))
|
||||
@@ -0,0 +1,158 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils contract combinators)
|
||||
#:use-module (ice-9 match)
|
||||
#:autoload (rnrs bytevectors) (bytevector?)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-34)
|
||||
#:use-module (srfi srfi-35)
|
||||
#:use-module (guix memoization)
|
||||
#:use-module (rosenthal utils contract impl)
|
||||
#:use-module (rosenthal utils contract blame)
|
||||
#:export (any/c
|
||||
none/c
|
||||
or/c
|
||||
listof/c
|
||||
->/c
|
||||
|
||||
->contract))
|
||||
|
||||
#|
|
||||
|
||||
This module implements contract combinators. To avoid name collisions, all
|
||||
combinator names have a ‘/c’ suffix.
|
||||
|
||||
|#
|
||||
|
||||
(define any/c
|
||||
(make-contract
|
||||
#:name "any/c"
|
||||
#:checker (const #t)))
|
||||
|
||||
(define none/c
|
||||
(make-contract
|
||||
#:name "none/c"
|
||||
#:checker (const #f)))
|
||||
|
||||
(define or/c
|
||||
(memoize
|
||||
(lambda (. ctcs)
|
||||
(let* ((contracts (map ->contract ctcs))
|
||||
(enforcers (map contract-enforcer contracts))
|
||||
(name (compound-contract-name "or/c" contracts) ))
|
||||
(make-contract
|
||||
#:name name
|
||||
#:enforcer
|
||||
(lambda (blame)
|
||||
(define procs
|
||||
(map (lambda (enforcer)
|
||||
(enforcer blame))
|
||||
enforcers))
|
||||
(lambda (val neg-party)
|
||||
(let loop ((procs procs))
|
||||
(if (null? procs)
|
||||
(raise-blame-error blame #:missing-party neg-party
|
||||
'(expected: "~a" got: "~s")
|
||||
name val)
|
||||
(match procs
|
||||
((proc . rest)
|
||||
(guard (c ((contract-violation? c)
|
||||
(loop rest)))
|
||||
(proc val neg-party)))))))))))))
|
||||
|
||||
(define listof/c
|
||||
(mlambda (ctc)
|
||||
(let* ((contract (->contract ctc))
|
||||
(enforcer (contract-enforcer contract)))
|
||||
(make-contract
|
||||
#:name (compound-contract-name "listof/c" (list contract))
|
||||
#:enforcer
|
||||
(lambda (blame)
|
||||
(define proc
|
||||
(enforcer (blame-add-context blame "an element of")))
|
||||
(lambda (val neg-party)
|
||||
(unless (list? val)
|
||||
(raise-blame-error blame #:missing-party neg-party
|
||||
'(expected: "a list of ~a" got: "~s")
|
||||
(contract-name contract)
|
||||
val))
|
||||
(map (lambda (element)
|
||||
(proc element neg-party))
|
||||
val)))))))
|
||||
|
||||
;; TODO: Rewrite as a macro to support define*, multiple return values, and
|
||||
;; ‘any’.
|
||||
(define ->/c
|
||||
(memoize
|
||||
(lambda (. ctcs)
|
||||
(let* ((contracts (map ->contract ctcs))
|
||||
(domain-contracts (drop-right contracts 1))
|
||||
(range-contract (last contracts))
|
||||
(contract-arity (length domain-contracts)))
|
||||
(make-contract
|
||||
#:name (compound-contract-name "->/c" contracts)
|
||||
#:enforcer
|
||||
(lambda (blame)
|
||||
(define domain-blames
|
||||
(map (lambda (index)
|
||||
(let ((position (format #f "the #~a argument of" index)))
|
||||
(blame-add-context blame position #:swap? #t)))
|
||||
(iota contract-arity 1)))
|
||||
(define domain-enforcers
|
||||
(map contract-enforcer domain-contracts))
|
||||
(define range-proc
|
||||
(let ((range-blame (blame-add-context blame "the range of")))
|
||||
((contract-enforcer range-contract) range-blame)))
|
||||
(lambda (val neg-party)
|
||||
(unless (procedure? val)
|
||||
(raise-blame-error blame #:missing-party neg-party
|
||||
'(expected: "a procedure" got: "~s") val))
|
||||
(match (procedure-minimum-arity val)
|
||||
((required optional rest?)
|
||||
(unless (= required contract-arity)
|
||||
(raise-blame-error
|
||||
blame #:missing-party neg-party
|
||||
`(expected: "a procedure that accepts ~a non-keyword argument(s)"
|
||||
got: "~a~%"
|
||||
"which accepts ~a argument(s)")
|
||||
contract-arity
|
||||
val
|
||||
required))))
|
||||
(lambda args
|
||||
(define args*
|
||||
(map (lambda (arg blame enforcer)
|
||||
((enforcer blame) arg neg-party))
|
||||
args
|
||||
domain-blames
|
||||
domain-enforcers))
|
||||
(range-proc (apply val args*) neg-party)))))))))
|
||||
|
||||
|
||||
(define ->contract
|
||||
(mlambda (x)
|
||||
(match x
|
||||
((? contract?) x)
|
||||
((? procedure?)
|
||||
(make-contract
|
||||
#:name (format #f "~s" (or (procedure-name x) '???))
|
||||
#:checker x))
|
||||
((or (? symbol?)
|
||||
(? boolean?)
|
||||
(? keyword?))
|
||||
(make-contract
|
||||
#:name (format #f "~s" x)
|
||||
#:checker (cut eq? x <>)))
|
||||
((or (? string?)
|
||||
(? bytevector?)
|
||||
(? char?)
|
||||
+nan.0)
|
||||
(make-contract
|
||||
#:name (format #f "~s" x)
|
||||
#:checker (cut equal? x <>)))
|
||||
((? number?)
|
||||
(make-contract
|
||||
#:name (format #f "~s" x)
|
||||
#:checker (cut = x <>)))
|
||||
(_ (error (format #f "cannot use as contract: ~s" x))))))
|
||||
@@ -0,0 +1,70 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils contract impl)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (rosenthal utils contract blame)
|
||||
#:export (contract?
|
||||
make-contract
|
||||
contract-name
|
||||
contract-checker
|
||||
contract-enforcer
|
||||
compound-contract-name))
|
||||
|
||||
#|
|
||||
|
||||
This module provides the data representation of contracts.
|
||||
|
||||
When constructing a contract via ‘make-contract’, at least one of a checker or
|
||||
an enforcer must be specified.
|
||||
|
||||
A checker is a predicate function. An enforcer is a function that actually
|
||||
performs the check and either returns the value or raises an error with extra
|
||||
context. If only a checker is provided, an enforcer will be automatically
|
||||
created.
|
||||
|
||||
Note that checkers should only be provided when values can be checked
|
||||
immediately (e.g. checking a value is a number). Checkers don't work well for
|
||||
things like a list of numbers, since we won't know the location and context of a
|
||||
failure.
|
||||
|
||||
Contract combinators may rely on checkers' availability for optimizations.
|
||||
|
||||
Enforcers are "late neg projections" in Racket, which look like the following:
|
||||
|
||||
(lambda (blame)
|
||||
(lambda (val neg-party)
|
||||
...))
|
||||
|
||||
This allows a contract to be partially applied when it's constructed and
|
||||
attached, before the value is actually checked.
|
||||
|
||||
See also (rosenthal utils contract combinators) for more examples, and
|
||||
(rosenthal utils contract combinators) for error reporting of contracts.
|
||||
|
||||
|#
|
||||
|
||||
|
||||
(define-record-type <contract>
|
||||
(%make-contract name checker enforcer)
|
||||
contract?
|
||||
(name contract-name) ; string?
|
||||
(checker contract-checker) ; (or/c #f (->/c any/c boolean?))
|
||||
(enforcer contract-enforcer)) ; (->/c blame? (->/c any/c any/c any/c))
|
||||
|
||||
(define* (make-contract #:key name checker enforcer)
|
||||
(%make-contract
|
||||
name
|
||||
checker
|
||||
(or enforcer
|
||||
(lambda (blame)
|
||||
(lambda (val neg-party)
|
||||
(if (checker val)
|
||||
val
|
||||
(raise-blame-error blame #:missing-party neg-party
|
||||
`(expected: "~a" got: "~s") name val)))))))
|
||||
|
||||
(define (compound-contract-name name ctcs)
|
||||
(format #f "(~a ~a)"
|
||||
name
|
||||
(string-join (map contract-name ctcs) " ")))
|
||||
@@ -15,6 +15,11 @@
|
||||
|
||||
(define* (go-mod-vendor #:key go)
|
||||
(lambda* (src hash-algo hash #:optional name #:key (system (%current-system)))
|
||||
"Return a fixed-output derivation to run \"go mod vendor\" against SRC and
|
||||
use the produced \"vendor\" directory as the result. The derivation is expected
|
||||
to have HASH of type HASH-ALGO (a symbol). File name of the derivation defaults
|
||||
to \"vendored-go-dependencies\" and can be specified by NAME."
|
||||
|
||||
(define nss-certs
|
||||
(module-ref (resolve-interface '(gnu packages nss)) 'nss-certs))
|
||||
|
||||
@@ -26,7 +31,9 @@
|
||||
(guix build utils))
|
||||
;; Support Unicode in file name.
|
||||
(setlocale LC_ALL "C.UTF-8")
|
||||
;; For HTTPS support.
|
||||
;; Use our bundled Go toolchain.
|
||||
(setenv "GOTOOLCHAIN" "local")
|
||||
;; HTTPS support.
|
||||
(setenv "SSL_CERT_DIR" #+(file-append nss-certs "/etc/ssl/certs"))
|
||||
|
||||
((assoc-ref %standard-phases 'unpack) #:source #+src)
|
||||
@@ -37,11 +44,12 @@
|
||||
#:hash hash
|
||||
;; Is a directory.
|
||||
#:recursive? #t
|
||||
#:env-vars '(("GOCACHE" . "/tmp/go-cache")
|
||||
("GOPATH" . "/tmp/go"))
|
||||
#:env-vars
|
||||
'(("GOCACHE" . "/tmp/go-cache")
|
||||
("GOPATH" . "/tmp/go"))
|
||||
;; Honor the user's proxy and locale settings.
|
||||
#:leaked-env-vars '("GOPROXY"
|
||||
"http_proxy" "https_proxy"
|
||||
"LC_ALL" "LC_MESSAGES" "LANG"
|
||||
"COLUMNS")
|
||||
#:local-build? #t)))
|
||||
#:leaked-env-vars
|
||||
'("GOPROXY"
|
||||
"http_proxy" "https_proxy"
|
||||
"LC_ALL" "LC_MESSAGES" "LANG"
|
||||
"COLUMNS"))))
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
ini-file
|
||||
json-file
|
||||
kdl-file
|
||||
kdlv1-file
|
||||
toml-file
|
||||
yaml-file))
|
||||
|
||||
@@ -64,53 +66,100 @@
|
||||
|
||||
;; https://github.com/artyom-poptsov/guile-ini
|
||||
(define (ini-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in INI
|
||||
format."
|
||||
"Return a file-like object, outputing INI file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-ini guile-lib guile-smc)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini #$exp #:port <>))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini #$exp #:port <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (ini))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->ini '#$exp #:port <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://github.com/aconchillo/guile-json
|
||||
(define (json-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in JSON
|
||||
format."
|
||||
"Return a file-like object, outputing JSON file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-json-4)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json #$exp <> #:pretty #t))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json #$exp <> #:pretty #t)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (json))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->json '#$exp <> #:pretty #t)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
(define (kdl-file name exp)
|
||||
(computed-file name
|
||||
(with-imported-modules '((rosenthal utils kdl))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (rosenthal utils kdl))
|
||||
(call-with-output-file #$output
|
||||
(cut display (scm->kdl-string #$exp) <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (rosenthal utils kdl))
|
||||
(call-with-output-file #$output
|
||||
(cut display (scm->kdl-string '#$exp) <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
(define (kdlv1-file name exp)
|
||||
(computed-file name
|
||||
(with-imported-modules '((rosenthal utils kdl))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (rosenthal utils kdl))
|
||||
(call-with-output-file #$output
|
||||
(cut display (scm->kdlv1-string #$exp) <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (rosenthal utils kdl))
|
||||
(call-with-output-file #$output
|
||||
(cut display (scm->kdlv1-string '#$exp) <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://github.com/hylophile/guile-toml
|
||||
;; TODO: TOML writing support is incomplete.
|
||||
;; See https://github.com/hylophile/guile-toml/blob/main/toml/builder.scm.
|
||||
(define (toml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in TOML
|
||||
format."
|
||||
"Return a file-like object, outputing TOML file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-json-4 guile-toml)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml #$exp <>))))
|
||||
(with-extensions (list guile-json-4 guile-toml/dolly)
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml #$exp <>)))
|
||||
#~(begin
|
||||
(use-modules (srfi srfi-26) (toml))
|
||||
(call-with-output-file #$output
|
||||
(cut scm->toml '#$exp <>)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
;; https://gitlab.com/yorgath/guile-yamlpp
|
||||
(define (yaml-file name exp)
|
||||
"Return file-like object NAME, serialized from G-expression EXP in YAML
|
||||
format."
|
||||
"Return a file-like object, outputing YAML file serialized from EXP."
|
||||
(computed-file name
|
||||
(with-extensions (list guile-yamlpp)
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter #$exp)
|
||||
(display (yaml-emitter-string emitter) port))))))
|
||||
(if (gexp? exp)
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter #$exp)
|
||||
(display (yaml-emitter-string emitter) port)))))
|
||||
#~(begin
|
||||
(use-modules (yamlpp))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(let ((emitter (make-yaml-emitter)))
|
||||
(yaml-emit! emitter '#$exp)
|
||||
(display (yaml-emitter-string emitter) port)))))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
@@ -0,0 +1,86 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils kdl)
|
||||
#:use-module (ice-9 format)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-71)
|
||||
#:export (scm->kdl-string
|
||||
scm->kdlv1-string))
|
||||
|
||||
;; https://kdl.dev/spec/
|
||||
|
||||
(define %kdl-v1?
|
||||
(make-parameter #f))
|
||||
|
||||
(define* (value->kdl value #:optional (kdlv1? (%kdl-v1?)))
|
||||
(match value
|
||||
;; Null
|
||||
('null
|
||||
(if kdlv1? "null" "#null"))
|
||||
;; Boolean
|
||||
((or #t 'true)
|
||||
(if kdlv1? "true" "#true"))
|
||||
((or #f 'false)
|
||||
(if kdlv1? "false" "#false"))
|
||||
;; Number
|
||||
((or +inf.0 'inf)
|
||||
"#inf")
|
||||
((or -inf.0 '-inf)
|
||||
"#-inf")
|
||||
((or +nan.0 'nan)
|
||||
"#nan")
|
||||
((? number?)
|
||||
(number->string value))
|
||||
;; String
|
||||
((? symbol?)
|
||||
(symbol->string value))
|
||||
((? string?)
|
||||
(format #f "~s" value))
|
||||
;; Property. Added here for convenience.
|
||||
(_
|
||||
(string-join
|
||||
(map (lambda (x)
|
||||
(format #f "~a=~a"
|
||||
(value->kdl (first x))
|
||||
(value->kdl (second x))))
|
||||
(cdr value))))))
|
||||
|
||||
(define (child-node? x)
|
||||
(and (pair? x)
|
||||
(not (eq? (car x) '@))))
|
||||
|
||||
(define (node->kdl node level)
|
||||
(let* ((name (car node))
|
||||
(children args (partition child-node? (cdr node)))
|
||||
(indent (make-string (* level 8) #\space))
|
||||
(output
|
||||
(string-join
|
||||
(cons (string-append indent (value->kdl name))
|
||||
(map value->kdl args)))))
|
||||
(if (null? children)
|
||||
output
|
||||
(format #f "~a {~%~{~a~%~}~a}"
|
||||
output
|
||||
(map (cut node->kdl <> (1+ level)) children)
|
||||
indent))))
|
||||
|
||||
(define (document->kdl document)
|
||||
(map (cut node->kdl <> 0) document))
|
||||
|
||||
(define (scm->kdl-string scm)
|
||||
(cond
|
||||
((null? scm)
|
||||
"")
|
||||
((not (pair? scm))
|
||||
(value->kdl scm))
|
||||
((eq? (car scm) '*TOP*)
|
||||
(scm->kdl-string (cdr scm)))
|
||||
(else
|
||||
(string-join (document->kdl scm) "\n"))))
|
||||
|
||||
(define (scm->kdlv1-string scm)
|
||||
(parameterize ((%kdl-v1? #t))
|
||||
(scm->kdl-string scm)))
|
||||
@@ -0,0 +1,418 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils nix)
|
||||
;; Guile builtins
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (srfi srfi-71)
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix packages)
|
||||
;; Guix build systems
|
||||
#:use-module (guix build-system trivial)
|
||||
;; Guix packages
|
||||
#:autoload (gnu packages package-management) (nix)
|
||||
#:export (;; Paramaters.
|
||||
%nix-wrapper-default-exclude-env-paths
|
||||
%nix-wrapper-profile-nixpkgs-commit
|
||||
%nix-wrapper-profile-extra-outputs
|
||||
|
||||
%nix-wrapper-shell-default-unset-env-vars
|
||||
|
||||
nix-shell-wrapper
|
||||
nix-wrapper->package nix-shell-wrapper->package
|
||||
with-nix-profile))
|
||||
|
||||
;; Environment variables and subdirectories to exclude in `nix-shell-wrapper'
|
||||
;; and `nix-expressions->profile-build-wrapper', respectively.
|
||||
;;
|
||||
;; This is to avoid adding search paths with incompatible libraries and crashing
|
||||
;; programs. See also GCD 004:
|
||||
;; https://consensus.guix.gnu.org/gcd/004-set-search-paths-without-program-wrappers.html
|
||||
;;
|
||||
;; Valid item format below. Paths are started with `/' and non-string values
|
||||
;; are ignored:
|
||||
;;
|
||||
;; ENV_VAR
|
||||
;; (ENV_VAR . PATH)
|
||||
;; (ENV_VAR . (PATHS ...))
|
||||
(define %nix-wrapper-default-exclude-env-paths
|
||||
(make-parameter
|
||||
'((#f . ("/bin" "/sbin"))
|
||||
"XDG_DATA_DIRS"
|
||||
"XDG_CONFIG_DIRS"
|
||||
;; Glib
|
||||
("GIO_EXTRA_MODULES" . "/lib/gio/modules")
|
||||
("GSETTINGS_SCHEMA_DIR" . "/share/glib-2.0/schemas")
|
||||
;; Qt
|
||||
("QML2_IMPORT_PATH" . "/lib/qt5/qml")
|
||||
("QML_IMPORT_PATH" . "/lib/qt6/qml")
|
||||
("QT_PLUGIN_PATH" . ("/lib/qt5/plugins" "/lib/qt6/plugins")))))
|
||||
|
||||
;; Nixpkgs revision to provide `buildEnv' function when building the profile,
|
||||
;; used by `nix-expressions->profile-build-wrapper'.
|
||||
(define %nix-wrapper-profile-nixpkgs-commit
|
||||
(make-parameter "714a5f8c4ead6b31148d829288440ed033ccc041"))
|
||||
|
||||
;; Additional package outputs to include when building the profile, used by
|
||||
;; `nix-expressions->profile-build-wrapper'.
|
||||
(define %nix-wrapper-profile-extra-outputs
|
||||
(make-parameter '("man" "info")))
|
||||
|
||||
(define (%nix-wrapper-profile-default-exclude-paths)
|
||||
"Subdirectories to exclude when building the profile, used by
|
||||
`nix-expressions->profile-build-wrapper'."
|
||||
(filter identity
|
||||
(append-map (match-lambda
|
||||
((_ . (? string? path)) (list path))
|
||||
((_ (? string? paths) ...) paths)
|
||||
(_ (list #f)))
|
||||
(%nix-wrapper-default-exclude-env-paths))))
|
||||
|
||||
;; Environment variables to unset in the `nix shell' environment, used by
|
||||
;; `nix-shell-wrapper' by default.
|
||||
(define-syntax %nix-wrapper-shell-default-unset-env-vars
|
||||
(identifier-syntax
|
||||
(filter-map (match-lambda
|
||||
((? string? env) env)
|
||||
(((? string? env) . _) env)
|
||||
(_ #f))
|
||||
(%nix-wrapper-default-exclude-env-paths))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Helper utilities to use packages from Nix.
|
||||
;;;
|
||||
|
||||
(define (ensure-list x)
|
||||
(if (list? x)
|
||||
x
|
||||
(list x)))
|
||||
|
||||
(define-record-type <nix-wrapper>
|
||||
(nix-wrapper name command file expressions)
|
||||
nix-wrapper?
|
||||
;; For `nix-wrapper->package', package name.
|
||||
(name nix-wrapper-name) ;string
|
||||
;; For `nix-wrapper->package', command name.
|
||||
(command nix-wrapper-command) ;string
|
||||
;; Wrapper script.
|
||||
(file nix-wrapper-file) ;file-like object
|
||||
;; Nix expression equivalents to Nix dependencies of the wrapper.
|
||||
(expressions nix-wrapper-expressions)) ;list of strings / list of G-expressions
|
||||
|
||||
(define-gexp-compiler (nix-wrapper-compiler (wrapper <nix-wrapper>) system target)
|
||||
(lower-object (nix-wrapper-file wrapper) system #:target target))
|
||||
|
||||
(define (nix-wrapper->package wrapper)
|
||||
"Return a package for nix-wrapper WRAPPER. The package will install a command
|
||||
under its /bin directory, with the command name of WRAPPER.
|
||||
|
||||
Note that packages created by this procedure are not supposed to be used in the
|
||||
build environment and won't be able to interoperate with other packages in
|
||||
practice."
|
||||
(package
|
||||
(name (nix-wrapper-name wrapper))
|
||||
(version "0.0.0")
|
||||
(source #f)
|
||||
(build-system trivial-build-system)
|
||||
(arguments
|
||||
(list #:builder
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
(let ((dest (string-append #$output "/bin/"
|
||||
#$(nix-wrapper-command wrapper))))
|
||||
(mkdir-p (dirname dest))
|
||||
(symlink #$wrapper dest))))))
|
||||
(home-page #f)
|
||||
(synopsis #f)
|
||||
(description #f)
|
||||
(license #f)))
|
||||
|
||||
(define nix-shell-wrapper->package nix-wrapper->package) ;alias
|
||||
|
||||
;; Flake output attribute -> Nix expression
|
||||
;; https://nix.dev/manual/nix/2.34/command-ref/new-cli/nix.html#flake-output-attribute
|
||||
;; 1. flakeref
|
||||
;; (import (builtins.getFlake "FLAKEREF") {})
|
||||
;; 2. flakeref#attrpath
|
||||
;; (import (builtins.getFlake "FLAKEREF") {}).ATTRPATH
|
||||
;; 3. expression
|
||||
;; (EXPRESSION)
|
||||
;; 4. expression + attrpath
|
||||
;; (EXPRESSION).ATTRPATH
|
||||
;; 5. file
|
||||
;; (import "FILE")
|
||||
;; 6. file + attrpath
|
||||
;; (import "FILE").ATTRPATH
|
||||
(define* (installables->nix-expressions #:optional (installables ".")
|
||||
#:key expression)
|
||||
"Return a list of G-expressions to format Nix expressions from Flake output
|
||||
attributes.
|
||||
|
||||
INSTALLABLES (string / list of strings) is specified as Flake output attribute.
|
||||
When EXPRESSION (string / file-like object) is set, INSTALLABLES will be
|
||||
optional and interpreted as attribute path relative to the Nix expression."
|
||||
(define (installable->flakeref+attrpath installable)
|
||||
(if (string-contains installable "#")
|
||||
(apply values (string-split installable #\#))
|
||||
(if expression
|
||||
(values #f installable)
|
||||
(values installable #f))))
|
||||
|
||||
(map (lambda (installable)
|
||||
(let* ((flakeref
|
||||
attrpath
|
||||
(installable->flakeref+attrpath installable))
|
||||
(attrpath
|
||||
(if (and=> attrpath (cut string=? <> "."))
|
||||
#f
|
||||
attrpath)))
|
||||
(match expression
|
||||
((? file-like?)
|
||||
#~(format #f "(import ~s)~a"
|
||||
#$expression
|
||||
(if #$attrpath
|
||||
(string-append "." #$attrpath)
|
||||
"")))
|
||||
((? string?)
|
||||
#~(format #f "(~a)~a"
|
||||
#$expression
|
||||
(if #$attrpath
|
||||
(string-append "." #$attrpath)
|
||||
"")))
|
||||
(_
|
||||
#~(format #f "(import (builtins.getFlake ~s) {})~a"
|
||||
#$flakeref
|
||||
(if #$attrpath
|
||||
(string-append "." #$attrpath)
|
||||
""))))))
|
||||
(ensure-list installables)))
|
||||
|
||||
(define* (nix-expressions->profile-build-wrapper
|
||||
expressions
|
||||
#:key (nix (file-append nix "/bin/nix")))
|
||||
"Return a nix-wrapper that wraps the `nix build' command-line utility and
|
||||
builds a Nix profile if run. Nix daemon is required to use the wrapper.
|
||||
|
||||
The wrapper accepts an optional path argument and will symlink the resulted
|
||||
profile to the path.
|
||||
|
||||
EXPRESSIONS (list of strings / list of G-expressions) can be formatted from
|
||||
`installables->nix-expressions' and specifies packages to be added into the
|
||||
profile.
|
||||
|
||||
NIX (default: (file-append nix \"/bin/nix\"), string / file-like object)
|
||||
specifies the Nix binary to use."
|
||||
(define profile.nix
|
||||
(computed-file "profile.nix"
|
||||
#~(begin
|
||||
(use-modules (ice-9 format)
|
||||
(srfi srfi-1))
|
||||
(call-with-output-file #$output
|
||||
(lambda (port)
|
||||
(format port "\
|
||||
let
|
||||
pkgs = import (builtins.getFlake \"github:NixOS/nixpkgs/~a\") {};
|
||||
in
|
||||
pkgs.buildEnv {
|
||||
name = \"nix-profile-for-search-paths\";
|
||||
paths = [
|
||||
pkgs.shared-mime-info
|
||||
pkgs.desktop-file-utils
|
||||
~{\
|
||||
~a
|
||||
~}\
|
||||
];
|
||||
extraOutputsToInstall = [
|
||||
~{\
|
||||
~s
|
||||
~}\
|
||||
];
|
||||
postBuild = ''
|
||||
if [[ -w $out/share/mime ]] && [[ -d $out/share/mime/packages ]]; then
|
||||
XDG_DATA_DIRS=$out/share ${pkgs.shared-mime-info}/bin/update-mime-database -V $out/share/mime
|
||||
fi
|
||||
if [[ -w $out/share/applications ]]; then
|
||||
${pkgs.desktop-file-utils}/bin/update-desktop-database $out/share/applications
|
||||
fi
|
||||
~{\
|
||||
rm -rf $out~a
|
||||
~}\
|
||||
'';
|
||||
}
|
||||
"
|
||||
#$(%nix-wrapper-profile-nixpkgs-commit)
|
||||
(delete-duplicates (list #$@expressions) string=?)
|
||||
'#$(%nix-wrapper-profile-extra-outputs)
|
||||
'#$(%nix-wrapper-profile-default-exclude-paths)))))
|
||||
#:options '(#:substitutable? #f)))
|
||||
|
||||
(define wrapper
|
||||
(program-file "build-nix-profile-nix-wrapper"
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (ice-9 match)
|
||||
(guix build utils))
|
||||
(match (command-line)
|
||||
((_ . args)
|
||||
(apply invoke #$nix
|
||||
"build" "--print-out-paths"
|
||||
`(,@(if (null? args)
|
||||
(list "--no-link")
|
||||
(list "--out-link" (car args)))
|
||||
"--file" #$profile.nix))))))))
|
||||
|
||||
(nix-wrapper "build-nix-profile-nix-wrapper"
|
||||
"build-nix-profile"
|
||||
wrapper
|
||||
expressions))
|
||||
|
||||
;; See also https://nix.dev/manual/nix/2.34/command-ref/new-cli/nix3-env-shell.html
|
||||
(define* (nix-shell-wrapper name
|
||||
#:optional (installables ".")
|
||||
#:key expression
|
||||
(run-command '())
|
||||
(options '())
|
||||
(environment-keep #t)
|
||||
(environment-unset %nix-wrapper-shell-default-unset-env-vars)
|
||||
(environment-set '())
|
||||
(nix (file-append nix "/bin/nix")))
|
||||
"Return a nix-wrapper that wraps the `nix shell' command-line utility and
|
||||
spawns an one-off software environment if run. Nix daemon is required to use
|
||||
the wrapper.
|
||||
|
||||
INSTALLABLES (string / list of strings) is specified as Flake output attribute
|
||||
and will be added into the environment. When EXPRESSION (string / file-like
|
||||
object) is set, INSTALLABLES will be optional and interpreted as attribute paths
|
||||
relative to the Nix expression.
|
||||
|
||||
RUN-COMMAND (default: '(), list of strings) specifies command and arguments to
|
||||
be executed in the environment. Command-line arguments passed to the wrapper
|
||||
will be appended.
|
||||
|
||||
OPTIONS (default: '(), list of strings) specifies extra options to pass to the
|
||||
`nix shell' command-line utility.
|
||||
|
||||
When ENVIRONMENT-KEEP (default: #t, boolean / list of strings) is set to a value
|
||||
other than #t, the environment will be cleared, keeping only specified
|
||||
environment variables.
|
||||
|
||||
ENVIRONMENT-UNSET (default: %nix-wrapper-shell-default-unset-env-vars, list of
|
||||
strings) unsets specified environment variables from the environment. It's only
|
||||
usable when ENVIRONMENT-KEEP is #t.
|
||||
|
||||
For each key-value pair in ENVIRONMENT-SET (default: '(), association list), the
|
||||
environment sets its corresponding environment variable.
|
||||
|
||||
NIX (default: (file-append nix \"/bin/nix\"), string / file-like object)
|
||||
specifies the Nix binary to use.
|
||||
|
||||
Examples:
|
||||
|
||||
(nix-shell-wrapper \"cowsay-hello-coreutils-env\"
|
||||
'(\"github:NixOS/nixpkgs/nixos-26.05#coreutils\"
|
||||
\"github:NixOS/nixpkgs/nixos-26.05#cowsay\")
|
||||
#:run-command '(\"env\" \"LANG=C.UTF-8\" \"cowsay\" \"hello\"))
|
||||
|
||||
(nix-shell-wrapper \"cowsay-hello\"
|
||||
\"github:NixOS/nixpkgs/nixos-26.05#cowsay\"
|
||||
#:run-command '(\"cowsay\" \"hello\")
|
||||
#:environment-set '((\"LANG\" . \"C.UTF-8\")))
|
||||
|
||||
(nix-shell-wrapper \"python-with-numpy\"
|
||||
#:expression \"with (import (builtins.getFlake \\\"github:NixOS/nixpkgs/nixos-26.05\\\") {}); python3.withPackages (ps: [ps.numpy])\"
|
||||
#:run-command '(\"python\"))
|
||||
|
||||
(nix-shell-wrapper \"coreutils-env\"
|
||||
\"coreutils\"
|
||||
#:expression (local-file \"/tmp/nixpkgs.nix\")
|
||||
#:run-command '(\"env\")
|
||||
#:environment-keep #f)
|
||||
"
|
||||
(define %options
|
||||
(append (match environment-keep
|
||||
(#t
|
||||
(append-map (cut list "--unset-env-var" <>)
|
||||
(lset-difference string=?
|
||||
environment-unset
|
||||
(append
|
||||
(if (boolean? environment-keep)
|
||||
'()
|
||||
environment-keep)
|
||||
(map car environment-set)))))
|
||||
(#f
|
||||
'("--ignore-env"))
|
||||
(_
|
||||
(cons "--ignore-env"
|
||||
(append-map (cut list "--keep-env-var" <>)
|
||||
environment-keep))))
|
||||
(append-map (match-lambda
|
||||
((name . value)
|
||||
(list "--set-env-var" name value)))
|
||||
environment-set)
|
||||
options))
|
||||
|
||||
(define wrapper-name
|
||||
(string-append name "-nix-wrapper"))
|
||||
|
||||
(define wrapper
|
||||
(program-file wrapper-name
|
||||
(with-imported-modules '((guix build utils))
|
||||
#~(begin
|
||||
(use-modules (ice-9 match)
|
||||
(guix build utils))
|
||||
(match (command-line)
|
||||
((_ . args)
|
||||
(apply invoke #$nix
|
||||
"--extra-experimental-features" "nix-command flakes"
|
||||
"shell"
|
||||
#$@%options
|
||||
#$@(match expression
|
||||
((? file-like?)
|
||||
(list "--impure" "--file" expression))
|
||||
((? string?)
|
||||
(list "--impure" "--expr" expression))
|
||||
(_
|
||||
'()))
|
||||
#$@(ensure-list installables)
|
||||
"--command" #$@run-command args)))))))
|
||||
|
||||
(nix-wrapper wrapper-name
|
||||
name
|
||||
wrapper
|
||||
(installables->nix-expressions
|
||||
installables
|
||||
#:expression expression)))
|
||||
|
||||
(define (with-nix-profile packages)
|
||||
"Transform PACKAGES, turning nix-wrapper into packages, additionally adding a
|
||||
new package containing a `build-nix-profile' script created for them by
|
||||
`nix-expressions->profile-build-wrapper'.
|
||||
|
||||
The `build-nix-profile' script accepts an optional path argument and will
|
||||
symlink the resulted profile to that path.
|
||||
|
||||
This procedure is intended for use in Guix System and Guix Home package
|
||||
declarations, along with services `nix-search-paths-service-type' and
|
||||
`home-nix-search-paths-service-type'.
|
||||
|
||||
Example:
|
||||
|
||||
(with-nix-profile
|
||||
(append (list (nix-shell-wrapper \"readest\"
|
||||
'(\"github:NixOS/nixpkgs/714a5f8c4ead6b31148d829288440ed033ccc041#readest\")
|
||||
#:run-command '(\"readest\")
|
||||
#:environment-set '((\"LANG\" . \"C.UTF-8\"))))
|
||||
%base-packages))
|
||||
"
|
||||
(let ((wrappers others (partition nix-wrapper? packages)))
|
||||
(append (list (nix-wrapper->package
|
||||
(nix-expressions->profile-build-wrapper
|
||||
(append-map nix-wrapper-expressions wrappers))))
|
||||
(map nix-wrapper->package wrappers)
|
||||
others)))
|
||||
@@ -0,0 +1,124 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2026 Hilton Chain <hako@ultrarare.space>
|
||||
|
||||
(define-module (rosenthal utils others)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (rosenthal utils file)
|
||||
#:use-module (gnu packages admin)
|
||||
#:use-module (gnu packages base)
|
||||
#:use-module (gnu packages compression)
|
||||
#:use-module (gnu packages curl)
|
||||
#:use-module (gnu packages file)
|
||||
#:use-module (gnu packages gnupg)
|
||||
#:use-module (gnu packages lsof)
|
||||
#:use-module (gnu packages ncdu)
|
||||
#:use-module (gnu packages ncurses)
|
||||
#:use-module (gnu packages password-utils)
|
||||
#:use-module (gnu packages rsync)
|
||||
#:use-module (gnu packages rust-apps)
|
||||
#:use-module (gnu packages ssh)
|
||||
#:use-module (gnu packages sync)
|
||||
#:use-module (gnu packages version-control)
|
||||
#:use-module (gnu packages vim)
|
||||
#:export (%rosenthal-guix-key-dorphine
|
||||
%rosenthal-guix-key-nuporta
|
||||
%rosenthal-guix-key-bocis
|
||||
%rosenthal-guix-key-ignamma
|
||||
|
||||
%rosenthal-ssh-key-hako
|
||||
%rosenthal-ssh-key-hako-deploy
|
||||
%rosenthal-ssh-key-jonathan
|
||||
%rosenthal-ssh-key-podiki
|
||||
|
||||
%rosenthal-network-manager-ipv6-privacy
|
||||
%rosenthal-network-manager-random-mac-address
|
||||
|
||||
%rosenthal-cli-packages))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Guix public keys
|
||||
;;;
|
||||
|
||||
(define %rosenthal-guix-key-dorphine
|
||||
(plain-file "dorphine.pub"
|
||||
"(public-key (ecc (curve Ed25519)
|
||||
(q #A279175682D0DAE3E11268E67E1F3FA47C38D7E509F7725567CF891E248E719F#)))"))
|
||||
|
||||
;; Nonguix head node.
|
||||
(define %rosenthal-guix-key-nuporta
|
||||
(plain-file "nuporta.pub"
|
||||
"(public-key (ecc (curve Ed25519)
|
||||
(q #C1FD53E5D4CE971933EC50C9F307AE2171A2D3B52C804642A7A35F84F3A4EA98#)))"))
|
||||
|
||||
;; aarch64-linux build worker.
|
||||
(define %rosenthal-guix-key-bocis
|
||||
(plain-file "bocis.pub"
|
||||
"(public-key (ecc (curve Ed25519)
|
||||
(q #7927EA1162184C1FAA62D20C111121A4604F00956E69F0FEB89EEE1721647897#)))"))
|
||||
|
||||
;; x86_64-linux + aarch64-linux build worker.
|
||||
(define %rosenthal-guix-key-ignamma
|
||||
(plain-file "ignamma.pub"
|
||||
"(public-key (ecc (curve Ed25519)
|
||||
(q #6FEEB15C4363F9975EB15C908EC911A4362E486DA642431FA2438C0B1C3D55F5#)))"))
|
||||
|
||||
|
||||
;;;
|
||||
;;; SSH public keys
|
||||
;;;
|
||||
|
||||
(define %rosenthal-ssh-key-hako
|
||||
(plain-file "hako.pub"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFcTj1N3cL/bh2Uvwh5/YubhZplPFnvGk/iVHQs3FWV2 openpgp:0x77671915\n"))
|
||||
(define %rosenthal-ssh-key-hako-deploy
|
||||
(plain-file "hako-deploy.pub"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMLWIp8y5/JGBaw+yFA5MFB5nlFpEx/tjc0q0Ij9KjTu\n"))
|
||||
|
||||
(define %rosenthal-ssh-key-jonathan
|
||||
(plain-file "jonathan.pub"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHgzHvP3BRTIZ960LVglrK8w/C0+6Z5VM8/Q5Uwa0o+Z jonathan@3700X\n"))
|
||||
|
||||
(define %rosenthal-ssh-key-podiki
|
||||
(plain-file "podiki.pub"
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDaSmW/3uq5L6ZP6gWmRw5RiTTg0es1PrbAo/x4vkPzwIKTrMFOCBCmcuH3vOCkEZJtNy3OpXbt/a3tDW+cc6dkeq2H4WpogQvyMTXreFS2phMgDTEXW2gGZIP6fA33CHERmhd9A/m0A+NH5KGAmLDQNK8QgPgIjZuseJYtYHNCnN2TCsWQYnbZtVQF5CS6iBUILpVp6p7QlSUokiCGaPjZfrjSFCm1hUPjJYSkv0NTq8TzyDfU2quqP7TBCj4WBi9HoW9+a8tN2TQ/+GYbGqlFljeNdz3vzItcHjidHOQL/42mpvzgZx7o7dtrqX9stp+mI3oBREYSD0bMyvND/dEBRWIbpFvbyYx/leMKq9yUcFNyI2lztk17ObaQkDLxlq4ClytgEtdbP6X0gua29FYK/YlAi13NptK6uy2xB2gsEIt5P4N3u+gZCNA0U3IVd7iMRSpg6PWiL1JguvhYSD5vGOnOjiXVlBCKn+ErTO9Ey/BZqwVBZMeDwynFnU1mYnkxtA+G54VI77gj24FrHw/ClOdJOdBUGAso9P3sFjdykkAJyKd4jiFzpDTOOJNs8qKhmFFzJBnJjn7nzwjElwOCZXdDKTrKqF/51WEqpNr8Za2QjRirV4m7n6FnyyD38b24InAVa+yze3qDI9yk2vjPdtFGCeLODSEjfV3U1z1hiw== cardno:11 465 639\n"))
|
||||
|
||||
|
||||
;;;
|
||||
;;; NetworkManager
|
||||
;;;
|
||||
|
||||
(define %rosenthal-network-manager-ipv6-privacy
|
||||
`("ip6-privacy.conf"
|
||||
,(ini-file "ip6-privacy.conf"
|
||||
'(("connection"
|
||||
. (("ipv6.ip6-privacy" . 2)))))))
|
||||
|
||||
;; NOTE: When using on cloud machines, refer to the terms of the provider
|
||||
;; first.
|
||||
(define %rosenthal-network-manager-random-mac-address
|
||||
`("random-mac-address.conf"
|
||||
,(ini-file "random-mac-address.conf"
|
||||
'(("connection-mac-randomization"
|
||||
. (("ethernet.cloned-mac-address" . "stable")
|
||||
("wifi.cloned-mac-address" . "stable")))))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Packages
|
||||
;;;
|
||||
|
||||
(define %rosenthal-cli-packages
|
||||
(list curl
|
||||
file
|
||||
git
|
||||
`(,git "send-email")
|
||||
glibc
|
||||
gnupg
|
||||
htop
|
||||
mosh
|
||||
ncurses
|
||||
rclone
|
||||
rsync
|
||||
unzip
|
||||
zip))
|
||||
@@ -23,7 +23,9 @@
|
||||
#:use-module (gnu packages base)
|
||||
#:replace (%patch-path
|
||||
search-patch)
|
||||
#:export (rosenthal-patches
|
||||
#:export (sri-hash
|
||||
|
||||
rosenthal-patches
|
||||
%rosenthal-package-module-path
|
||||
all-rosenthal-packages
|
||||
|
||||
@@ -39,6 +41,20 @@
|
||||
binary-package
|
||||
mapping-for-system))
|
||||
|
||||
(define-syntax sri-hash
|
||||
(lambda (stx)
|
||||
(syntax-case stx ()
|
||||
((_ str)
|
||||
(let ((str (syntax->datum #'str)))
|
||||
(and (string? str)
|
||||
(string-index str #\-)))
|
||||
(let* ((str (syntax->datum #'str))
|
||||
(dash (string-index str #\-))
|
||||
(algo (substring str 0 dash))
|
||||
(hash (substring str (1+ dash))))
|
||||
(with-syntax ((algorithm (datum->syntax #'stx (string->symbol algo))))
|
||||
#`(content-hash (base64 #,hash) algorithm)))))))
|
||||
|
||||
(define %rosenthal-root-directory
|
||||
;; This is like %distro-root-directory from (gnu packages), with adjusted
|
||||
;; paths.
|
||||
@@ -166,6 +182,7 @@ packages, excluding superseded packages."
|
||||
(define* (binary-package source-mapping p #:optional (default-system "x86_64-linux"))
|
||||
(package
|
||||
(inherit p)
|
||||
(location (package-location p))
|
||||
(version (package-version (assoc-ref source-mapping default-system)))
|
||||
(source #f)
|
||||
(arguments
|
||||
|
||||
@@ -5,12 +5,23 @@
|
||||
;; Utilities
|
||||
#:use-module (guix gexp)
|
||||
#:export (file-object?
|
||||
file-config?
|
||||
file-object-or-file-config?
|
||||
user-and-group-id?))
|
||||
|
||||
(define (file-object? val)
|
||||
(or (string? val)
|
||||
(or (and (string? val)
|
||||
(string-prefix? "/" val))
|
||||
(file-like? val)))
|
||||
|
||||
(define (file-config? val)
|
||||
(or (gexp? val)
|
||||
(pair? val)))
|
||||
|
||||
(define (file-object-or-file-config? val)
|
||||
(or (file-object? val)
|
||||
(file-config? val)))
|
||||
|
||||
(define (user-and-group-id? val)
|
||||
(or (integer? val)
|
||||
(eqv? val #f)))
|
||||
@@ -0,0 +1,729 @@
|
||||
;;; SPDX-License-Identifier: GPL-3.0-or-later
|
||||
;;; Copyright © 2012-2026 Ludovic Courtès <ludo@gnu.org>
|
||||
;;; Copyright © 2018 Mark H Weaver <mhw@netris.org>
|
||||
;;; Copyright © 2026 coopi <coldsideofyourpillow@disroot.org>
|
||||
|
||||
(define-module (rosenthal utils records)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-9)
|
||||
#:use-module (srfi srfi-11)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:autoload (system syntax) (syntax-local-binding)
|
||||
#:autoload (rosenthal utils contract) (apply-contract/guix-record-field)
|
||||
#:export (define-record-type/dolly
|
||||
this-record
|
||||
|
||||
match-record/dolly
|
||||
match-record-lambda/dolly))
|
||||
|
||||
(define-syntax record-error
|
||||
(syntax-rules ()
|
||||
"Report a syntactic error in use of CONSTRUCTOR."
|
||||
((_ constructor form fmt args ...)
|
||||
(syntax-violation constructor
|
||||
(format #f fmt args ...)
|
||||
form))))
|
||||
|
||||
(eval-when (expand load eval)
|
||||
;; The procedures below are needed both at run time and at expansion time.
|
||||
|
||||
(define %record-constructor-max-argument-count
|
||||
;; Maximum number of positional arguments for record constructors. This
|
||||
;; matches Guile's 'make-record-type', which uses a rest argument above
|
||||
;; that number.
|
||||
20)
|
||||
|
||||
(define (current-abi-identifier type)
|
||||
"Return an identifier unhygienically derived from TYPE for use as its
|
||||
\"current ABI\" variable."
|
||||
(let ((type-name (syntax->datum type)))
|
||||
(datum->syntax
|
||||
type
|
||||
(string->symbol
|
||||
(string-append "% " (symbol->string type-name)
|
||||
" abi-cookie")))))
|
||||
|
||||
(define (record-abi-mismatch-error type)
|
||||
(throw 'record-abi-mismatch-error 'abi-check
|
||||
"~a: record ABI mismatch; recompilation needed"
|
||||
(list type) '()))
|
||||
|
||||
(define (abi-check type cookie)
|
||||
"Return syntax that checks that the current \"application binary
|
||||
interface\" (ABI) for TYPE is equal to COOKIE."
|
||||
(with-syntax ((current-abi (current-abi-identifier type)))
|
||||
#`(unless (eq? current-abi #,cookie)
|
||||
;; The source file where this exception is thrown must be
|
||||
;; recompiled.
|
||||
(record-abi-mismatch-error #,type))))
|
||||
|
||||
(define* (report-invalid-field-specifier name bindings
|
||||
#:optional parent-form)
|
||||
"Report the first invalid binding among BINDINGS. PARENT-FORM is used for
|
||||
error-reporting purposes."
|
||||
(let loop ((bindings bindings))
|
||||
(syntax-case bindings ()
|
||||
(((field value) rest ...) ;good
|
||||
(loop #'(rest ...)))
|
||||
((weird _ ...) ;weird!
|
||||
;; WEIRD may be an identifier, thus lacking source location info, and
|
||||
;; BINDINGS is a list, also lacking source location info. Hopefully
|
||||
;; PARENT-FORM provides source location info.
|
||||
(apply syntax-violation name "invalid field specifier"
|
||||
(if parent-form
|
||||
(list parent-form #'weird)
|
||||
(list #'weird)))))))
|
||||
|
||||
(define (report-duplicate-field-specifier name ctor)
|
||||
"Report the first duplicate identifier among the bindings in CTOR."
|
||||
(syntax-case ctor ()
|
||||
((_ bindings ...)
|
||||
(let loop ((bindings #'(bindings ...))
|
||||
(seen '()))
|
||||
(syntax-case bindings ()
|
||||
(((field value) rest ...)
|
||||
(not (memq (syntax->datum #'field) seen))
|
||||
(loop #'(rest ...) (cons (syntax->datum #'field) seen)))
|
||||
((duplicate rest ...)
|
||||
(syntax-violation name "duplicate field initializer"
|
||||
#'duplicate))
|
||||
(()
|
||||
#t)))))))
|
||||
|
||||
(define-syntax map-fields
|
||||
(lambda (x)
|
||||
(syntax-case x ()
|
||||
((_ type within)
|
||||
(syntax-violation (syntax->datum #'within)
|
||||
"undefined record type"
|
||||
#'type))
|
||||
(_ (syntax-violation 'map-fields "bad use of syntactic keyword" x x)))))
|
||||
|
||||
(define-syntax-parameter this-record
|
||||
(lambda (s)
|
||||
"Return the record being defined. This macro may only be used in the
|
||||
context of the definition of a thunked field."
|
||||
(syntax-case s ()
|
||||
(id
|
||||
(identifier? #'id)
|
||||
(syntax-violation 'this-record
|
||||
"cannot be used outside of a record instantiation"
|
||||
#'id)))))
|
||||
|
||||
(define-syntax make-syntactic-constructor
|
||||
(syntax-rules ()
|
||||
"Make the syntactic constructor NAME for TYPE, that calls CTOR, and
|
||||
expects all of EXPECTED fields to be initialized. DEFAULTS is the list of
|
||||
FIELD/DEFAULT-VALUE tuples, THUNKED is the list of identifiers of thunked
|
||||
fields, DELAYED is the list of identifiers of delayed fields, and SANITIZERS
|
||||
is the list of FIELD/SANITIZER tuples.
|
||||
|
||||
ABI-COOKIE is the cookie (an integer) against which to check the run-time ABI
|
||||
of TYPE matches the expansion-time ABI."
|
||||
((_ type name ctor (expected ...)
|
||||
#:abi-cookie abi-cookie
|
||||
#:thunked thunked
|
||||
#:this-identifier this-identifier
|
||||
#:delayed delayed
|
||||
#:innate innate
|
||||
#:contracts contracts
|
||||
#:sanitizers sanitizers
|
||||
#:defaults defaults)
|
||||
(define-syntax name
|
||||
(lambda (s)
|
||||
(define (constructor-call field-values)
|
||||
(if (< (length '(expected ...))
|
||||
%record-constructor-max-argument-count)
|
||||
#`(ctor #,abi-cookie #,@field-values)
|
||||
#`(apply ctor #,abi-cookie (list #,@field-values))))
|
||||
|
||||
(define (record-inheritance orig-record field+value)
|
||||
;; Produce code that returns a record identical to ORIG-RECORD,
|
||||
;; except that values for the FIELD+VALUE alist prevail.
|
||||
(define (field-inherited-value f)
|
||||
(and=> (find (lambda (x)
|
||||
(eq? f (car (syntax->datum x))))
|
||||
field+value)
|
||||
car))
|
||||
|
||||
;; Make sure there are no unknown field names.
|
||||
(let* ((fields (map (compose car syntax->datum) field+value))
|
||||
(unexpected (lset-difference eq? fields '(expected ...))))
|
||||
(when (pair? unexpected)
|
||||
(record-error 'name s "extraneous field initializers ~a"
|
||||
unexpected)))
|
||||
|
||||
(constructor-call
|
||||
(map (lambda (field index)
|
||||
(or (field-inherited-value field)
|
||||
(if (innate-field? field)
|
||||
(wrap-field-value
|
||||
field (field-default-value field))
|
||||
#`(struct-ref #,orig-record #,index))))
|
||||
'(expected ...)
|
||||
(iota (length '(expected ...))))))
|
||||
|
||||
(define (thunked-field? f)
|
||||
(memq (syntax->datum f) 'thunked))
|
||||
|
||||
(define (delayed-field? f)
|
||||
(memq (syntax->datum f) 'delayed))
|
||||
|
||||
(define (innate-field? f)
|
||||
(memq (syntax->datum f) 'innate))
|
||||
|
||||
(define field-contract
|
||||
(let ((lst (map (match-lambda
|
||||
((f p)
|
||||
(list (syntax->datum f) p)))
|
||||
#'contracts)))
|
||||
(lambda (f)
|
||||
(or (and=> (assoc-ref lst (syntax->datum f)) car)
|
||||
#'any/c))))
|
||||
|
||||
(define field-sanitizer
|
||||
(let ((lst (map (match-lambda
|
||||
((f p)
|
||||
(list (syntax->datum f) p)))
|
||||
#'sanitizers)))
|
||||
(lambda (f)
|
||||
(or (and=> (assoc-ref lst (syntax->datum f)) car)
|
||||
#'identity))))
|
||||
|
||||
(define (field-index f)
|
||||
;; Return the index of F within the record.
|
||||
(let ((f (syntax->datum f)))
|
||||
(let loop ((fields '(expected ...))
|
||||
(index 0))
|
||||
(match fields
|
||||
(()
|
||||
;; Internal error.
|
||||
(record-error 'name s "field not found ~a" f))
|
||||
((head . rest)
|
||||
(if (eq? f head)
|
||||
index
|
||||
(loop rest (+ 1 index))))))))
|
||||
|
||||
(define (check-shadowing identifier)
|
||||
;; Warn if IDENTIFIER shadows a local binding.
|
||||
;; Note: not using (guix diagnostics) to remain independent of
|
||||
;; other Guix modules.
|
||||
(when (eq? 'lexical (syntax-local-binding identifier))
|
||||
(format (current-warning-port)
|
||||
"~a: inherited field binding '~a' of \
|
||||
record type '~a' shadows local variable~%"
|
||||
(match (syntax-source identifier)
|
||||
(#f "<unknown-location>")
|
||||
(lst (format #f "~a:~a:~a"
|
||||
(assq-ref lst 'filename)
|
||||
(and=> (assq-ref lst 'line) 1+)
|
||||
(assq-ref lst 'column))))
|
||||
(syntax->datum identifier)
|
||||
(syntax->datum #'type))))
|
||||
|
||||
(define* (wrap-field-value f value #:optional parent)
|
||||
;; Wrap VALUE, the value of field F, such that its sanitizer is
|
||||
;; called and its properties (thunked, delayed) honored. When
|
||||
;; PARENT is true, bind F to the value inherited from PARENT in the
|
||||
;; lexical scope of VALUE.
|
||||
(let* ((contract (field-contract f))
|
||||
(sanitizer (field-sanitizer f))
|
||||
(contract? (not (eq? (syntax->datum contract) 'any/c)))
|
||||
(sanitizer? (not (eq? (syntax->datum sanitizer) 'identity)))
|
||||
(value
|
||||
(cond
|
||||
((and contract? sanitizer?)
|
||||
#`(#,sanitizer
|
||||
(apply-contract/guix-record-field
|
||||
#,contract
|
||||
#,value
|
||||
#,(symbol->string (syntax->datum (record-type-name type)))
|
||||
#,(symbol->string (syntax->datum #'f)))))
|
||||
(contract?
|
||||
#`(apply-contract/guix-record-field
|
||||
#,contract
|
||||
#,value
|
||||
#,(symbol->string (syntax->datum (record-type-name type)))
|
||||
#,(symbol->string (syntax->datum f))))
|
||||
(sanitizer?
|
||||
#`(#,sanitizer #,value))
|
||||
(else value))))
|
||||
(cond ((thunked-field? f)
|
||||
(if parent
|
||||
;; Compute the value being inherited by calling the
|
||||
;; thunked field F of PARENT with a self-reference for
|
||||
;; the new record being constructed.
|
||||
(with-syntax ((inherited
|
||||
#`((struct-ref #,parent
|
||||
#,(field-index f))
|
||||
#,this-identifier)))
|
||||
(check-shadowing f)
|
||||
#`(lambda (x)
|
||||
(syntax-parameterize ((#,this-identifier
|
||||
(lambda (s)
|
||||
(syntax-case s ()
|
||||
(id
|
||||
(identifier? #'id)
|
||||
#'x)))))
|
||||
;; Bind F, the field identifier, to the value
|
||||
;; being inherited.
|
||||
(let-syntax ((#,f (identifier-syntax inherited)))
|
||||
#,value))))
|
||||
#`(lambda (x)
|
||||
(syntax-parameterize ((#,this-identifier
|
||||
(lambda (s)
|
||||
(syntax-case s ()
|
||||
(id
|
||||
(identifier? #'id)
|
||||
#'x)))))
|
||||
#,value))))
|
||||
((delayed-field? f)
|
||||
#`(delay #,value))
|
||||
(else value))))
|
||||
|
||||
(define default-values
|
||||
;; List of symbol/value tuples.
|
||||
(map (match-lambda
|
||||
((f v)
|
||||
(list (syntax->datum f) v)))
|
||||
#'defaults))
|
||||
|
||||
(define (field-default-value f)
|
||||
(car (assoc-ref default-values (syntax->datum f))))
|
||||
|
||||
(define (field-bindings field+value)
|
||||
;; Return field to value bindings, for use in 'let*' below.
|
||||
(map (lambda (field+value)
|
||||
(syntax-case field+value ()
|
||||
((field value)
|
||||
#`(field
|
||||
#,(wrap-field-value #'field #'value)))))
|
||||
field+value))
|
||||
|
||||
(define (field-bindings/inheritance parent field+value)
|
||||
;; Return field to value bindings, for use in 'let*' below.
|
||||
(map (lambda (field+value)
|
||||
(syntax-case field+value ()
|
||||
((field value)
|
||||
#`(field
|
||||
#,(wrap-field-value #'field #'value parent)))))
|
||||
field+value))
|
||||
|
||||
(syntax-case s (inherit expected ...)
|
||||
((_ (inherit orig-record) (field value) (... ...))
|
||||
#`(let* #,(field-bindings/inheritance #'orig-record
|
||||
#'((field value) (... ...)))
|
||||
#,(abi-check #'type abi-cookie)
|
||||
#,(record-inheritance #'orig-record
|
||||
#'((field value) (... ...)))))
|
||||
((_ (field value) (... ...))
|
||||
(let ((fields (map syntax->datum #'(field (... ...)))))
|
||||
(define (field-value f)
|
||||
(or (find (lambda (x)
|
||||
(eq? f (syntax->datum x)))
|
||||
#'(field (... ...)))
|
||||
(wrap-field-value f (field-default-value f))))
|
||||
|
||||
;; Pass S to make sure source location info is preserved.
|
||||
(report-duplicate-field-specifier 'name s)
|
||||
|
||||
(let ((fields (append fields (map car default-values))))
|
||||
(cond ((lset= eq? fields '(expected ...))
|
||||
#`(let* #,(field-bindings
|
||||
#'((field value) (... ...)))
|
||||
#,(constructor-call
|
||||
(map field-value '(expected ...)))))
|
||||
((pair? (lset-difference eq? fields
|
||||
'(expected ...)))
|
||||
(record-error 'name s
|
||||
"extraneous field initializers ~a"
|
||||
(lset-difference eq? fields
|
||||
'(expected ...))))
|
||||
(else
|
||||
(record-error 'name s
|
||||
"missing field initializers ~a"
|
||||
(lset-difference eq?
|
||||
'(expected ...)
|
||||
fields)))))))
|
||||
((_ bindings (... ...))
|
||||
;; One of BINDINGS doesn't match the (field value) pattern.
|
||||
;; Report precisely which one is faulty, instead of letting the
|
||||
;; "source expression failed to match any pattern" error.
|
||||
(report-invalid-field-specifier 'name
|
||||
#'(bindings (... ...))
|
||||
s))))))))
|
||||
|
||||
(define-syntax-rule (define-field-property-predicate predicate property)
|
||||
"Define PREDICATE as a procedure that takes a syntax object and, when passed
|
||||
a field specification, returns the field name if it has the given PROPERTY."
|
||||
(define (predicate s)
|
||||
(syntax-case s (property)
|
||||
((field (property values (... ...)) _ (... ...))
|
||||
#'field)
|
||||
((field _ properties (... ...))
|
||||
(predicate #'(field properties (... ...))))
|
||||
(_ #f))))
|
||||
|
||||
(define-syntax define-record-type/dolly
|
||||
(lambda (s)
|
||||
"Define the given record type such that an additional \"syntactic
|
||||
constructor\" is defined, which allows instances to be constructed with named
|
||||
field initializers, à la SRFI-35, as well as default values. An example use
|
||||
may look like this:
|
||||
|
||||
(define-record-type* <thing> thing make-thing
|
||||
thing?
|
||||
this-thing
|
||||
(name thing-name (default \"chbouib\"))
|
||||
(port thing-port
|
||||
(default (current-output-port)) (thunked))
|
||||
(loc thing-location (innate) (default (current-source-location))))
|
||||
|
||||
This example defines a macro 'thing' that can be used to instantiate records
|
||||
of this type:
|
||||
|
||||
(thing
|
||||
(name \"foo\")
|
||||
(port (current-error-port)))
|
||||
|
||||
The value of 'name' or 'port' could as well be omitted, in which case the
|
||||
default value specified in the 'define-record-type*' form is used:
|
||||
|
||||
(thing)
|
||||
|
||||
The 'port' field is \"thunked\", meaning that calls like '(thing-port x)' will
|
||||
actually compute the field's value in the current dynamic extent, which is
|
||||
useful when referring to fluids in a field's value. Furthermore, that thunk
|
||||
can access the record it belongs to via the 'this-thing' identifier.
|
||||
|
||||
A field can also be marked as \"delayed\" instead of \"thunked\", in which
|
||||
case its value is effectively wrapped in a (delay …) form.
|
||||
|
||||
A field can also have an associated \"sanitizer\", which is a procedure that
|
||||
takes a user-supplied field value and returns a \"sanitized\" value for the
|
||||
field:
|
||||
|
||||
(define-record-type* <thing> thing make-thing
|
||||
thing?
|
||||
this-thing
|
||||
(name thing-name
|
||||
(sanitize (lambda (value)
|
||||
(cond ((string? value) value)
|
||||
((symbol? value) (symbol->string value))
|
||||
(else (throw 'bad! value)))))))
|
||||
|
||||
It is possible to copy an object 'x' created with 'thing' like this:
|
||||
|
||||
(thing (inherit x) (name \"bar\"))
|
||||
|
||||
This expression returns a new object equal to 'x' except for its 'name'
|
||||
field and its 'loc' field---the latter is marked as \"innate\", so it is not
|
||||
inherited."
|
||||
|
||||
(define (rtd-identifier type)
|
||||
;; Return an identifier derived from TYPE to name its record type
|
||||
;; descriptor (RTD).
|
||||
(let ((type-name (syntax->datum type)))
|
||||
(datum->syntax
|
||||
type
|
||||
(string->symbol
|
||||
(string-append "% " (symbol->string type-name) " rtd")))))
|
||||
|
||||
(define (field-default-value s)
|
||||
(syntax-case s (default)
|
||||
((field (default val) _ ...)
|
||||
(list #'field #'val))
|
||||
((field _ properties ...)
|
||||
(field-default-value #'(field properties ...)))
|
||||
(_ #f)))
|
||||
|
||||
(define (field-contract s)
|
||||
(syntax-case s (contract)
|
||||
((field (contract ctc) _ ...)
|
||||
(list #'field #'ctc))
|
||||
((field _ properties ...)
|
||||
(field-contract #'(field properties ...)))
|
||||
(_ #f)))
|
||||
|
||||
(define (field-sanitizer s)
|
||||
(syntax-case s (sanitize)
|
||||
((field (sanitize proc) _ ...)
|
||||
(list #'field #'proc))
|
||||
((field _ properties ...)
|
||||
(field-sanitizer #'(field properties ...)))
|
||||
(_ #f)))
|
||||
|
||||
(define-field-property-predicate delayed-field? delayed)
|
||||
(define-field-property-predicate thunked-field? thunked)
|
||||
(define-field-property-predicate innate-field? innate)
|
||||
|
||||
(define (wrapped-field? s)
|
||||
(or (thunked-field? s) (delayed-field? s)))
|
||||
|
||||
(define (wrapped-field-accessor-name field)
|
||||
;; Return the name (an unhygienic syntax object) of the "real"
|
||||
;; getter for field, which is assumed to be a wrapped field.
|
||||
(syntax-case field ()
|
||||
((field get properties ...)
|
||||
(let* ((getter (syntax->datum #'get))
|
||||
(real-getter (symbol-append '% getter '-real)))
|
||||
(datum->syntax #'get real-getter)))))
|
||||
|
||||
(define (field-spec->srfi-9 field)
|
||||
;; Convert a field spec of our style to a SRFI-9 field spec of the
|
||||
;; form (field get).
|
||||
(syntax-case field ()
|
||||
((name get properties ...)
|
||||
#`(name
|
||||
#,(if (wrapped-field? field)
|
||||
(wrapped-field-accessor-name field)
|
||||
#'get)))))
|
||||
|
||||
(define (thunked-field-accessor-definition field)
|
||||
;; Return the real accessor for FIELD, which is assumed to be a
|
||||
;; thunked field.
|
||||
(syntax-case field ()
|
||||
((name get _ ...)
|
||||
(with-syntax ((real-get (wrapped-field-accessor-name field)))
|
||||
#'(define-inlinable (get x)
|
||||
;; The real value of that field is a thunk, so call it.
|
||||
((real-get x) x))))))
|
||||
|
||||
(define (delayed-field-accessor-definition field)
|
||||
;; Return the real accessor for FIELD, which is assumed to be a
|
||||
;; delayed field.
|
||||
(syntax-case field ()
|
||||
((name get _ ...)
|
||||
(with-syntax ((real-get (wrapped-field-accessor-name field)))
|
||||
#'(define-inlinable (get x)
|
||||
;; The real value of that field is a promise, so force it.
|
||||
(force (real-get x)))))))
|
||||
|
||||
(define (compute-abi-cookie field-specs)
|
||||
;; Compute an "ABI cookie" for the given FIELD-SPECS. We use
|
||||
;; 'string-hash' because that's a better hash function that 'hash' on a
|
||||
;; list of symbols.
|
||||
(syntax-case field-specs ()
|
||||
(((field get properties ...) ...)
|
||||
;; Passing (target-most-positive-fixnum) as the second argument of
|
||||
;; 'string-hash' won't have the intended effect when cross-compiling
|
||||
;; because that second argument is used to compute a modulo after the
|
||||
;; hash has been computed on an 'unsigned long'. Instead, only keep
|
||||
;; the 32 most significant bits on 64-bit platforms, unconditionally.
|
||||
;; See <https://issues.guix.gnu.org/74296>.
|
||||
(let ((hash-value
|
||||
(string-hash
|
||||
(object->string (syntax->datum #'((field properties ...) ...))))))
|
||||
(cond
|
||||
((< most-positive-fixnum (ash 1 32)) hash-value)
|
||||
((< most-positive-fixnum (ash 1 64)) (ash hash-value -32))
|
||||
(else (error "unexpected!" most-positive-fixnum)))))))
|
||||
|
||||
(syntax-case s ()
|
||||
((_ type syntactic-ctor ctor pred
|
||||
this-identifier
|
||||
(field get properties ...) ...)
|
||||
(identifier? #'this-identifier)
|
||||
(let* ((field-spec #'((field get properties ...) ...))
|
||||
(thunked (filter-map thunked-field? field-spec))
|
||||
(delayed (filter-map delayed-field? field-spec))
|
||||
(innate (filter-map innate-field? field-spec))
|
||||
(defaults (filter-map field-default-value
|
||||
#'((field properties ...) ...)))
|
||||
(contracts (filter-map field-contract
|
||||
#'((field properties ...) ...)))
|
||||
(sanitizers (filter-map field-sanitizer
|
||||
#'((field properties ...) ...)))
|
||||
(cookie (compute-abi-cookie field-spec))
|
||||
(field-count (length field-spec))
|
||||
(constructor-procedure
|
||||
(datum->syntax
|
||||
#'ctor
|
||||
(symbol-append (string->symbol " %")
|
||||
(syntax->datum #'ctor)
|
||||
'-procedure/abi-check))))
|
||||
|
||||
(define (constructor-body)
|
||||
(if (< field-count %record-constructor-max-argument-count)
|
||||
#`(case-lambda
|
||||
((actual-cookie field ...)
|
||||
(unless (eq? actual-cookie #,cookie)
|
||||
(record-abi-mismatch-error type))
|
||||
(ctor field ...))
|
||||
(_
|
||||
(record-abi-mismatch-error type)))
|
||||
#`(case-lambda
|
||||
((actual-cookie . field-values)
|
||||
(unless (and (eq? actual-cookie #,cookie)
|
||||
(= (length field-values)
|
||||
#,field-count))
|
||||
(record-abi-mismatch-error type))
|
||||
(apply ctor field-values))
|
||||
(_
|
||||
(record-abi-mismatch-error type)))))
|
||||
|
||||
(with-syntax ((ctor-procedure constructor-procedure)
|
||||
((field-spec* ...)
|
||||
(map field-spec->srfi-9 field-spec))
|
||||
((field-type ...)
|
||||
(map (match-lambda
|
||||
((? thunked-field?)
|
||||
(datum->syntax s 'thunked))
|
||||
((? delayed-field?)
|
||||
(datum->syntax s 'delayed))
|
||||
(else
|
||||
(datum->syntax s 'normal)))
|
||||
field-spec))
|
||||
((thunked-field-accessor ...)
|
||||
(filter-map (lambda (field)
|
||||
(and (thunked-field? field)
|
||||
(thunked-field-accessor-definition
|
||||
field)))
|
||||
field-spec))
|
||||
((delayed-field-accessor ...)
|
||||
(filter-map (lambda (field)
|
||||
(and (delayed-field? field)
|
||||
(delayed-field-accessor-definition
|
||||
field)))
|
||||
field-spec)))
|
||||
#`(begin
|
||||
(define-record-type #,(rtd-identifier #'type)
|
||||
(ctor field ...)
|
||||
pred
|
||||
field-spec* ...)
|
||||
|
||||
;; Rectify the vtable type name...
|
||||
(set-struct-vtable-name! #,(rtd-identifier #'type) 'type)
|
||||
(cond-expand
|
||||
(guile-3
|
||||
;; ... and the record type name.
|
||||
(struct-set! #,(rtd-identifier #'type) vtable-offset-user
|
||||
'type))
|
||||
(else #f))
|
||||
|
||||
(define-syntax type
|
||||
(lambda (s)
|
||||
"This macro lets us query record type info at
|
||||
macro-expansion time."
|
||||
(syntax-case s (map-fields)
|
||||
((_ (map-fields _ _) macro)
|
||||
#'(macro ((field field-type) ...)))
|
||||
(id
|
||||
(identifier? #'id)
|
||||
#'#,(rtd-identifier #'type)))))
|
||||
|
||||
(define #,(current-abi-identifier #'type)
|
||||
#,cookie)
|
||||
|
||||
#,@(if (free-identifier=? #'this-identifier #'this-record)
|
||||
#'()
|
||||
#'((define-syntax-parameter this-identifier
|
||||
(lambda (s)
|
||||
"Return the record being defined. This macro may
|
||||
only be used in the context of the definition of a thunked field."
|
||||
(syntax-case s ()
|
||||
(id
|
||||
(identifier? #'id)
|
||||
(syntax-violation 'this-identifier
|
||||
"cannot be used outside \
|
||||
of a record instantiation"
|
||||
#'id)))))))
|
||||
thunked-field-accessor ...
|
||||
delayed-field-accessor ...
|
||||
|
||||
(define ctor-procedure
|
||||
;; This procedure is *not* inlined, to reduce code bloat
|
||||
;; (struct initialization takes at least one instruction per
|
||||
;; field).
|
||||
#,(constructor-body))
|
||||
|
||||
(make-syntactic-constructor type syntactic-ctor ctor-procedure
|
||||
(field ...)
|
||||
#:abi-cookie #,cookie
|
||||
#:thunked #,thunked
|
||||
#:this-identifier #'this-identifier
|
||||
#:delayed #,delayed
|
||||
#:innate #,innate
|
||||
#:contracts #,contracts
|
||||
#:sanitizers #,sanitizers
|
||||
#:defaults #,defaults)))))
|
||||
((_ type syntactic-ctor ctor pred
|
||||
(field get properties ...) ...)
|
||||
;; When no 'this' identifier was specified, use 'this-record'.
|
||||
#'(define-record-type/dolly type syntactic-ctor ctor pred
|
||||
this-record
|
||||
(field get properties ...) ...)))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Pattern matching.
|
||||
;;;
|
||||
|
||||
(define-syntax lookup-field+wrapper
|
||||
(lambda (s)
|
||||
"Look up FIELD in the given list and return both an expression that represents
|
||||
its offset in the record and a procedure that wraps it to return its \"true\" value
|
||||
(for instance, FORCE is returned in the case of a delayed field). RECORD is passed
|
||||
to thunked values. Raise a syntax violation when the field is not found."
|
||||
(syntax-case s (normal delayed thunked)
|
||||
((_ record field offset ())
|
||||
(syntax-violation 'match-record
|
||||
"unknown record type field"
|
||||
;; Attach the local source data to the field.
|
||||
(datum->syntax #f (syntax->datum #'field) #:source s)))
|
||||
((_ record field offset ((head normal) tail ...))
|
||||
(free-identifier=? #'field #'head)
|
||||
#'(values offset identity))
|
||||
((_ record field offset ((head delayed) tail ...))
|
||||
(free-identifier=? #'field #'head)
|
||||
#'(values offset force))
|
||||
((_ record field offset ((head thunked) tail ...))
|
||||
(free-identifier=? #'field #'head)
|
||||
#'(values offset (cut <> record)))
|
||||
((_ record field offset (_ tail ...))
|
||||
#'(lookup-field+wrapper record field
|
||||
(+ 1 offset) (tail ...))))))
|
||||
|
||||
(define-syntax match-record-inner
|
||||
(lambda (s)
|
||||
(syntax-case s ()
|
||||
((_ record type ((field variable) rest ...) body ...)
|
||||
#'(let-syntax ((field-offset+wrapper
|
||||
(syntax-rules ()
|
||||
((_ f)
|
||||
(lookup-field+wrapper record field 0 f)))))
|
||||
(let*-values (((offset wrap)
|
||||
(type (map-fields type match-record)
|
||||
field-offset+wrapper))
|
||||
((variable)
|
||||
(wrap (struct-ref record offset))))
|
||||
(match-record-inner record type (rest ...) body ...))))
|
||||
((_ record type (field rest ...) body ...)
|
||||
;; Redirect to the canonical form above.
|
||||
#'(match-record-inner record type ((field field) rest ...) body ...))
|
||||
((_ record type () body ...)
|
||||
#'(begin body ...)))))
|
||||
|
||||
(define-syntax match-record/dolly
|
||||
(syntax-rules ()
|
||||
"Bind each FIELD of a RECORD of the given TYPE to its FIELD name.
|
||||
The order in which fields appear does not matter. A syntax error is raised if
|
||||
an unknown field is queried."
|
||||
((_ record type (fields ...) body ...)
|
||||
(if (eq? (struct-vtable record) type)
|
||||
(match-record-inner record type (fields ...) body ...)
|
||||
(throw 'wrong-type-arg "match-record"
|
||||
"Wrong type (expecting a ~a record): ~S"
|
||||
(list 'type record) (list record))))))
|
||||
|
||||
(define-syntax match-record-lambda/dolly
|
||||
(syntax-rules ()
|
||||
"Return a procedure accepting a single record of the given TYPE for which each
|
||||
FIELD will be bound to its FIELD name within the returned procedure. A syntax error
|
||||
is raised if an unknown field is queried."
|
||||
((_ type (field ...) body ...)
|
||||
(lambda (record)
|
||||
(match-record/dolly record type (field ...)
|
||||
body ...)))))
|
||||
@@ -7,11 +7,44 @@
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-35)
|
||||
;; Utilities
|
||||
#:use-module (guix diagnostics)
|
||||
#:use-module (guix i18n)
|
||||
#:use-module (guix discovery)
|
||||
#:use-module (guix ui)
|
||||
;; Guix System - services
|
||||
#:use-module (gnu services)
|
||||
#:export (modify-services/by-name))
|
||||
#:export (%rosenthal-service-module-path
|
||||
all-rosenthal-services
|
||||
|
||||
modify-services/by-name))
|
||||
|
||||
(define %rosenthal-root-directory
|
||||
;; This is like %distro-root-directory from (gnu packages), with adjusted
|
||||
;; paths.
|
||||
(letrec-syntax ((dirname* (syntax-rules ()
|
||||
((_ file)
|
||||
(dirname file))
|
||||
((_ file head tail ...)
|
||||
(dirname (dirname* file tail ...)))))
|
||||
(try (syntax-rules ()
|
||||
((_ (file things ...) rest ...)
|
||||
(match (search-path %load-path file)
|
||||
(#f
|
||||
(try rest ...))
|
||||
(absolute
|
||||
(dirname* absolute things ...))))
|
||||
((_)
|
||||
#f))))
|
||||
(try ("rosenthal/packages/binaries.scm" rosenthal/ packages/)
|
||||
("rosenthal/packages.scm" rosenthal/))))
|
||||
|
||||
(define %rosenthal-service-module-path
|
||||
`((,%rosenthal-root-directory . "rosenthal/services")
|
||||
(,%rosenthal-root-directory . "rosenthal/home/services")))
|
||||
|
||||
(define (all-rosenthal-services)
|
||||
(fold-service-types cons
|
||||
'()
|
||||
(all-modules %rosenthal-service-module-path
|
||||
#:warn warn-about-load-error)))
|
||||
|
||||
|
||||
;;;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#:use-module (srfi srfi-1)
|
||||
;; Utilities
|
||||
#:use-module (guix channels)
|
||||
#:use-module (guix deprecation)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix utils)
|
||||
@@ -21,52 +22,52 @@
|
||||
#:export (rosenthal-transformation-guix
|
||||
rosenthal-transformation-zfs))
|
||||
|
||||
(define-deprecated rosenthal-transformation-guix
|
||||
#f
|
||||
(lambda* (#:key (substitutes? #t) (channel? #t) (guix-source? #f))
|
||||
(define %rosenthal-signing-keys
|
||||
(list (plain-file "gokuraku.pub"
|
||||
"(public-key (ecc (curve Ed25519) (q #374EC58F5F2EC0412431723AF2D527AD626B049D657B5633AAAEBC694F3E33F9#)))")
|
||||
(plain-file "nuporta.pub"
|
||||
"(public-key (ecc (curve Ed25519) (q #552F670D5005D7EB6ACF05284A1066E52156B51D75DE3EBD3030CD046675D543#)))")))
|
||||
|
||||
(define* (rosenthal-transformation-guix #:key (substitutes? #t)
|
||||
(channel? #t)
|
||||
(guix-source? #f))
|
||||
(define %rosenthal-signing-keys
|
||||
(list (plain-file "gokuraku.pub"
|
||||
"(public-key (ecc (curve Ed25519) (q #374EC58F5F2EC0412431723AF2D527AD626B049D657B5633AAAEBC694F3E33F9#)))")
|
||||
(plain-file "nuporta.pub"
|
||||
"(public-key (ecc (curve Ed25519) (q #552F670D5005D7EB6ACF05284A1066E52156B51D75DE3EBD3030CD046675D543#)))")))
|
||||
(define %rosenthal-channel
|
||||
(channel
|
||||
(name 'rosenthal)
|
||||
(url "https://codeberg.org/hako/rosenthal.git")
|
||||
(branch "trunk")
|
||||
(introduction
|
||||
(make-channel-introduction
|
||||
"7677db76330121a901604dfbad19077893865f35"
|
||||
(openpgp-fingerprint
|
||||
"13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7")))))
|
||||
|
||||
(define %rosenthal-channel
|
||||
(channel
|
||||
(name 'rosenthal)
|
||||
(url "https://codeberg.org/hako/rosenthal.git")
|
||||
(branch "trunk")
|
||||
(introduction
|
||||
(make-channel-introduction
|
||||
"7677db76330121a901604dfbad19077893865f35"
|
||||
(openpgp-fingerprint
|
||||
"13E7 6CD6 E649 C28C 3385 4DF5 5E5A A665 6149 17F7")))))
|
||||
(lambda (os)
|
||||
(operating-system
|
||||
(inherit os)
|
||||
(services
|
||||
(cons* (simple-service 'guix-moe guix-service-type
|
||||
(guix-extension
|
||||
(authorized-keys %rosenthal-signing-keys)
|
||||
(substitute-urls '("https://cache-cdn.guix.moe"))))
|
||||
|
||||
(lambda (os)
|
||||
(operating-system
|
||||
(inherit os)
|
||||
(services
|
||||
(cons* (simple-service 'guix-moe guix-service-type
|
||||
(guix-extension
|
||||
(authorized-keys %rosenthal-signing-keys)
|
||||
(substitute-urls '("https://cache-cdn.guix.moe"))))
|
||||
(modify-services (operating-system-user-services os)
|
||||
(guix-service-type
|
||||
config => (guix-configuration
|
||||
(inherit config)
|
||||
(channels
|
||||
(let ((configured-channels
|
||||
(guix-configuration-channels config)))
|
||||
(if channel?
|
||||
(cons %rosenthal-channel
|
||||
(or configured-channels
|
||||
%default-channels))
|
||||
configured-channels)))
|
||||
(guix
|
||||
(if guix-source?
|
||||
(guix-for-channels channels)
|
||||
(guix-configuration-guix config))))))))))))
|
||||
|
||||
(modify-services (operating-system-user-services os)
|
||||
(guix-service-type
|
||||
config => (guix-configuration
|
||||
(inherit config)
|
||||
(channels
|
||||
(let ((configured-channels
|
||||
(guix-configuration-channels config)))
|
||||
(if channel?
|
||||
(cons %rosenthal-channel
|
||||
(or configured-channels
|
||||
%default-channels))
|
||||
configured-channels)))
|
||||
(guix
|
||||
(if guix-source?
|
||||
(guix-for-channels channels)
|
||||
(guix-configuration-guix config)))))))))))
|
||||
|
||||
;; NOTE: Booting from ZFS requires patching Guix.
|
||||
(define* (rosenthal-transformation-zfs #:key boot? (config (zfs-configuration)))
|
||||
|
||||
+6
-3
@@ -1,8 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
load_path="$(dirname "$(realpath "$0")")/modules"
|
||||
TOP_DIR="$(dirname "$(realpath "$0")")"
|
||||
modules="$TOP_DIR/modules"
|
||||
scripts="$TOP_DIR/etc/scripts"
|
||||
|
||||
export GUILE_LOAD_PATH="${load_path}${GUILE_LOAD_PATH:+:}${GUILE_LOAD_PATH}"
|
||||
export GUIX_PACKAGE_PATH="${load_path}${GUIX_PACKAGE_PATH:+:}${GUIX_PACKAGE_PATH}"
|
||||
export GUILE_LOAD_PATH="${modules}${GUILE_LOAD_PATH:+:}${GUILE_LOAD_PATH}"
|
||||
export GUIX_PACKAGE_PATH="${modules}${GUIX_PACKAGE_PATH:+:}${GUIX_PACKAGE_PATH}"
|
||||
export PATH="${scripts}${PATH:+:}${PATH}"
|
||||
|
||||
exec "$@"
|
||||
Reference in new issue
Block a user