nix

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

commit 65a33b6647f8f0520d3b8ce39fa9ab70cc21d0e3
parent 23a34b88da815d94b166bc8c75918c072a4cb2c8
Author: mtmn <miro@haravara.org>
Date:   Wed, 15 Apr 2026 21:58:08 +0200

Merge branch 'master' of ssh://codeberg.org/mtmn/nix

Diffstat:
Mflake.lock | 28++++++++++++++--------------
Mflake.nix | 14+++++++-------
Mhome.nix | 8++++++--
Mhosts.nix | 1+
Mhosts/nixaran/configuration.nix | 0
Mhosts/proton/default.nix | 1+
Mhosts/void/default.nix | 29+++++++----------------------
Ahosts/void/overlays/bin/mics | 16++++++++++++++++
Mhosts/wsl/default.nix | 1+
Mjustfile | 4++--
Mmodules/mixins/dotfiles/config/newsraft/feeds | 1+
Amodules/mixins/dotfiles/config/sccache/config | 6++++++
Mmodules/mixins/dotfiles/config/shell/rc/aliased-short-names | 2+-
Mmodules/mixins/dotfiles/config/shell/rc/prompt-functions | 10+++++-----
Mmodules/mixins/dotfiles/home/cargo/config.toml | 2++
Mmodules/nixos/base.nix | 3---
Mmodules/services/attic.nix | 4++++
Amodules/services/corpus-robo.nix | 5+++++
Mmodules/services/mk-corpus.nix | 6+++---
Mmodules/services/redlib.nix | 21++++++++++++++++-----
Mmodules/services/storage-box.nix | 15---------------
Msecrets.nix | 3+--
Msecrets/corpus-pstmn.age | 0
Asecrets/corpus-robo.age | 0
24 files changed, 99 insertions(+), 81 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -30,17 +30,17 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1776084450, - "narHash": "sha256-hNc2Ddt6F2AhdoVbCVA0/SOgEI4DatSr0TjjSLiGhpc=", + "lastModified": 1776279594, + "narHash": "sha256-N8RdA+ExCkSUcnabRXY8v2vaY1Zt9HfMGyEr1ATavkM=", "ref": "refs/heads/master", - "rev": "78990317aaf6a7f7cd626bd8a9794090c8391657", - "revCount": 57, + "rev": "e83086e5d74a178afbd0da7f2c0a4c4d6b9b883b", + "revCount": 62, "type": "git", - "url": "ssh://git@codeberg.org/mtmn/corpus.git" + "url": "ssh://git@codeberg.org/mtmn/corpus" }, "original": { "type": "git", - "url": "ssh://git@codeberg.org/mtmn/corpus.git" + "url": "ssh://git@codeberg.org/mtmn/corpus" } }, "crane": { @@ -182,11 +182,11 @@ ] }, "locked": { - "lastModified": 1776046499, - "narHash": "sha256-Wzc4nn07/0RL21ypPHRzNDQZcjhIC8LaYo7QJQjM5T4=", + "lastModified": 1776184304, + "narHash": "sha256-No6QGBmIv5ChiwKCcbkxjdEQ/RO2ZS1gD7SFy6EZ7rc=", "owner": "nix-community", "repo": "home-manager", - "rev": "287f84846c1eb3b72c986f5f6bebcff0bd67440d", + "rev": "3c7524c68348ef79ce48308e0978611a050089b2", "type": "github" }, "original": { @@ -255,11 +255,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1775888245, - "narHash": "sha256-nwASzrRDD1JBEu/o8ekKYEXm/oJW6EMCzCRdrwcLe90=", + "lastModified": 1776255774, + "narHash": "sha256-psVTpH6PK3q1htMJpmdz1hLF5pQgEshu7gQWgKO6t6Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "13043924aaa7375ce482ebe2494338e058282925", + "rev": "566acc07c54dc807f91625bb286cb9b321b5f42a", "type": "github" }, "original": { @@ -395,11 +395,11 @@ "rev": "8bf35f488b18b0e0b24b13c51920932021bf8029", "revCount": 28, "type": "git", - "url": "ssh://git@codeberg.org/mtmn/tools.git" + "url": "ssh://git@codeberg.org/mtmn/tools" }, "original": { "type": "git", - "url": "ssh://git@codeberg.org/mtmn/tools.git" + "url": "ssh://git@codeberg.org/mtmn/tools" } }, "utils": { diff --git a/flake.nix b/flake.nix @@ -30,12 +30,12 @@ }; tools = { - url = "git+ssh://git@codeberg.org/mtmn/tools.git"; + url = "git+ssh://git@codeberg.org/mtmn/tools"; flake = false; }; corpus = { - url = "git+ssh://git@codeberg.org/mtmn/corpus.git"; + url = "git+ssh://git@codeberg.org/mtmn/corpus"; }; }; @@ -67,11 +67,11 @@ nix.settings = { substituters = [ "https://cache.nixos.org" - "https://attic.saatana.cat/central" + "https://nix-community.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "central:ljdT0TbVb3yqnBZt1dsWvxvkebyaZqyFEJBFaowLy6c=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; netrc-file = "/run/agenix/netrc"; }; @@ -106,11 +106,11 @@ nix.settings = { substituters = [ "https://cache.nixos.org" - "https://attic.saatana.cat/central" + "https://nix-community.cachix.org" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "central:ljdT0TbVb3yqnBZt1dsWvxvkebyaZqyFEJBFaowLy6c=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" ]; }; } @@ -166,7 +166,6 @@ "couchdb" "oauth2-proxy" "storage-box" - "bazel-cache" "shirt-linkener" "bandeno" "headscale" @@ -176,6 +175,7 @@ "miniflux" "corpus" "corpus-pstmn" + "corpus-robo" "napkins" "listenbrainz-mpd" "redlib" diff --git a/home.nix b/home.nix @@ -41,15 +41,19 @@ auto-optimise-store = true; warn-dirty = false; experimental-features = ["nix-command" "flakes"]; + access-tokens = [ + "attic.saatana.cat=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE4MDc4MzA0ODgsIm5iZiI6MTc3NjI3Mjg4OCwic3ViIjoiaG9tZS1tYW5hZ2VyIiwiaHR0cHM6Ly9qd3QuYXR0aWMucnMvdjEiOnsiY2FjaGVzIjp7ImNlbnRyYWwiOnsiciI6MX19fX0.TnszDyNrf9Y2ll3sW5HHp8JaCCCUWztHzJdMoWoi_bTFYruk4oKj0MKlSbdFUCPKM5xanRu_wbdcINqaOEmM5o7u91Zdg_4Nr036h42xSMkj48QUt1zKbtNwSs65XyfouYnjSlyfJnfRhlhkyDPYxLoMelg6TbNXMSjEgAIRPLbXgAerckRMUW73fL6TyJeGP8jh9xlJfTedER7BWEwMnz3MTu8oLK7IoXKvQTXsuPALbnt84LgwUbaaXeQ6aJrjmZSsncxvezixShXoBwevYx2JpwgVURH54Qoa11u2L4Ffapfi57VD0LkMpA629kCmRpGUJ4_LrD3lrgY070izIKbI0Ktaxf6G2PyIS6bhiziP6Oy_7rj4KmPGsE2Hzyqra0YyIHO9Z-3L1PZhS-3WrL49AcjEPAC9YknU9E-aaabqirf0rWMQjvbHrszzBWpPlALLN3lJVlyL_nm9xVeV_ny4D_-MjpyFgi0MuD0UO2Q5ek0W3RyAY1pr4EbQrLPmYqEAvGbdc9ZGlKTHoPYdLvvcgvDRSn2P_eg2cVri4wzBBrB5Sw3Fss0B8SCT2A7bNaHFQaL6hH3NzL2F0x1O5JbCOqm7cDYMwzvtVKyRpuKLn90F1uuKsYIBt27Ej_ux9pcrXX-R5o_gE-74-lD4qSLWm7eD266R2fnmICCFM-o" + ]; substituters = [ "https://cache.nixos.org" + "https://nix-community.cachix.org" "https://attic.saatana.cat/central" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "central:ljdT0TbVb3yqnBZt1dsWvxvkebyaZqyFEJBFaowLy6c=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "central:7OgUwblUa9YD6dVxXSApAGyC0/oQ/JJUH2puRZ0sv0M=" ]; - netrc-file = "${homeDirectory}/.netrc"; }; gc = { automatic = true; diff --git a/hosts.nix b/hosts.nix @@ -18,6 +18,7 @@ }; SK-M4KCG42FV9 = { system = "aarch64-darwin"; + username = "miroslav.toman"; hostname = "SK-M4KCG42FV9"; }; }; diff --git a/hosts/nixaran/configuration.nix b/hosts/nixaran/configuration.nix Binary files differ. diff --git a/hosts/proton/default.nix b/hosts/proton/default.nix @@ -76,6 +76,7 @@ nvd ragenix statix + attic-client ]; net_tools = with pkgs; [ diff --git a/hosts/void/default.nix b/hosts/void/default.nix @@ -19,8 +19,7 @@ moor buf harper - ccache - hledger-iadd + duc ]; media = @@ -62,8 +61,7 @@ jaq jq datasette - hledger - rainfrog + tokyocabinet ]; vcs = with pkgs; [ @@ -90,9 +88,9 @@ ragenix statix nix-diff - attic-client nix-output-monitor - devenv + niv + attic-client ]; net = with pkgs; [ @@ -137,25 +135,12 @@ fnlfmt ]); - javascript = with pkgs; [ - nodejs - esbuild - purescript - ]; - - beam28 = - (with pkgs.beam28Packages; [ - erlang - rebar3 - ]) - ++ (with pkgs; [ - gleam - ]); - - rest = with pkgs; [ + other = with pkgs; [ miniserve babashka feather + esbuild + nodejs picard rustup ]; diff --git a/hosts/void/overlays/bin/mics b/hosts/void/overlays/bin/mics @@ -0,0 +1,16 @@ +#!/bin/bash + +mics=( + "Family 17h/19h HD Audio Controller Stereo Microphone" + "Family 17h/19h HD Audio Controller Digital Microphone" +) + +for mic in "${mics[@]}"; do + mic_id=$(wpctl status | grep -F "$mic" | grep -o '[0-9]\+' | head -1) + if [ -n "$mic_id" ]; then + echo "Setting $mic ($mic_id) volume to 0" + wpctl set-volume "$mic_id" 0 + else + echo "$mic not found" + fi +done diff --git a/hosts/wsl/default.nix b/hosts/wsl/default.nix @@ -77,6 +77,7 @@ ragenix statix nix-health + attic-client ]; net_tools = with pkgs; [ diff --git a/justfile b/justfile @@ -12,7 +12,7 @@ deadnix: deploy host="nixaran": @backup nix - nix run --fallback github:serokell/deploy-rs .#{{ host }} 2>&1 | grep -vE "unknown flake output '(deploy|configData)'" + nix run --inputs-from . github:serokell/deploy-rs .#{{ host }} 2>&1 | grep -vE "unknown flake output '(deploy|configData)'" update: nix flake update @@ -21,7 +21,7 @@ install host: ./hack/install_anywhere {{ host }} diff host="nixaran": - nix run github:serokell/deploy-rs -- --dry-activate .#{{ host }} 2>&1 | grep -vE "unknown flake output '(deploy|configData)'" + nix run --inputs-from . github:serokell/deploy-rs -- --dry-activate .#{{ host }} 2>&1 | grep -vE "unknown flake output '(deploy|configData)'" local: nh home switch "$(git rev-parse --show-toplevel)" diff --git a/modules/mixins/dotfiles/config/newsraft/feeds b/modules/mixins/dotfiles/config/newsraft/feeds @@ -433,3 +433,4 @@ https://www.youtube.com/feeds/videos.xml?channel_id=UCS0N5baNlQWJCUrhCEo8WlA Ben https://www.youtube.com/feeds/videos.xml?channel_id=UC3S8vxwRfqLBdIhgRlDRVzw stacksmashing https://www.youtube.com/feeds/videos.xml?channel_id=UCd3dNckv1Za2coSaHGHl5aA TJ DeVries https://www.youtube.com/feeds/videos.xml?channel_id=UCaTznQhurW5AaiYPbhEA-KA Molly Rocket +https://www.youtube.com/feeds/videos.xml?channel_id=UC3azLjQuz9s5qk76KEXaTvA suckerpinch diff --git a/modules/mixins/dotfiles/config/sccache/config b/modules/mixins/dotfiles/config/sccache/config @@ -0,0 +1,6 @@ +[cache.s3] +bucket = "sccache" +endpoint = "https://estri.saatana.cat" +region = "us-east-1" +use_ssl = true +no_credentials = false diff --git a/modules/mixins/dotfiles/config/shell/rc/aliased-short-names b/modules/mixins/dotfiles/config/shell/rc/aliased-short-names @@ -25,7 +25,7 @@ alias mrd='magdalena recent-dirs' alias mrf='magdalena recent-files' alias pdm='pkill -f dmenu' -alias pcm='pcmanfm' +alias pcm='pcmanfm & disown' alias duh='du -hs' alias dfh='df -h' diff --git a/modules/mixins/dotfiles/config/shell/rc/prompt-functions b/modules/mixins/dotfiles/config/shell/rc/prompt-functions @@ -1,10 +1,10 @@ # vim: ft=sh _C_RESET=$(tput sgr0) -_C_1=$(tput setaf 141) -_C_2=$(tput setaf 209) -_C_3=$(tput setaf 203) -_C_4=$(tput setaf 174) -_C_6=$(tput setaf 167) +_C_1=$(tput setaf 1) +_C_2=$(tput setaf 3) +_C_3=$(tput setaf 4) +_C_4=$(tput setaf 5) +_C_6=$(tput setaf 6) colour_part() { local colour_val msg delim diff --git a/modules/mixins/dotfiles/home/cargo/config.toml b/modules/mixins/dotfiles/home/cargo/config.toml @@ -1,4 +1,6 @@ [build] +rustc-wrapper = "sccache" +incremental = false rustflags = ["-C", "target-cpu=native", "-C", "link-arg=-fuse-ld=mold"] [profile.release] diff --git a/modules/nixos/base.nix b/modules/nixos/base.nix @@ -13,12 +13,10 @@ substituters = [ "https://cache.nixos.org" "https://nix-community.cachix.org" - "https://attic.saatana.cat/central" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "central:ljdT0TbVb3yqnBZt1dsWvxvkebyaZqyFEJBFaowLy6c=" ]; }; gc = { @@ -26,7 +24,6 @@ dates = "weekly"; options = "--delete-older-than 30d"; }; - # Pin nixpkgs to the flake version for consistency registry.nixpkgs.flake = inputs.nixpkgs; }; diff --git a/modules/services/attic.nix b/modules/services/attic.nix @@ -30,6 +30,10 @@ in { type = lib.types.path; description = "Path to environment file with ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64 and AWS credentials"; }; + signingKeyFile = lib.mkOption { + type = lib.types.path; + description = "Path to the Nix signing private key file (generated with nix-store --generate-binary-cache-key)"; + }; port = lib.mkOption { type = lib.types.port; default = 7381; diff --git a/modules/services/corpus-robo.nix b/modules/services/corpus-robo.nix @@ -0,0 +1,5 @@ +import ./mk-corpus.nix { + optionName = "corpusRobo"; + defaultPort = 8323; + defaultSecretFile = ../../secrets/corpus-robo.age; +} diff --git a/modules/services/mk-corpus.nix b/modules/services/mk-corpus.nix @@ -12,7 +12,7 @@ cfg = config.services.haravara.${optionName}; in { options.services.haravara.${optionName} = { - enable = lib.mkEnableOption "Scorpus - ListenBrainz frontend"; + enable = lib.mkEnableOption "Corpus - ListenBrainz frontend"; port = lib.mkOption { type = lib.types.port; @@ -46,7 +46,7 @@ in { }; systemd.services.${optionName} = { - description = "Scorpus - ListenBrainz frontend"; + description = "Corpus - ListenBrainz frontend"; wantedBy = ["multi-user.target"]; after = ["network.target"]; @@ -56,7 +56,7 @@ in { }; serviceConfig = { - ExecStart = "${inputs.corpus.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/scorpus-server"; + ExecStart = "${inputs.corpus.packages.${pkgs.stdenv.hostPlatform.system}.default}/bin/corpus-server"; EnvironmentFile = config.age.secrets.${optionName}.path; Restart = "always"; User = "corpus"; diff --git a/modules/services/redlib.nix b/modules/services/redlib.nix @@ -7,6 +7,10 @@ in { options.services.haravara.redlib = { enable = lib.mkEnableOption "Redlib Reddit Frontend"; + port = lib.mkOption { + type = lib.types.port; + default = 7828; + }; domain = lib.mkOption { type = lib.types.str; }; @@ -18,10 +22,17 @@ in { }; config = lib.mkIf cfg.enable { - services.redlib = { - enable = false; - port = 7828; - address = "127.0.0.1"; + virtualisation.oci-containers = { + backend = "podman"; + + containers.redlib = { + image = "ghcr.io/silvenga/redlib:latest"; + ports = ["127.0.0.1:${toString cfg.port}:8080"]; + environment = { + REDLIB_DEFAULT_SHOW_NSFW = "off"; + REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION = "on"; + }; + }; }; services.caddy.virtualHosts."${cfg.domain}".extraConfig = '' @@ -30,7 +41,7 @@ in { then "auth" else "auth_${cfg.authLabel}" }"} - reverse_proxy 127.0.0.1:7828 + reverse_proxy 127.0.0.1:${toString cfg.port} ''; }; } diff --git a/modules/services/storage-box.nix b/modules/services/storage-box.nix @@ -69,9 +69,6 @@ in { ++ lib.optionals config.services.haravara.monitoring.enable [ "d ${cfg.mountPoint}/nixaran/victoriametrics - - - -" ] - ++ lib.optionals config.services.haravara.bazel-cache.enable [ - "d ${cfg.mountPoint}/nixaran/bazel-cache 0750 bazel-remote bazel-remote -" - ] ++ lib.optionals config.services.haravara.seaweedfs.enable [ "d ${cfg.mountPoint}/seanix 0755 seaweedfs storage-users -" "d ${cfg.mountPoint}/seanix/master 0755 seaweedfs storage-users -" @@ -118,14 +115,6 @@ in { options = ["bind" "nofail"]; depends = [cfg.mountPoint]; }; - } - // lib.optionalAttrs config.services.haravara.bazel-cache.enable { - "/var/lib/bazel-cache" = { - device = "${cfg.mountPoint}/nixaran/bazel-cache"; - fsType = "none"; - options = ["bind" "nofail" "_netdev"]; - depends = ["${cfg.mountPoint}"]; - }; }; systemd.services = let @@ -151,10 +140,6 @@ in { victoriametrics.after = ["var-lib-victoriametrics.mount"]; victoriametrics.requires = ["var-lib-victoriametrics.mount"]; }) - (lib.mkIf config.services.haravara.bazel-cache.enable { - bazel-remote.after = ["var-lib-bazel\\x2dcache.mount"]; - bazel-remote.requires = ["var-lib-bazel\\x2dcache.mount"]; - }) ]; }; } diff --git a/secrets.nix b/secrets.nix @@ -16,8 +16,7 @@ in { "secrets/miniflux-secrets.age".publicKeys = allKeys; "secrets/listenbrainz-token.age".publicKeys = allKeys; "secrets/mpd-host.age".publicKeys = allKeys; - "secrets/scorpus.age".publicKeys = allKeys; "secrets/corpus.age".publicKeys = allKeys; "secrets/corpus-pstmn.age".publicKeys = allKeys; - "secrets/netrc.age".publicKeys = allKeys; + "secrets/corpus-robo.age".publicKeys = allKeys; } diff --git a/secrets/corpus-pstmn.age b/secrets/corpus-pstmn.age Binary files differ. diff --git a/secrets/corpus-robo.age b/secrets/corpus-robo.age Binary files differ.