nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

commit 9879850bde10194bbad521e99619fa0cf4e0b597
parent e241d1dbc784523ec98fd43492c62cee2096139f
Author: mtmn <miro@haravara.org>
Date:   Thu, 30 Apr 2026 11:48:48 +0200

feat: refactor modules, cleanup, etc.

Diffstat:
Mhosts/proton/default.nix | 170++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mhosts/void/default.nix | 84++++++++++++++++++++++++++++++-------------------------------------------------
Mhosts/void/overlays/config/shell/rc/void | 0
Mhosts/work/default.nix | 0
Mhosts/wsl/default.nix | 20++++++++------------
Mmodules/mixins/dotfiles/bin/isolate | 3+--
Dmodules/mixins/dotfiles/bin/napkins | 11-----------
Mmodules/mixins/dotfiles/config/magdalena/config.json.nix | 32++++----------------------------
Mmodules/mixins/dotfiles/config/nvim/fnl/aliases.fnl | 12------------
Dmodules/mixins/dotfiles/config/plants/devices.toml | 17-----------------
Mmodules/mixins/dotfiles/config/shell/profile/environment | 1-
Mmodules/mixins/dotfiles/config/shell/rc/aliased-short-names | 9+++++----
Mmodules/mixins/dotfiles/config/shell/rc/functions | 4++--
Mmodules/mixins/dotfiles/home/gitignore | 7++-----
Mmodules/services/harmonia.nix | 9++++-----
Mmodules/services/listenbrainz-mpd.nix | 5+++--
Mmodules/services/monitoring.nix | 24++++++++++++++----------
Mmodules/services/mpdscribble.nix | 5+++--
Mmodules/services/static.nix | 11++++++-----
Mmodules/services/storage-box.nix | 15++++++++-------
20 files changed, 177 insertions(+), 262 deletions(-)

diff --git a/hosts/proton/default.nix b/hosts/proton/default.nix @@ -11,94 +11,94 @@ ]; }; - home.packages = with pkgs; - [ - # core - bat - eza - fd - fzf - neovim - ripgrep - moor - tmux - ncurses - tree-sitter - unzip - zoxide - pass - passExtensions.pass-otp + home.packages = with pkgs; [ + # core + bat + eza + fd + fzf + neovim + ripgrep + moor + tmux + ncurses + tree-sitter + unzip + zoxide + pass + passExtensions.pass-otp - # utils - borgbackup - fdupes - gocryptfs - inotify-tools - ncdu - restic - tealdeer - libvarlink - bandit - ruff - shellcheck - shfmt - sops - zls + # utils + borgbackup + fdupes + gocryptfs + inotify-tools + ncdu + restic + tealdeer + libvarlink + bandit + ruff + shellcheck + shfmt + sops + zls - # data (extras beyond dev mixin) - slop + # data (extras beyond dev mixin) + slop - # vcs (extras beyond dev mixin) - git + # vcs (extras beyond dev mixin) + git - # net (extras beyond dev mixin) - caddy - chisel - dnscontrol - dnsmasq - knot-dns - monolith - trickle - w3m + # net (extras beyond dev mixin) + caddy + chisel + dnscontrol + dnsmasq + knot-dns + monolith + trickle + w3m - # build - libgcc - bear - bmake - boost - clang - cmake - ctags - entr - just - act - lld - lldb - llvm - meson - mold - ninja - tre - libtermkey + # build + libgcc + bear + bmake + boost + clang + cmake + ctags + entr + just + act + lld + lldb + llvm + meson + mold + ninja + tre + libtermkey - # perf - bpftools - bpftrace - bpfmon - bpftop - libbpf - below - hyperfine - iotop - pwru - gdb - strace - perf - valgrind - aflplusplus - ] - ++ (with pkgs.beam28Packages; [erlang expert rebar3]) - ++ (with pkgs; [ + # perf + bpftools + bpftrace + bpfmon + bpftop + libbpf + below + hyperfine + iotop + pwru + gdb + strace + perf + valgrind + aflplusplus + ]; + home.packages = lib.concatLists [ + (with pkgs.beam28Packages; [erlang expert rebar3]) + (with pkgs; [ babashka biome gleam @@ -114,8 +114,8 @@ go gopls leiningen - ocaml - # purescript + ocaml # purescript ]) - ++ (with pkgs.luaPackages; [fennel lpeg]); + (with pkgs.luaPackages; [fennel lpeg]) + ]; } diff --git a/hosts/void/default.nix b/hosts/void/default.nix @@ -64,7 +64,7 @@ pinact ]; - net = + net = lib.concatLists [ [ dnscontrol sshfs @@ -77,9 +77,8 @@ aria2 yt-dlp ] - ++ (with python314Packages; [ - yt-dlp-ejs - ]); + (with python314Packages; [yt-dlp-ejs]) + ]; media = [ ncmpcpp @@ -103,7 +102,6 @@ shellcheck ouch shfmt - gron ncdu hyperfine gdb @@ -140,69 +138,51 @@ lorri ]; - php = - [ - php85 - ] - ++ (with php85Packages; [ - composer - ]); + php = lib.concatLists [ + [php85] + (with php85Packages; [composer]) + ]; - javascript = + javascript = lib.concatLists [ [ nodejs_24 purescript esbuild typescript-language-server ] - ++ (with elmPackages; [ + (with elmPackages; [ elm elm-analyse elm-format elm-language-server - ]); - - supercollider = - [ - supercollider - ] - ++ (with supercolliderPlugins; [ - sc3-plugins ]) - ++ (with haskellPackages; [ - tidal-core - tidal - ]); + ]; - haskell = with haskell; - [ - compiler.ghc914 - ] - ++ (with haskellPackages; [ + supercollider = lib.concatLists [ + [supercollider] + (with supercolliderPlugins; [sc3-plugins]) + (with haskellPackages; [tidal-core tidal]) + ]; + + haskell = lib.concatLists [ + (with haskell; [compiler.ghc914]) + (with haskellPackages; [ cabal-install hlint fourmolu haskell-language-server - ]); - - lua = - (with luaPackages; [ - fennel - lua - ]) - ++ [ - fnlfmt - ]; - - beam = - (with beamMinimal28Packages; [ - erlang - rebar3 - erlang-language-platform ]) - ++ [ - gleam - ]; + ]; + + lua = lib.concatLists [ + (with luaPackages; [fennel lua]) + [fnlfmt] + ]; + + beam = lib.concatLists [ + (with beamMinimal28Packages; [erlang rebar3 erlang-language-platform]) + [gleam] + ]; gui = [ picard @@ -213,8 +193,8 @@ llm = [ claude-code - gemini-cli - (antigravity.fhsWithPackages (p: [p.zsh])) + ollama + codex ]; other = [ diff --git a/hosts/void/overlays/config/shell/rc/void b/hosts/void/overlays/config/shell/rc/void Binary files differ. diff --git a/hosts/work/default.nix b/hosts/work/default.nix Binary files differ. diff --git a/hosts/wsl/default.nix b/hosts/wsl/default.nix @@ -50,7 +50,6 @@ shellcheck ouch shfmt - gron ncdu hyperfine gdb @@ -82,19 +81,20 @@ lorri ]; - javascript = + javascript = lib.concatLists [ [ nodejs_24 purescript esbuild typescript-language-server ] - ++ (with elmPackages; [ + (with elmPackages; [ elm elm-analyse elm-format elm-language-server - ]); + ]) + ]; clojure = [ babashka @@ -104,13 +104,9 @@ clojure-lsp ]; - lua = - (with luaPackages; [ - fennel - lua - ]) - ++ [ - fnlfmt - ]; + lua = lib.concatLists [ + (with luaPackages; [fennel lua]) + [fnlfmt] + ]; })); } diff --git a/modules/mixins/dotfiles/bin/isolate b/modules/mixins/dotfiles/bin/isolate @@ -41,10 +41,9 @@ for p in \ done for p in \ - "$HOME/.cargo" \ + "$HOME/.codex" \ "$HOME/.claude" \ "$HOME/.claude.json" \ - "$HOME/.gemini" \ "$(pwd)"; do args+=(--bind "$p" "$p") done diff --git a/modules/mixins/dotfiles/bin/napkins b/modules/mixins/dotfiles/bin/napkins @@ -1,11 +0,0 @@ -#!/bin/bash -set -euo pipefail - -BLOG_DIR="${HOME}/src/codeberg.org/mtmn/napkins" - -pushd "${BLOG_DIR}" > /dev/null - -"$EDITOR" "$BLOG_DIR"/content - -make deploy -popd > /dev/null diff --git a/modules/mixins/dotfiles/config/magdalena/config.json.nix b/modules/mixins/dotfiles/config/magdalena/config.json.nix @@ -1,9 +1,4 @@ -{ - homeDir, - year, - month, - ... -}: '' +{homeDir, ...}: '' { "editor": "nvim", "max_depth": 5, @@ -19,9 +14,6 @@ "_build", ".expert", ".nix-data", - ".crush", - ".gemini", - ".qwen", "saturn" ], "fzf_opts": [ @@ -37,28 +29,17 @@ "fav_dirs": [ "${homeDir}/src", "${homeDir}/src/misc", + "${homeDir}/src/sr.ht", + "${homeDir}/misc", "${homeDir}/misc/www", - "${homeDir}/misc/books", "${homeDir}/misc/llm", - "${homeDir}/src/nix", - "${homeDir}/src/nix/modules/mixins/dotfiles", - "${homeDir}/src/tools", - "${homeDir}/src/tools/terraform", - "${homeDir}/src/releases", - "${homeDir}/src/releases/mixes", - "${homeDir}/src/releases/${year}", - "${homeDir}/src/releases/${year}/${month}", - "${homeDir}/.config/mpd/playlists", - "${homeDir}/misc", + "${homeDir}/misc/books", "${homeDir}/misc/notes", "${homeDir}/misc/notes/nota", "${homeDir}/misc/screenshots", "${homeDir}/misc/recordings", "${homeDir}/misc/random", "${homeDir}/misc/music", - "${homeDir}/misc/music/backlog", - "${homeDir}/misc/music/backlog/_todo", - "${homeDir}/misc/music/backlog/_done", "${homeDir}/Downloads", "${homeDir}/.tmux" ], @@ -82,11 +63,6 @@ "extensions": ["pdf", "epub", "mobi"], "action": "document_reader", "command": "sioyek" - }, - { - "extensions": ["html"], - "action": "web_browser", - "command": "offpunk" } ] } diff --git a/modules/mixins/dotfiles/config/nvim/fnl/aliases.fnl b/modules/mixins/dotfiles/config/nvim/fnl/aliases.fnl @@ -5,15 +5,3 @@ cnoreabbrev mpl %!mpc play") (local home (os.getenv :HOME)) - -(local oil-abbreviations {:mi :/misc/ - :mu :/misc/music/ - :no :/misc/notes/nota/ - :www :/misc/www/ - :rls :/misc/notes/releases/ - :src :/src/ - :nix :/src/nix - :tls :/src/tools}) - -(each [abbrev path (pairs oil-abbreviations)] - (vim.cmd (.. "cnoreabbrev " abbrev " Oil " home path))) diff --git a/modules/mixins/dotfiles/config/plants/devices.toml b/modules/mixins/dotfiles/config/plants/devices.toml @@ -1,17 +0,0 @@ -[buds] -mac = "B8:7B:D4:19:2D:8D" - -[devices.qc35] -mac = "AC:BF:71:09:BF:FD" -text = "🎧" -device_type = "bluetooth" - -[devices.controller] -mac = "98:7A:14:C9:9A:90" -text = "🎮" -device_type = "bluetooth" - -[devices.mx] -mac = "D5:E4:1B:10:D6:77" -text = "🖱️" -device_type = "bluetooth" diff --git a/modules/mixins/dotfiles/config/shell/profile/environment b/modules/mixins/dotfiles/config/shell/profile/environment @@ -11,7 +11,6 @@ export BROWSER=firefox export NSS_DEFAULT_DB_TYPE=sql export BC_ENV_ARGS="$HOME/.config/bcrc" export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" -export GRAB_HOME="$HOME/src" export GOPATH="$HOME/src/misc/go" export MPD_HOST="127.0.0.1" export MPD_PORT="6695" diff --git a/modules/mixins/dotfiles/config/shell/rc/aliased-short-names b/modules/mixins/dotfiles/config/shell/rc/aliased-short-names @@ -10,6 +10,8 @@ alias p='pmn' alias l='ls' alias ll='ls -l' +alias tls='tmux ls' + alias mgr='magdalena grep' alias mgrf='cdg && magdalena grep && cd -' @@ -67,7 +69,7 @@ alias h='histdb' alias hs='histdb-sync' alias nr='newsraft' -alias nre='$EDITOR ~/src/nix/modules/mixins/dotfiles/config/newsraft/feeds' +alias nre='$EDITOR ~/src/sr.ht/nix/modules/mixins/dotfiles/config/newsraft/feeds' alias age_decrypt='age --decrypt --identity "$HOME"/misc/random/key.txt' @@ -90,7 +92,7 @@ alias datamix='datasette serve $HOME/.mixxx/mixxxdb.sqlite --setting sql_time_li alias nb='nix build' alias nd='nix develop' -alias hms='backup nix && nh home switch ~/src/nix' +alias hms='backup nix && nh home switch ~/src/sr.ht/nix' alias amsp='mpva https://radio.stereoscenic.com/asp-s --no-resume-playback' alias nts1='mpva https://stream-relay-geo.ntslive.net/stream --no-resume-playback' @@ -110,8 +112,7 @@ alias bdj='just build' alias dpj='just deploy' alias scr='source ./hack/creds-from-pass' +alias nn='~/src/sr.ht/napkins/nn' alias ag='antigravity .' alias buds='pbpctrl show battery' - -alias tls='tmux ls' diff --git a/modules/mixins/dotfiles/config/shell/rc/functions b/modules/mixins/dotfiles/config/shell/rc/functions @@ -17,7 +17,7 @@ fetch_rss_youtube() { } nvimrecomp() { - nix_fennel_path="$HOME/src/nix/modules/mixins/dotfiles/config/nvim/fnl" + nix_fennel_path="$HOME/src/sr.ht/nix/modules/mixins/dotfiles/config/nvim/fnl" config_path="$HOME/.config/nvim" mkdir -p "$config_path"/lua/config @@ -73,7 +73,7 @@ fetch_rss() { tempfox() { profile_dir=$(mktemp -d) trap 'rm -rf $profile_dir' EXIT - cp ~/src/tools/tempfox/user.js "$profile_dir"/user.js + cp ~/src/sr.ht/tools/tempfox/user.js "$profile_dir"/user.js firefox -no-remote -new-instance -profile "$profile_dir" } diff --git a/modules/mixins/dotfiles/home/gitignore b/modules/mixins/dotfiles/home/gitignore @@ -1,6 +1,3 @@ -.qwen/ -.crush/ .claude/ -.gemini/ -AGENTS.md -CLAUDE.md +.codex +llms.txt diff --git a/modules/services/harmonia.nix b/modules/services/harmonia.nix @@ -98,10 +98,9 @@ in { nix.settings.allowed-users = ["harmonia"]; - systemd.tmpfiles.rules = - [ - "d /var/lib/harmonia 0750 harmonia harmonia -" - ] - ++ (map (keyPath: "f ${keyPath} 0400 harmonia harmonia -") cfg.signKeyPaths); + systemd.tmpfiles.rules = lib.concatLists [ + ["d /var/lib/harmonia 0750 harmonia harmonia -"] + (map (keyPath: "f ${keyPath} 0400 harmonia harmonia -") cfg.signKeyPaths) + ]; }; } diff --git a/modules/services/listenbrainz-mpd.nix b/modules/services/listenbrainz-mpd.nix @@ -61,9 +61,10 @@ in { }; serviceConfig = { - LoadCredential = + LoadCredential = lib.concatLists [ (lib.optional (cfg.mpdHostFile != null) "mpd_host:${toString cfg.mpdHostFile}") - ++ (lib.optional (cfg.tokenFile != null) "token:${toString cfg.tokenFile}"); + (lib.optional (cfg.tokenFile != null) "token:${toString cfg.tokenFile}") + ]; ExecStart = pkgs.writeShellScript "listenbrainz-mpd-start" '' if [ -f "$CREDENTIALS_DIRECTORY/mpd_host" ]; then diff --git a/modules/services/monitoring.nix b/modules/services/monitoring.nix @@ -149,16 +149,20 @@ in { after = ["network.target" "victoriametrics.service"]; serviceConfig = { ExecStart = lib.concatStringsSep " " ( - [ - "${pkgs.victoriametrics}/bin/vmalert" - "-datasource.url=http://127.0.0.1:8428" - "-remoteWrite.url=http://127.0.0.1:8428" - "-httpListenAddr=127.0.0.1:${toString cfg.vmalert.port}" - "-evaluationInterval=30s" - ] - ++ lib.optional cfg.alertmanager.enable - "-notifier.url=http://127.0.0.1:${toString cfg.alertmanager.port}" - ++ map (r: "-rule=${r}") cfg.vmalert.rules + let + baseArgs = [ + "${pkgs.victoriametrics}/bin/vmalert" + "-datasource.url=http://127.0.0.1:8428" + "-remoteWrite.url=http://127.0.0.1:8428" + "-httpListenAddr=127.0.0.1:${toString cfg.vmalert.port}" + "-evaluationInterval=30s" + ]; + alertArgs = lib.optionals cfg.alertmanager.enable [ + "-notifier.url=http://127.0.0.1:${toString cfg.alertmanager.port}" + ]; + ruleArgs = map (r: "-rule=${r}") cfg.vmalert.rules; + in + baseArgs ++ alertArgs ++ ruleArgs ); DynamicUser = true; Restart = "on-failure"; diff --git a/modules/services/mpdscribble.nix b/modules/services/mpdscribble.nix @@ -45,9 +45,10 @@ in { }; serviceConfig = { - LoadCredential = + LoadCredential = lib.concatLists [ (lib.optional (cfg.mpdHostFile != null) "mpd_host:${toString cfg.mpdHostFile}") - ++ (lib.optional (cfg.passwordFile != null) "password:${toString cfg.passwordFile}"); + (lib.optional (cfg.passwordFile != null) "password:${toString cfg.passwordFile}") + ]; ExecStart = pkgs.writeShellScript "mpdscribble-start" '' CONF_FILE="$STATE_DIRECTORY/mpdscribble.conf" diff --git a/modules/services/static.nix b/modules/services/static.nix @@ -35,12 +35,13 @@ in { config = lib.mkIf cfg.enable { users.users.caddy.extraGroups = ["storage-users"]; - systemd.tmpfiles.rules = + systemd.tmpfiles.rules = lib.concatLists [ ["d /var/lib/haravara/static 0755 caddy caddy -"] - ++ lib.mapAttrsToList ( - _: opt: "L+ /var/lib/haravara/static/${opt.dir} - - - - ${staticFiles}/${opt.dir}" - ) - cfg.domains; + (lib.mapAttrsToList ( + _: opt: "L+ /var/lib/haravara/static/${opt.dir} - - - - ${staticFiles}/${opt.dir}" + ) + cfg.domains) + ]; services.caddy.virtualHosts = lib.mapAttrs (domain: opt: { diff --git a/modules/services/storage-box.nix b/modules/services/storage-box.nix @@ -57,24 +57,25 @@ in { environment.systemPackages = [pkgs.cifs-utils]; - systemd.tmpfiles.rules = + systemd.tmpfiles.rules = lib.concatLists [ [ "d ${cfg.mountPoint} - - - -" "d ${cfg.mountPoint}/nixaran - - - -" ] - ++ lib.optionals config.services.haravara.forgejo.enable [ + (lib.optionals config.services.haravara.forgejo.enable [ "d ${cfg.mountPoint}/nixaran/forgejo 0700 forgejo storage-users -" "d ${cfg.mountPoint}/nixaran/forgejo/repositories 0700 forgejo storage-users -" - ] - ++ lib.optionals config.services.haravara.monitoring.enable [ + ]) + (lib.optionals config.services.haravara.monitoring.enable [ "d ${cfg.mountPoint}/nixaran/victoriametrics - - - -" - ] - ++ lib.optionals config.services.haravara.seaweedfs.enable [ + ]) + (lib.optionals config.services.haravara.seaweedfs.enable [ "d ${cfg.mountPoint}/seanix 0755 seaweedfs storage-users -" "d ${cfg.mountPoint}/seanix/master 0755 seaweedfs storage-users -" "d ${cfg.mountPoint}/seanix/volume 0755 seaweedfs storage-users -" "d ${cfg.mountPoint}/seanix/filer 0755 seaweedfs storage-users -" - ]; + ]) + ]; fileSystems = {