commit da75185780bfce2232e751da3aa84fcca28a470a from: mtmn date: Tue Jul 14 22:48:44 2026 UTC void: add shepherd helper, etc. commit - 423929f93070d59381f38587cd2ed256481a8e9e commit + da75185780bfce2232e751da3aa84fcca28a470a blob - 1ea1666b5e87c42b07abaeb879978beb74ce19fc blob + 7a1f15778b323ce7d30333147de4a8a06d477ed9 --- hosts/void/default.nix +++ hosts/void/default.nix @@ -49,7 +49,6 @@ yq jdupes plakar - recoll ]; vcs = [ @@ -61,8 +60,8 @@ prr tig dura - stgit got + mercurial ]; net = [ @@ -80,7 +79,6 @@ rsync openrsync iperf3 - sshuttle sshs bore-cli ldns @@ -151,11 +149,6 @@ tealdeer ]; - nix = [ - nixd - cachix - ]; - beam = lib.concatLists [ (with beamMinimal29Packages; [rebar3 erlang erlang-language-platform]) [gleam] @@ -183,11 +176,6 @@ gui = [ picard xnviewmp - freerdp - sioyek - halloy - avidemux - supersonic-wayland ]; llm = [ @@ -198,13 +186,14 @@ other = [ babashka - guile haunt - go_1_26 + go gopls zls rustup nim + nixd + gnu-shepherd ]; })); } blob - d7890f835d0920aa84eff1ca11382994d8849dfc blob + 1f0dd25bab0542ffb4b6f815f015536a2f57ceca --- hosts/void/overlays/config/shepherd/init.d/battery-notify.scm +++ hosts/void/overlays/config/shepherd/init.d/battery-notify.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'battery-notify '("battery-notify")) blob - 3dd1f9669954f510716dde7a90b1be4a49957454 blob + 86fdf402016d85d244929d5f5f1356fb3f417c01 --- hosts/void/overlays/config/shepherd/init.d/cliphist.scm +++ hosts/void/overlays/config/shepherd/init.d/cliphist.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'cliphist '("wl-paste" "--watch" "cliphist" "store")) blob - 0ee7387bd902c2edca98407c2596ae79f521ae0f blob + d5a29f0e3b4db5bf7ed4e6b38bcd83b41d8bb73e --- hosts/void/overlays/config/shepherd/init.d/fnott.scm +++ hosts/void/overlays/config/shepherd/init.d/fnott.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'fnott '("fnott")) blob - 990f67e1094a6021172cd1b0b715b029df87ab59 blob + e64eedb1ae666fb225a61f4e7ad564c7d3aa52ff --- hosts/void/overlays/config/shepherd/init.d/hister.scm +++ hosts/void/overlays/config/shepherd/init.d/hister.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'hister '("hister" "listen")) blob - a33c316e34352b8463d3eb91564168370a34cac9 blob + 0018b5ad243aaf53d1586cfa0473d8be71093506 --- hosts/void/overlays/config/shepherd/init.d/kanshi.scm +++ hosts/void/overlays/config/shepherd/init.d/kanshi.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'kanshi '("kanshi")) blob - 09304c6911eff2c72925319adcd8eefc2716e8db blob + 6d6e91b297819b6083a172590173e83093482e55 --- hosts/void/overlays/config/shepherd/init.d/memcached.scm +++ hosts/void/overlays/config/shepherd/init.d/memcached.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'memcached '("memcached")) blob - e339da50cbe82c2f9ce4ef4d7fe2072de8b9c814 blob + 2533b511934fdd81705bffc992d34c54d19b5af4 --- hosts/void/overlays/config/shepherd/init.d/nix-daemon.scm +++ hosts/void/overlays/config/shepherd/init.d/nix-daemon.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'nix-daemon '("nix-daemon")) blob - dc458a7d0d58fdb438904bd22447d4e55c4717a5 blob + 7cb99343966d7a9244a6f576bf6abaff8947261a --- hosts/void/overlays/config/shepherd/init.d/pipewire.scm +++ hosts/void/overlays/config/shepherd/init.d/pipewire.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'pipewire '("pipewire")) blob - 7fa8d625de9bdf259ba9d88c1201f98d748e18bd blob + acfdde30f44ae83c016e156b9b5c5833f7281265 --- hosts/void/overlays/config/shepherd/init.d/psi-notify.scm +++ hosts/void/overlays/config/shepherd/init.d/psi-notify.scm @@ -1,2 +1,3 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'psi-notify '("psi-notify")) blob - 05e9f3832b683dfdfe602e91415e0269e1c42328 blob + f59b1094920f2a35b7c1f8cdd9067e4cb245d259 --- hosts/void/overlays/config/shepherd/init.d/swaybg.scm +++ hosts/void/overlays/config/shepherd/init.d/swaybg.scm @@ -1,4 +1,5 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) (exec-service 'swaybg (list "swaybg" "-m" "fill" "-c" "#0d1612" "-i" (string-append (getenv "HOME") blob - 9bd2f907e28d3de02df2aacf7f787039b2c0c043 blob + 9f701595db7ae8f8b79edf85d53a603b673a309b --- hosts/void/overlays/config/shepherd/init.d/wob.scm +++ hosts/void/overlays/config/shepherd/init.d/wob.scm @@ -1,4 +1,5 @@ ;; -*- mode: scheme; -*- +(use-modules (helpers)) ;; wob reads volume/brightness levels from a FIFO at $XDG_RUNTIME_DIR/wob.sock (exec-service 'wob blob - 740c3450d99aac3e5b09f96119cfd9ff9f9283e0 blob + 2231adce0b02f22cfec0beb8e63ec022453b81fc --- hosts/void/overlays/config/shepherd/init.scm +++ hosts/void/overlays/config/shepherd/init.scm @@ -5,23 +5,14 @@ (shepherd support) ((ice-9 ftw) #:select (scandir))) +(add-to-load-path (string-append %user-config-dir "/modules")) +(use-modules (helpers)) + (default-environment-variables (environ)) ;; Per-service log files live here as .log (mkdir-p %user-log-dir) -(define* (exec-service name command #:key (respawn? #t)) - (let ((svc (service (list name) - #:documentation (string-append "Run " (symbol->string name) ".") - #:start (make-forkexec-constructor - command - #:log-file (string-append %user-log-dir "/" - (symbol->string name) ".log")) - #:stop (make-kill-destructor) - #:respawn? respawn?))) - (register-services (list svc)) - (start-service svc))) - ;; Send Shepherd to the background (perform-service-action root-service 'daemonize) blob - /dev/null blob + fd3e230e7707b463e219c26632648ab3fd3c7983 (mode 644) --- /dev/null +++ hosts/void/overlays/config/shepherd/modules/helpers.scm @@ -0,0 +1,26 @@ +;; -*- mode: scheme; -*- +;;; ~/.config/shepherd/modules/helpers.scm + +(define-module (helpers) + #:use-module (shepherd service) + #:use-module (shepherd support) + #:export (exec-service)) + +;; Register and start NAME running COMMAND (program + args). Idempotent: +;; an existing service by that name is replaced, so re-running the file via +;; `herd load' reloads it in place. +(define* (exec-service name command #:key (respawn? #t)) + (let ((old (lookup-service name))) + (when old + (stop-service old) + (unregister-services (list old)))) + (let ((svc (service (list name) + #:documentation (string-append "Run " (symbol->string name) ".") + #:start (make-forkexec-constructor + command + #:log-file (string-append %user-log-dir "/" + (symbol->string name) ".log")) + #:stop (make-kill-destructor) + #:respawn? respawn?))) + (register-services (list svc)) + (start-service svc))) blob - 98f335b8640b3eece704fe8d1520a7164c71e772 blob + b83bec71adedfef55560f1d694edd1e304830c0b --- modules/mixins/dotfiles/config/shell/rc/functions +++ modules/mixins/dotfiles/config/shell/rc/functions @@ -230,3 +230,11 @@ d() { cd "$target_dir" && magdalena log-dir "$PWD" fi } + +plan() { + T=$(mktemp) + trap 'rm -f "$T"' EXIT + curl -so "$T" https://plan.cat/~mtmn + "$EDITOR" "$T" + curl -su mtmn -F "plan=<$T" https://plan.cat/stdin +} blob - e2e43a2f56224bb0f3355706ad1817511b1cb989 blob + 8d63cc3520374d038d46f2f1889905fc6e937699 --- modules/mixins/dotfiles/npins/sources.json +++ modules/mixins/dotfiles/npins/sources.json @@ -1,83 +1,83 @@ { - "pins": { - "plass": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "omar-polo", - "repo": "plass" - }, - "branch": "main", - "submodules": false, - "revision": "6d50c657de6e3e8504efafbcc536e5cfd5933772", - "url": "https://github.com/omar-polo/plass/archive/6d50c657de6e3e8504efafbcc536e5cfd5933772.tar.gz", - "hash": "sha256-fB3L28wxesvt+YJen+IuS1LaQ4Mkkbnge6kFOaBOzQI=" - }, - "tmux-xpanes": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "greymd", - "repo": "tmux-xpanes" - }, - "branch": "master", - "submodules": false, - "revision": "384b12780759f53056f58fb05645dfac89688da8", - "url": "https://github.com/greymd/tmux-xpanes/archive/384b12780759f53056f58fb05645dfac89688da8.tar.gz", - "hash": "sha256-9lNeKJSWSsJRTu+mmbH+PQlF9so2Snk05mQ+KTKVcxM=" - }, - "zsh-autopair": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "hlissner", - "repo": "zsh-autopair" - }, - "branch": "master", - "submodules": false, - "revision": "449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d", - "url": "https://github.com/hlissner/zsh-autopair/archive/449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d.tar.gz", - "hash": "sha256-3zvOgIi+q7+sTXrT+r/4v98qjeiEL4Wh64rxBYnwJvQ=" - }, - "zsh-autosuggestions": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "zsh-users", - "repo": "zsh-autosuggestions" - }, - "branch": "master", - "submodules": false, - "revision": "85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5", - "url": "https://github.com/zsh-users/zsh-autosuggestions/archive/85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5.tar.gz", - "hash": "sha256-KmkXgK1J6iAyb1FtF/gOa0adUnh1pgFsgQOUnNngBaE=" - }, - "zsh-completions": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "zsh-users", - "repo": "zsh-completions" - }, - "branch": "master", - "submodules": false, - "revision": "9903bae60284072de3fa0e3e20965f22368c5694", - "url": "https://github.com/zsh-users/zsh-completions/archive/9903bae60284072de3fa0e3e20965f22368c5694.tar.gz", - "hash": "sha256-sf02F5TNk8ox2gRulgNKigTBi0GycXPKbaeNGDVC0RI=" - }, - "zsh-histdb": { - "type": "Git", - "repository": { - "type": "GitHub", - "owner": "larkery", - "repo": "zsh-histdb" - }, - "branch": "master", - "submodules": false, - "revision": "90a6c104d0fcc0410d665e148fa7da28c49684eb", - "url": "https://github.com/larkery/zsh-histdb/archive/90a6c104d0fcc0410d665e148fa7da28c49684eb.tar.gz", - "hash": "sha256-vtG1poaRVbfb/wKPChk1WpPgDq+7udLqLfYfLqap4Vg=" - } - }, - "version": 8 + "pins": { + "plass": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "omar-polo", + "repo": "plass" + }, + "branch": "main", + "submodules": false, + "revision": "6d50c657de6e3e8504efafbcc536e5cfd5933772", + "url": "https://github.com/omar-polo/plass/archive/6d50c657de6e3e8504efafbcc536e5cfd5933772.tar.gz", + "hash": "sha256-fB3L28wxesvt+YJen+IuS1LaQ4Mkkbnge6kFOaBOzQI=" + }, + "tmux-xpanes": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "greymd", + "repo": "tmux-xpanes" + }, + "branch": "master", + "submodules": false, + "revision": "384b12780759f53056f58fb05645dfac89688da8", + "url": "https://github.com/greymd/tmux-xpanes/archive/384b12780759f53056f58fb05645dfac89688da8.tar.gz", + "hash": "sha256-9lNeKJSWSsJRTu+mmbH+PQlF9so2Snk05mQ+KTKVcxM=" + }, + "zsh-autopair": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "hlissner", + "repo": "zsh-autopair" + }, + "branch": "master", + "submodules": false, + "revision": "449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d", + "url": "https://github.com/hlissner/zsh-autopair/archive/449a7c3d095bc8f3d78cf37b9549f8bb4c383f3d.tar.gz", + "hash": "sha256-3zvOgIi+q7+sTXrT+r/4v98qjeiEL4Wh64rxBYnwJvQ=" + }, + "zsh-autosuggestions": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "zsh-users", + "repo": "zsh-autosuggestions" + }, + "branch": "master", + "submodules": false, + "revision": "85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5", + "url": "https://github.com/zsh-users/zsh-autosuggestions/archive/85919cd1ffa7d2d5412f6d3fe437ebdbeeec4fc5.tar.gz", + "hash": "sha256-KmkXgK1J6iAyb1FtF/gOa0adUnh1pgFsgQOUnNngBaE=" + }, + "zsh-completions": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "zsh-users", + "repo": "zsh-completions" + }, + "branch": "master", + "submodules": false, + "revision": "9903bae60284072de3fa0e3e20965f22368c5694", + "url": "https://github.com/zsh-users/zsh-completions/archive/9903bae60284072de3fa0e3e20965f22368c5694.tar.gz", + "hash": "sha256-sf02F5TNk8ox2gRulgNKigTBi0GycXPKbaeNGDVC0RI=" + }, + "zsh-histdb": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "larkery", + "repo": "zsh-histdb" + }, + "branch": "master", + "submodules": false, + "revision": "90a6c104d0fcc0410d665e148fa7da28c49684eb", + "url": "https://github.com/larkery/zsh-histdb/archive/90a6c104d0fcc0410d665e148fa7da28c49684eb.tar.gz", + "hash": "sha256-vtG1poaRVbfb/wKPChk1WpPgDq+7udLqLfYfLqap4Vg=" + } + }, + "version": 8 }