From c094b5770c6c2a1c4580b303305f55532d549555 Mon Sep 17 00:00:00 2001 From: sid Date: Mon, 23 Feb 2026 20:50:47 +0100 Subject: [PATCH] initial commit --- .gitignore | 2 + .sops.yaml | 43 + README.md | 3 + apps/deploy/default.nix | 18 + apps/deploy/deploy.sh | 83 + flake.lock | 1821 ++++++++++++++++++++ flake.nix | 186 ++ hosts/16ach6/boot.nix | 7 + hosts/16ach6/default.nix | 77 + hosts/16ach6/hardware.nix | 49 + hosts/16ach6/packages.nix | 10 + hosts/16ach6/secrets/default.nix | 5 + hosts/16ach6/secrets/secrets.yaml | 36 + hosts/16ach6/virtualisation.nix | 42 + hosts/16ach6/winapps.nix | 11 + hosts/16ach6/wireguard.nix | 18 + hosts/nuc8/README.md | 45 + hosts/nuc8/boot.nix | 7 + hosts/nuc8/default.nix | 46 + hosts/nuc8/disks.sh | 49 + hosts/nuc8/hardware.nix | 49 + hosts/nuc8/packages.nix | 8 + hosts/pc/boot.nix | 7 + hosts/pc/default.nix | 49 + hosts/pc/disks.sh | 63 + hosts/pc/hardware.nix | 50 + hosts/pc/networking.nix | 7 + hosts/pc/packages.nix | 10 + hosts/pc/secrets/default.nix | 5 + hosts/pc/secrets/secrets.yaml | 28 + hosts/pc/services.nix | 32 + hosts/rv2/boot.nix | 7 + hosts/rv2/default.nix | 58 + hosts/rv2/disks.nix | 90 + hosts/rv2/disks.sh | 49 + hosts/rv2/hardware.nix | 50 + hosts/rv2/packages.nix | 8 + hosts/rv2/secrets/default.nix | 5 + hosts/rv2/secrets/secrets.yaml | 30 + hosts/rv2/services.nix | 52 + modules/home/common/default.nix | 13 + modules/home/common/overlays.nix | 12 + modules/home/default.nix | 3 + modules/nixos/anything-llm-oci/default.nix | 30 + modules/nixos/appimage/default.nix | 6 + modules/nixos/common/default.nix | 8 + modules/nixos/common/nix.nix | 29 + modules/nixos/common/overlays.nix | 12 + modules/nixos/default.nix | 13 + modules/nixos/docker/default.nix | 9 + modules/nixos/docs/default.nix | 19 + modules/nixos/forgejo-runner/default.nix | 79 + modules/nixos/monero/default.nix | 111 ++ modules/nixos/nh/default.nix | 18 + modules/nixos/syncthing/default.nix | 86 + modules/nixos/tailscale/default.nix | 11 + modules/nixos/wine/default.nix | 10 + overlays/default.nix | 45 + overlays/instaloader.nix | 12 + overlays/zathura.nix | 19 + pkgs/default.nix | 16 + pkgs/gitingest/default.nix | 100 ++ pkgs/gitingest/default_nix-init.nix | 68 + pkgs/open-webui-desktop/default.nix | 60 + pkgs/otp/default.nix | 15 + pkgs/otp/otp.sh | 25 + pkgs/pdf2printable/default.nix | 39 + pkgs/spotify-to-tidal/default.nix | 44 + pkgs/transcribe/default.nix | 22 + pkgs/transcribe/setup.py | 7 + pkgs/transcribe/transcribe | 47 + pkgs/udiskie-dmenu/Cargo.lock | 1241 +++++++++++++ pkgs/udiskie-dmenu/Cargo.toml | 9 + pkgs/udiskie-dmenu/default.nix | 13 + pkgs/udiskie-dmenu/src/main.rs | 190 ++ pkgs/yt2rss/default.nix | 15 + pkgs/yt2rss/yt2rss.sh | 21 + shell.nix | 9 + users/sid/default.nix | 16 + users/sid/home/default.nix | 18 + users/sid/home/git.nix | 9 + users/sid/home/home.nix | 12 + users/sid/home/hosts/16ach6/default.nix | 48 + users/sid/home/hosts/nuc8/default.nix | 40 + users/sid/home/hosts/pc/default.nix | 14 + users/sid/home/hosts/rv2/default.nix | 34 + users/sid/home/hyprland/README.md | 128 ++ users/sid/home/hyprland/anyrun.nix | 103 ++ users/sid/home/hyprland/default.nix | 34 + users/sid/home/hyprland/flatpak.nix | 38 + users/sid/home/hyprland/fzf-open.nix | 35 + users/sid/home/hyprland/gpg.nix | 12 + users/sid/home/hyprland/hyprland.nix | 49 + users/sid/home/hyprland/librewolf.nix | 13 + users/sid/home/hyprland/newsboat.nix | 12 + users/sid/home/hyprland/nextcloud-sync.nix | 29 + users/sid/home/hyprland/obs-studio.nix | 9 + users/sid/home/hyprland/opencode.nix | 10 + users/sid/home/hyprland/packages.nix | 84 + users/sid/home/hyprland/rclone.nix | 23 + users/sid/home/hyprland/recoll.nix | 31 + users/sid/home/hyprland/shell-aliases.nix | 11 + users/sid/home/hyprland/spotify-player.nix | 47 + users/sid/home/hyprland/ssh-hosts.nix | 54 + users/sid/home/hyprland/stylix.nix | 16 + users/sid/home/hyprland/vscode.nix | 19 + users/sid/home/hyprland/waybar.nix | 19 + users/sid/home/hyprland/xdg.nix | 18 + users/sid/home/hyprland/yazi.nix | 33 + users/sid/home/nixvim.nix | 113 ++ users/sid/home/secrets/default.nix | 19 + users/sid/home/secrets/secrets.yaml | 27 + users/sid/pubkeys/gpg.pub | 1 + 113 files changed, 6879 insertions(+) create mode 100644 .gitignore create mode 100644 .sops.yaml create mode 100644 README.md create mode 100644 apps/deploy/default.nix create mode 100644 apps/deploy/deploy.sh create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hosts/16ach6/boot.nix create mode 100644 hosts/16ach6/default.nix create mode 100644 hosts/16ach6/hardware.nix create mode 100644 hosts/16ach6/packages.nix create mode 100644 hosts/16ach6/secrets/default.nix create mode 100644 hosts/16ach6/secrets/secrets.yaml create mode 100644 hosts/16ach6/virtualisation.nix create mode 100644 hosts/16ach6/winapps.nix create mode 100644 hosts/16ach6/wireguard.nix create mode 100644 hosts/nuc8/README.md create mode 100644 hosts/nuc8/boot.nix create mode 100644 hosts/nuc8/default.nix create mode 100644 hosts/nuc8/disks.sh create mode 100644 hosts/nuc8/hardware.nix create mode 100644 hosts/nuc8/packages.nix create mode 100644 hosts/pc/boot.nix create mode 100644 hosts/pc/default.nix create mode 100644 hosts/pc/disks.sh create mode 100644 hosts/pc/hardware.nix create mode 100644 hosts/pc/networking.nix create mode 100644 hosts/pc/packages.nix create mode 100644 hosts/pc/secrets/default.nix create mode 100644 hosts/pc/secrets/secrets.yaml create mode 100644 hosts/pc/services.nix create mode 100644 hosts/rv2/boot.nix create mode 100644 hosts/rv2/default.nix create mode 100644 hosts/rv2/disks.nix create mode 100644 hosts/rv2/disks.sh create mode 100644 hosts/rv2/hardware.nix create mode 100644 hosts/rv2/packages.nix create mode 100644 hosts/rv2/secrets/default.nix create mode 100644 hosts/rv2/secrets/secrets.yaml create mode 100644 hosts/rv2/services.nix create mode 100644 modules/home/common/default.nix create mode 100644 modules/home/common/overlays.nix create mode 100644 modules/home/default.nix create mode 100644 modules/nixos/anything-llm-oci/default.nix create mode 100644 modules/nixos/appimage/default.nix create mode 100644 modules/nixos/common/default.nix create mode 100644 modules/nixos/common/nix.nix create mode 100644 modules/nixos/common/overlays.nix create mode 100644 modules/nixos/default.nix create mode 100644 modules/nixos/docker/default.nix create mode 100644 modules/nixos/docs/default.nix create mode 100644 modules/nixos/forgejo-runner/default.nix create mode 100644 modules/nixos/monero/default.nix create mode 100644 modules/nixos/nh/default.nix create mode 100644 modules/nixos/syncthing/default.nix create mode 100644 modules/nixos/tailscale/default.nix create mode 100644 modules/nixos/wine/default.nix create mode 100644 overlays/default.nix create mode 100644 overlays/instaloader.nix create mode 100644 overlays/zathura.nix create mode 100644 pkgs/default.nix create mode 100644 pkgs/gitingest/default.nix create mode 100644 pkgs/gitingest/default_nix-init.nix create mode 100644 pkgs/open-webui-desktop/default.nix create mode 100644 pkgs/otp/default.nix create mode 100644 pkgs/otp/otp.sh create mode 100644 pkgs/pdf2printable/default.nix create mode 100644 pkgs/spotify-to-tidal/default.nix create mode 100644 pkgs/transcribe/default.nix create mode 100644 pkgs/transcribe/setup.py create mode 100644 pkgs/transcribe/transcribe create mode 100644 pkgs/udiskie-dmenu/Cargo.lock create mode 100644 pkgs/udiskie-dmenu/Cargo.toml create mode 100644 pkgs/udiskie-dmenu/default.nix create mode 100644 pkgs/udiskie-dmenu/src/main.rs create mode 100644 pkgs/yt2rss/default.nix create mode 100644 pkgs/yt2rss/yt2rss.sh create mode 100644 shell.nix create mode 100644 users/sid/default.nix create mode 100644 users/sid/home/default.nix create mode 100644 users/sid/home/git.nix create mode 100644 users/sid/home/home.nix create mode 100644 users/sid/home/hosts/16ach6/default.nix create mode 100644 users/sid/home/hosts/nuc8/default.nix create mode 100644 users/sid/home/hosts/pc/default.nix create mode 100644 users/sid/home/hosts/rv2/default.nix create mode 100644 users/sid/home/hyprland/README.md create mode 100644 users/sid/home/hyprland/anyrun.nix create mode 100644 users/sid/home/hyprland/default.nix create mode 100644 users/sid/home/hyprland/flatpak.nix create mode 100644 users/sid/home/hyprland/fzf-open.nix create mode 100644 users/sid/home/hyprland/gpg.nix create mode 100644 users/sid/home/hyprland/hyprland.nix create mode 100644 users/sid/home/hyprland/librewolf.nix create mode 100644 users/sid/home/hyprland/newsboat.nix create mode 100644 users/sid/home/hyprland/nextcloud-sync.nix create mode 100644 users/sid/home/hyprland/obs-studio.nix create mode 100644 users/sid/home/hyprland/opencode.nix create mode 100644 users/sid/home/hyprland/packages.nix create mode 100644 users/sid/home/hyprland/rclone.nix create mode 100644 users/sid/home/hyprland/recoll.nix create mode 100644 users/sid/home/hyprland/shell-aliases.nix create mode 100644 users/sid/home/hyprland/spotify-player.nix create mode 100644 users/sid/home/hyprland/ssh-hosts.nix create mode 100644 users/sid/home/hyprland/stylix.nix create mode 100644 users/sid/home/hyprland/vscode.nix create mode 100644 users/sid/home/hyprland/waybar.nix create mode 100644 users/sid/home/hyprland/xdg.nix create mode 100644 users/sid/home/hyprland/yazi.nix create mode 100644 users/sid/home/nixvim.nix create mode 100644 users/sid/home/secrets/default.nix create mode 100644 users/sid/home/secrets/secrets.yaml create mode 100644 users/sid/pubkeys/gpg.pub diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d5d0e7a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +target diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..caf6979 --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,43 @@ +keys: + - &host_16ach6 age1km907lx69fwvmwgt7rspkuyxtkdrhr7r7t0mw20e5rymsu364exs3rl28q + - &host_sid age1ytfze9tv5l80ujqfd66xp97w2u0lq8jrx45ulf0szey8ny0t837sdktdzf + - &host_rv2 age1j6s2ec3ltm9004fhvmd7xqq0zna2fr4m8kw4f235r9k0hfryjctq050vs2 + - &host_pc age1zdd344x69n8umt2qjjvz8pjnt43lacvvqfdquc5jqz4x9x7pnu3sg0as0k + - &host_rx4 age10mkn2jgwpue7gy92vwjqp4j4j9qyh5enrzw8j82v872yflawvvkqhqde34 + - &host_vde age1mc07jayz4dpwenh06fzlcgfzk5t7ln0z3n65emwlm5r7nq59m4jstd7y8u + - &user_sid age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy +creation_rules: + - path_regex: hosts/16ach6/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_16ach6 + - path_regex: hosts/sid/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_sid + - path_regex: hosts/rv2/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_rv2 + - path_regex: hosts/pc/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_pc + - path_regex: hosts/rx4/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_rx4 + - path_regex: hosts/vde/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid + - *host_vde + - path_regex: users/sid/home/secrets/secrets.yaml$ + key_groups: + - age: + - *user_sid diff --git a/README.md b/README.md new file mode 100644 index 0000000..b530f41 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# NixOS and Home Manager configurations + +This repository is a collection of personal NixOS configurations with standalone Home Manager powered by [*synix*](https://git.sid.ovh/sid/synix). diff --git a/apps/deploy/default.nix b/apps/deploy/default.nix new file mode 100644 index 0000000..e52dc58 --- /dev/null +++ b/apps/deploy/default.nix @@ -0,0 +1,18 @@ +{ + writeShellApplication, + jq, + ... +}: + +let + name = "deploy"; + text = builtins.readFile ./${name}.sh; +in +writeShellApplication { + inherit name text; + meta.mainProgram = name; + + runtimeInputs = [ + jq + ]; +} diff --git a/apps/deploy/deploy.sh b/apps/deploy/deploy.sh new file mode 100644 index 0000000..ff9aa52 --- /dev/null +++ b/apps/deploy/deploy.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash + +# defaults +FLAKE_URI="." +CONFIG_FILE="./deploy.json" +ACTION="switch" +USE_SUDO=true +DO_BUILD=true + +usage() { + cat < $1\033[0m"; } +success() { echo -e "\033[0;32m$1\033[0m"; } +error() { echo -e "\033[0;31mError: $1\033[0m" >&2; exit 1; } + +while [[ $# -gt 0 ]]; do + case "$1" in + switch|boot|test) ACTION="$1"; shift ;; + -f|--flake) FLAKE_URI="$2"; shift 2 ;; + -c|--config) CONFIG_FILE="$2"; shift 2 ;; + --no-sudo) USE_SUDO=false; shift ;; + --skip-build) DO_BUILD=false; shift ;; + -h|--help) usage; exit 0 ;; + *) error "Invalid argument '$1'" ;; + esac +done + +command -v jq &> /dev/null || error "jq is not installed." +[ -f "$CONFIG_FILE" ] || error "Config '$CONFIG_FILE' not found." + +BUILD_HOST=$(jq -r '.buildHost // "localhost"' "$CONFIG_FILE") +[[ "$BUILD_HOST" =~ ^(127\.0\.0\.1|::1)$ ]] && BUILD_HOST="localhost" + +mapfile -t HOSTS < <(jq -r '.hosts[]' "$CONFIG_FILE") +[ ${#HOSTS[@]} -eq 0 ] && error "No hosts defined in $CONFIG_FILE" + +echo "Action: $ACTION" +echo "Flake: $FLAKE_URI" +echo "Builder: $BUILD_HOST" +echo "Targets: ${HOSTS[*]}" + +if [ "$DO_BUILD" = true ]; then + _status "Building configurations..." + for host in "${HOSTS[@]}"; do + echo "------------------------------------------------" + echo "Building host '$host':" + + CMD=("nixos-rebuild" "build" "--flake" "${FLAKE_URI}#${host}") + [[ "$BUILD_HOST" != "localhost" ]] && CMD+=("--build-host" "$BUILD_HOST") + + "${CMD[@]}" || error "Build failed for $host" + success "Build for host '$host' successful." + done +fi + +_status "Deploying to targets..." +for host in "${HOSTS[@]}"; do + echo "------------------------------------------------" + echo "Deploying to host '$host':" + + CMD=("nixos-rebuild" "$ACTION" "--flake" "${FLAKE_URI}#${host}" "--target-host" "$host") + [[ "$BUILD_HOST" != "localhost" ]] && CMD+=("--build-host" "$BUILD_HOST") + [[ "$USE_SUDO" = true ]] && CMD+=("--sudo" "--ask-sudo-password") + + "${CMD[@]}" || error "Activation failed for $host" + success "Host '$host' updated." +done + +success "Deployment complete." diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..fb1b243 --- /dev/null +++ b/flake.lock @@ -0,0 +1,1821 @@ +{ + "nodes": { + "anyrun": { + "inputs": { + "anyrun-provider": "anyrun-provider", + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1764756094, + "narHash": "sha256-KEEJLERvo04AsPo/SWHFJUmHaGGOVjUoGwA9e8GVIQQ=", + "owner": "anyrun-org", + "repo": "anyrun", + "rev": "cacdf2e00cf95211bd2c7971c4037b21870bc2c9", + "type": "github" + }, + "original": { + "owner": "anyrun-org", + "repo": "anyrun", + "type": "github" + } + }, + "anyrun-provider": { + "inputs": { + "nixpkgs": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764705714, + "narHash": "sha256-4rN2vWicM6Pn6eTo3Nu7IB5isbkc9u4arNMnY2+S8iM=", + "owner": "anyrun-org", + "repo": "anyrun-provider", + "rev": "88a786e6029733a4c02c2c6b1024f65029b0b9cf", + "type": "github" + }, + "original": { + "owner": "anyrun-org", + "repo": "anyrun-provider", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1765809053, + "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + } + }, + "base16-fish_2": { + "flake": false, + "locked": { + "lastModified": 1765809053, + "narHash": "sha256-XCUQLoLfBJ8saWms2HCIj4NEN+xNsWBlU1NrEPcQG4s=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "rev": "86cbea4dca62e08fb7fd83a70e96472f92574782", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1760703920, + "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "d646af9b7d14bff08824538164af99d0c521b185", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-helix_2": { + "flake": false, + "locked": { + "lastModified": 1760703920, + "narHash": "sha256-m82fGUYns4uHd+ZTdoLX2vlHikzwzdu2s2rYM2bNwzw=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "d646af9b7d14bff08824538164af99d0c521b185", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "base16-vim_2": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "base16_2": { + "inputs": { + "fromYaml": "fromYaml_2" + }, + "locked": { + "lastModified": 1755819240, + "narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1764873433, + "narHash": "sha256-1XPewtGMi+9wN9Ispoluxunw/RwozuTRVuuQOmxzt+A=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "f7ffd917ac0d253dbd6a3bf3da06888f57c69f92", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "firefox-gnome-theme_2": { + "flake": false, + "locked": { + "lastModified": 1764873433, + "narHash": "sha256-1XPewtGMi+9wN9Ispoluxunw/RwozuTRVuuQOmxzt+A=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "f7ffd917ac0d253dbd6a3bf3da06888f57c69f92", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "NixOS", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763759067, + "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_10": { + "inputs": { + "nixpkgs-lib": [ + "synix", + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767609335, + "narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "250481aafeb741edfe23d29195671c19b36b6dca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1754487366, + "narHash": "sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "af66ad14b28a127c5c0f3bbb298218fc63528a18", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765835352, + "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "a34fae9c08a15ad73f295041fec82323541400a9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_6": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767609335, + "narHash": "sha256-feveD98mQpptwrAEggBQKJTYbvwwglSbOv53uCfH9PY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "250481aafeb741edfe23d29195671c19b36b6dca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_7": { + "inputs": { + "nixpkgs-lib": [ + "synix", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_8": { + "inputs": { + "nixpkgs-lib": [ + "synix", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1765835352, + "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "a34fae9c08a15ad73f295041fec82323541400a9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_9": { + "inputs": { + "nixpkgs-lib": [ + "synix", + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-schemas": { + "locked": { + "lastModified": 1765542151, + "narHash": "sha256-rzv+NVnOcr9pzd8RnvTscwAHAZmD8FLgxEEmHP1xGTA=", + "owner": "DeterminateSystems", + "repo": "flake-schemas", + "rev": "6f53c45897ef6d9e1f39e8ca9611571ac4aa4f17", + "type": "github" + }, + "original": { + "owner": "DeterminateSystems", + "repo": "flake-schemas", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_8" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "fromYaml_2": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gen-dmc": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1759167416, + "narHash": "sha256-FOv4Vsng7OUC715tonYRGGY4JhcL3fticvC1YjvGzAI=", + "owner": "kmein", + "repo": "gen-dmc", + "rev": "5a152a7b311cc77de761740bfbb211293d9621d8", + "type": "github" + }, + "original": { + "owner": "kmein", + "ref": "pull/3/head", + "repo": "gen-dmc", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": "flake-compat_2", + "gitignore": "gitignore_3", + "nixpkgs": [ + "synix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768935149, + "narHash": "sha256-S5/BZo4X1D9+U/yJ6xCJyUkXZ8y261q2gPP5Xsq8RPU=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "18cbede9ff6da05b911c5c4802a397c2686ac8fa", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks-nix": { + "inputs": { + "flake-compat": [ + "synix", + "nix" + ], + "gitignore": [ + "synix", + "nix" + ], + "nixpkgs": [ + "synix", + "nix", + "nixpkgs" + ], + "nixpkgs-stable": [ + "synix", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1734279981, + "narHash": "sha256-NdaCraHPp8iYMWzdXAt5Nv6sA3MUzlCiGiR586TCwo0=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "aa9f40c906904ebd83da78e7f328cd8aeaeae785", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "multios-usb", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "synix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "host": "gitlab.gnome.org", + "lastModified": 1767737596, + "narHash": "sha256-eFujfIUQDgWnSJBablOuG+32hCai192yRdrNHTv0a+s=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "ef02db02bf0ff342734d525b5767814770d85b49", + "type": "gitlab" + }, + "original": { + "host": "gitlab.gnome.org", + "owner": "GNOME", + "ref": "gnome-49", + "repo": "gnome-shell", + "type": "gitlab" + } + }, + "gnome-shell_2": { + "flake": false, + "locked": { + "host": "gitlab.gnome.org", + "lastModified": 1767737596, + "narHash": "sha256-eFujfIUQDgWnSJBablOuG+32hCai192yRdrNHTv0a+s=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "ef02db02bf0ff342734d525b5767814770d85b49", + "type": "gitlab" + }, + "original": { + "host": "gitlab.gnome.org", + "owner": "GNOME", + "ref": "gnome-49", + "repo": "gnome-shell", + "type": "gitlab" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767910483, + "narHash": "sha256-MOU5YdVu4DVwuT5ztXgQpPuRRBjSjUGIdUzOQr9iQOY=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "82fb7dedaad83e5e279127a38ef410bcfac6d77c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1749657191, + "narHash": "sha256-QLilaHuhGxiwhgceDWESj9gFcKIdEp7+9lRqNGpN8S4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "faeab32528a9360e9577ff4082de2d35c6bbe1ce", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "synix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768949235, + "narHash": "sha256-TtjKgXyg1lMfh374w5uxutd6Vx2P/hU81aEhTxrO2cg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "75ed713570ca17427119e7e204ab3590cc3bf2a5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "home-manager", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754860581, + "narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.1.1", + "repo": "ixx", + "type": "github" + } + }, + "ixx_2": { + "inputs": { + "flake-utils": [ + "synix", + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "synix", + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754860581, + "narHash": "sha256-EM0IE63OHxXCOpDHXaTyHIOk2cNvMCGPqLt/IdtVxgk=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "babfe85a876162c4acc9ab6fb4483df88fa1f281", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.1.1", + "repo": "ixx", + "type": "github" + } + }, + "kidex": { + "inputs": { + "flake-parts": "flake-parts_2", + "home-manager": "home-manager_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1763902355, + "narHash": "sha256-7Mf+SN4xJhHcPfG3xLBPHyqci3rBc08dPuHEsnw04sA=", + "owner": "Kirottu", + "repo": "kidex", + "rev": "1a4871641da3be4286c8a5316b44733388943f87", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "kidex", + "type": "github" + } + }, + "multios-usb": { + "inputs": { + "flake-parts": "flake-parts_3", + "gitignore": "gitignore", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767500032, + "narHash": "sha256-ALCcBlOOIw6/DaJwrOBEQPzuBgiXU2fWEHrxcY+kOeg=", + "owner": "Mexit", + "repo": "MultiOS-USB", + "rev": "22eb813525f8cb5234773ba5e7130bfcdf72bebf", + "type": "github" + }, + "original": { + "owner": "Mexit", + "repo": "MultiOS-USB", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-compat": "flake-compat_3", + "flake-parts": "flake-parts_7", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs_3", + "nixpkgs-23-11": "nixpkgs-23-11", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1741125032, + "narHash": "sha256-Yy1Cd3Xm4UJTctYsVQfD5jY5z7pVncvLu8cq0cjjYT4=", + "owner": "DeterminateSystems", + "repo": "nix-src", + "rev": "271926aa5997c3120c8ef0962ce1c7f29fee1a05", + "type": "github" + }, + "original": { + "owner": "DeterminateSystems", + "ref": "flake-schemas", + "repo": "nix-src", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1731533336, + "narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "f7653272fd234696ae94229839a99b73c9ab7de0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-flatpak": { + "locked": { + "lastModified": 1767983141, + "narHash": "sha256-7ZCulYUD9RmJIDULTRkGLSW1faMpDlPKcbWJLYHoXcs=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "440818969ac2cbd77bfe025e884d0aa528991374", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "latest", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1767185284, + "narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "40b1a28dce561bea34858287fbb23052c3ee63fe", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-23-11": { + "locked": { + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1748740939, + "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "656a64127e9d791a334452c6b6606d17539476e2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1753579242, + "narHash": "sha256-zvaMGVn14/Zz8hnp4VWT9xVnhc8vuL3TStRqwk22biA=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "0f36c44e01a6129be94e3ade315a5883f0228a6e", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-old-old-stable": { + "locked": { + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-old-stable": { + "locked": { + "lastModified": 1767313136, + "narHash": "sha256-16KkgfdYqjaeRGBaYsNrhPRRENs0qzkQVUooNHtoy2w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ac62194c3917d5f474c1a844b6fd6da2db95077d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1768127708, + "narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1768242861, + "narHash": "sha256-F4IIxa5xDHjtrmMcayM8lHctUq1oGltfBQu2+oqDWP4=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1327e798cb055f96f92685df444e9a2c326ab5ed", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-25.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1734359947, + "narHash": "sha256-1Noao/H+N8nFB4Beoy8fgwrcOQLVm9o4zKW1ODaqK9E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "48d12d5e70ee91fe8481378e540433a7303dbf6a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "release-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_4", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1767448089, + "narHash": "sha256-U1fHsZBnFrUil731NHD9Sg5HoiG+eSHau8OFuClhwW0=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "983751b66f255bbea1adc185364e9e7b73f82358", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-25.11", + "repo": "nixvim", + "type": "github" + } + }, + "nixvim_2": { + "inputs": { + "flake-parts": "flake-parts_8", + "nixpkgs": [ + "synix", + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch_2", + "systems": "systems_6" + }, + "locked": { + "lastModified": 1768486829, + "narHash": "sha256-G621Q9cB1roQxK0C6guNjmWX0CmPA5xN46VD2kTdDEk=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "503259b749971f431cb4aca7099cd60eadd7a613", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "nixos-25.11", + "repo": "nixvim", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": "flake-parts_5", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768312260, + "narHash": "sha256-ztSP5kDw+DuxJ4DG/3tW7YK3cu3U8YAqXv6uAOwNyIs=", + "owner": "nix-community", + "repo": "NUR", + "rev": "dc41fee43b5bebb55bc9df70b2201b4cd52bfc16", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nur_2": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767886815, + "narHash": "sha256-pB2BBv6X9cVGydEV/9Y8+uGCvuYJAlsprs1v1QHjccA=", + "owner": "nix-community", + "repo": "NUR", + "rev": "4ff84374d77ff62e2e13a46c33bfeb73590f9fef", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nur_3": { + "inputs": { + "flake-parts": "flake-parts_9", + "nixpkgs": [ + "synix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769002807, + "narHash": "sha256-27JgCsWRnWsI1ZMnrIbmyLm+GCoyDTYILcAVI75SN6g=", + "owner": "nix-community", + "repo": "NUR", + "rev": "818b545699f32a1058961604b4a2783875fe8cde", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nur_4": { + "inputs": { + "flake-parts": [ + "synix", + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "synix", + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767886815, + "narHash": "sha256-pB2BBv6X9cVGydEV/9Y8+uGCvuYJAlsprs1v1QHjccA=", + "owner": "nix-community", + "repo": "NUR", + "rev": "4ff84374d77ff62e2e13a46c33bfeb73590f9fef", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761730856, + "narHash": "sha256-t1i5p/vSWwueZSC0Z2BImxx3BjoUDNKyC2mk24krcMY=", + "owner": "NuschtOS", + "repo": "search", + "rev": "e29de6db0cb3182e9aee75a3b1fd1919d995d85b", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "nuschtosSearch_2": { + "inputs": { + "flake-utils": "flake-utils_2", + "ixx": "ixx_2", + "nixpkgs": [ + "synix", + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761730856, + "narHash": "sha256-t1i5p/vSWwueZSC0Z2BImxx3BjoUDNKyC2mk24krcMY=", + "owner": "NuschtOS", + "repo": "search", + "rev": "e29de6db0cb3182e9aee75a3b1fd1919d995d85b", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767281941, + "narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "anyrun": "anyrun", + "gen-dmc": "gen-dmc", + "home-manager": "home-manager", + "kidex": "kidex", + "multios-usb": "multios-usb", + "nix-flatpak": "nix-flatpak", + "nixos-hardware": "nixos-hardware", + "nixpkgs": "nixpkgs_2", + "nixpkgs-old-old-stable": "nixpkgs-old-old-stable", + "nixpkgs-old-stable": "nixpkgs-old-stable", + "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", + "nur": "nur", + "pre-commit-hooks": "pre-commit-hooks", + "sops-nix": "sops-nix", + "stylix": "stylix", + "synix": "synix", + "winapps": "winapps" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1768271704, + "narHash": "sha256-jJqlW8A3OZ5tYbXphF7U8P8g/3Cn8PPwPa4YlJ/9agg=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "691b8b6713855d0fe463993867291c158472fc6f", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts_6", + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "nixpkgs" + ], + "nur": "nur_2", + "systems": "systems_4", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1767983286, + "narHash": "sha256-zuS1vcjZjtipzH1MgQUp/lRURIp6CXOVjGHQMQ1UBFI=", + "owner": "nix-community", + "repo": "stylix", + "rev": "5ad96253be7ee7f66298d28a24ac8faba8e0fe54", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "stylix", + "type": "github" + } + }, + "stylix_2": { + "inputs": { + "base16": "base16_2", + "base16-fish": "base16-fish_2", + "base16-helix": "base16-helix_2", + "base16-vim": "base16-vim_2", + "firefox-gnome-theme": "firefox-gnome-theme_2", + "flake-parts": "flake-parts_10", + "gnome-shell": "gnome-shell_2", + "nixpkgs": [ + "synix", + "nixpkgs" + ], + "nur": "nur_4", + "systems": "systems_7", + "tinted-foot": "tinted-foot_2", + "tinted-kitty": "tinted-kitty_2", + "tinted-schemes": "tinted-schemes_2", + "tinted-tmux": "tinted-tmux_2", + "tinted-zed": "tinted-zed_2" + }, + "locked": { + "lastModified": 1768493544, + "narHash": "sha256-9qk2W/6GJWLAFXNruK/zdJ0bm3bfP50vJFbtuAjQpa4=", + "owner": "nix-community", + "repo": "stylix", + "rev": "362306faaa7459bebf8eabf135879785f3da9bd2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-25.11", + "repo": "stylix", + "type": "github" + } + }, + "synix": { + "inputs": { + "flake-schemas": "flake-schemas", + "git-hooks": "git-hooks", + "home-manager": "home-manager_3", + "nix": "nix", + "nixpkgs": [ + "nixpkgs" + ], + "nixvim": "nixvim_2", + "nur": "nur_3", + "stylix": "stylix_2" + }, + "locked": { + "lastModified": 1771875275, + "narHash": "sha256-8Ty8ZkFbw+qgslw7RfT3tD7SZLcbOJ1lhBQ2nHKXLxc=", + "ref": "release-25.11", + "rev": "95a533c8762f2a7c7e05daa787c3441939dfa8dd", + "revCount": 1, + "type": "git", + "url": "https://git.sid.ovh/sid/synix.git" + }, + "original": { + "ref": "release-25.11", + "type": "git", + "url": "https://git.sid.ovh/sid/synix.git" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-foot_2": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-kitty_2": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1767817087, + "narHash": "sha256-eGE8OYoK6HzhJt/7bOiNV2cx01IdIrHL7gXgjkHRdNo=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "bd99656235aab343e3d597bf196df9bc67429507", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-schemes_2": { + "flake": false, + "locked": { + "lastModified": 1767817087, + "narHash": "sha256-eGE8OYoK6HzhJt/7bOiNV2cx01IdIrHL7gXgjkHRdNo=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "bd99656235aab343e3d597bf196df9bc67429507", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1767489635, + "narHash": "sha256-e6nnFnWXKBCJjCv4QG4bbcouJ6y3yeT70V9MofL32lU=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "3c32729ccae99be44fe8a125d20be06f8d7d8184", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-tmux_2": { + "flake": false, + "locked": { + "lastModified": 1767489635, + "narHash": "sha256-e6nnFnWXKBCJjCv4QG4bbcouJ6y3yeT70V9MofL32lU=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "3c32729ccae99be44fe8a125d20be06f8d7d8184", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1767488740, + "narHash": "sha256-wVOj0qyil8m+ouSsVZcNjl5ZR+1GdOOAooAatQXHbuU=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "11abb0b282ad3786a2aae088d3a01c60916f2e40", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "tinted-zed_2": { + "flake": false, + "locked": { + "lastModified": 1767488740, + "narHash": "sha256-wVOj0qyil8m+ouSsVZcNjl5ZR+1GdOOAooAatQXHbuU=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "11abb0b282ad3786a2aae088d3a01c60916f2e40", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "winapps": { + "inputs": { + "flake-compat": "flake-compat_4", + "flake-utils": "flake-utils_3", + "nix-filter": "nix-filter", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1767904990, + "narHash": "sha256-W0KD73Iv3wMEnO7LDE1BJWaRcw969keqwn9hM+TR3SU=", + "owner": "winapps-org", + "repo": "winapps", + "rev": "8b63321f3b14f0f61b1e45772fdafe6ef57d8f98", + "type": "github" + }, + "original": { + "owner": "winapps-org", + "repo": "winapps", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..98ceea6 --- /dev/null +++ b/flake.nix @@ -0,0 +1,186 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs-old-stable.url = "github:nixos/nixpkgs/nixos-25.05"; + nixpkgs-old-old-stable.url = "github:nixos/nixpkgs/nixos-24.11"; + + home-manager.url = "github:nix-community/home-manager/release-25.11"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + synix.url = "git+https://git.sid.ovh/sid/synix.git?ref=release-25.11"; + # synix.url = "git+file:///home/sid/src/synix"; + synix.inputs.nixpkgs.follows = "nixpkgs"; + + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + + nixvim.url = "github:nix-community/nixvim/nixos-25.11"; + nixvim.inputs.nixpkgs.follows = "nixpkgs"; + + nur.url = "github:nix-community/NUR"; + nur.inputs.nixpkgs.follows = "nixpkgs"; + + sops-nix.url = "github:Mic92/sops-nix"; + sops-nix.inputs.nixpkgs.follows = "nixpkgs"; + + stylix.url = "github:nix-community/stylix/release-25.11"; + stylix.inputs.nixpkgs.follows = "nixpkgs"; + + nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest"; + + anyrun.url = "github:anyrun-org/anyrun"; + anyrun.inputs.nixpkgs.follows = "nixpkgs"; + + kidex.url = "github:Kirottu/kidex"; + kidex.inputs.nixpkgs.follows = "nixpkgs"; + + pre-commit-hooks.url = "github:cachix/git-hooks.nix"; + pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; + + winapps.url = "github:winapps-org/winapps"; + winapps.inputs.nixpkgs.follows = "nixpkgs"; + + gen-dmc.url = "github:kmein/gen-dmc/pull/3/head"; + gen-dmc.inputs.nixpkgs.follows = "nixpkgs"; + + multios-usb.url = "github:Mexit/MultiOS-USB"; + multios-usb.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = + { + self, + nixpkgs, + home-manager, + ... + }@inputs: + let + inherit (self) outputs; + + supportedSystems = [ + "x86_64-linux" + ]; + + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + + lib = nixpkgs.lib.extend (final: prev: inputs.synix.lib or { }); + + mkNixosConfiguration = + system: modules: + nixpkgs.lib.nixosSystem { + inherit system modules; + specialArgs = { + inherit inputs outputs lib; + }; + }; + in + { + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + + overlays = import ./overlays { inherit inputs; }; + + nixosModules = import ./modules/nixos; + homeModules = import ./modules/home; + + devShells = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = import ./shell.nix { inherit pkgs; }; + kicad = pkgs.mkShell { + buildInputs = [ + (pkgs.python313.withPackages ( + p: with p; [ + kicad + requests + wxpython + ] + )) + ]; + }; + } + ); + + nixosConfigurations = { + "16ach6" = mkNixosConfiguration "x86_64-linux" [ ./hosts/16ach6 ]; + nuc8 = mkNixosConfiguration "x86_64-linux" [ ./hosts/nuc8 ]; + pc = mkNixosConfiguration "x86_64-linux" [ ./hosts/pc ]; + rv2 = mkNixosConfiguration "x86_64-linux" [ ./hosts/rv2 ]; + }; + + homeConfigurations = { + "sid@16ach6" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + ./users/sid/home + ./users/sid/home/hosts/16ach6 + ]; + }; + "sid@nuc8" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + ./users/sid/home + ./users/sid/home/hosts/nuc8 + ]; + }; + "sid@pc" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + ./users/sid/home + ./users/sid/home/hosts/pc + ]; + }; + "sid@rv2" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + ./users/sid/home + ./users/sid/home/hosts/rv2 + ]; + }; + }; + + formatter = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + config = self.checks.${system}.pre-commit-check.config; + inherit (config) package configFile; + script = '' + ${pkgs.lib.getExe package} run --all-files --config ${configFile} + ''; + in + pkgs.writeShellScriptBin "pre-commit-run" script + ); + + checks = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + flakePkgs = self.packages.${system}; + in + { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + nixfmt.enable = true; + }; + }; + build-packages = pkgs.linkFarm "flake-packages-${system}" flakePkgs; + } + ); + }; +} diff --git a/hosts/16ach6/boot.nix b/hosts/16ach6/boot.nix new file mode 100644 index 0000000..6252b08 --- /dev/null +++ b/hosts/16ach6/boot.nix @@ -0,0 +1,7 @@ +{ + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 20; + }; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/16ach6/default.nix b/hosts/16ach6/default.nix new file mode 100644 index 0000000..1947510 --- /dev/null +++ b/hosts/16ach6/default.nix @@ -0,0 +1,77 @@ +{ + inputs, + outputs, + ... +}: + +{ + imports = [ + ./boot.nix + ./hardware.nix + ./packages.nix + ./secrets + ./virtualisation.nix + # ./winapps.nix # trying windows-oci for now + # ./wireguard.nix # TODO: use NM for client config + + ../../users/sid + + inputs.synix.nixosModules.common + inputs.synix.nixosModules.device.laptop + inputs.synix.nixosModules.hyprland + inputs.synix.nixosModules.i2pd + inputs.synix.nixosModules.openssh + inputs.synix.nixosModules.windows-oci + + # outputs.nixosModules.anything-llm-oci + outputs.nixosModules.appimage + outputs.nixosModules.common + # outputs.nixosModules.docker # conflicts with `virtualisation.podman.dockerCompat` + outputs.nixosModules.docs + outputs.nixosModules.syncthing + outputs.nixosModules.tailscale + outputs.nixosModules.wine + ]; + + networking.hostName = "16ach6"; + + services = { + envfs.enable = true; + i2pd.enable = true; + openssh.enable = true; + windows-oci = { + # enable = true; # FIXME + sharedVolume = "/home/sid/pub"; + }; + }; + + boot.binfmt.emulatedSystems = [ + "aarch64-linux" + ]; + + virtualisation.waydroid.enable = true; + # sudo waydroid init + # sudo systemctl enable --now waydroid-container.service + # waydroid session start + # waydroid app launch com.foo.bar + + normalUsers = { + sid = { + extraGroups = [ + "audio" + "dialout" + "floppy" + "input" + "lp" + "networkmanager" + "video" + ]; + }; + }; + + programs.steam.enable = true; + + boot.enableContainers = true; + + system.stateVersion = "24.11"; +} diff --git a/hosts/16ach6/hardware.nix b/hosts/16ach6/hardware.nix new file mode 100644 index 0000000..c6ff7e4 --- /dev/null +++ b/hosts/16ach6/hardware.nix @@ -0,0 +1,49 @@ +{ + inputs, + config, + lib, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + # inputs.nixos-hardware.nixosModules.lenovo-ideapad-16ach6 + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "sd_mod" + "sdhci_pci" + ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.graphics.enable = true; +} diff --git a/hosts/16ach6/packages.nix b/hosts/16ach6/packages.nix new file mode 100644 index 0000000..8a44336 --- /dev/null +++ b/hosts/16ach6/packages.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + environment = { + systemPackages = with pkgs; [ + evtest + linuxConsoleTools + ]; + }; +} diff --git a/hosts/16ach6/secrets/default.nix b/hosts/16ach6/secrets/default.nix new file mode 100644 index 0000000..db5b0d9 --- /dev/null +++ b/hosts/16ach6/secrets/default.nix @@ -0,0 +1,5 @@ +{ inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.sops ]; +} diff --git a/hosts/16ach6/secrets/secrets.yaml b/hosts/16ach6/secrets/secrets.yaml new file mode 100644 index 0000000..404bfcf --- /dev/null +++ b/hosts/16ach6/secrets/secrets.yaml @@ -0,0 +1,36 @@ +wireguard: + wg0: + private-key: ENC[AES256_GCM,data:6G+VkNsoFK1zyurW/xuaw5ZawpGXYdT3YbYMwiYvpsqNiGhB9CMT/0v2HuE=,iv:vg7OcXghMzbQL0NYdnuAue2MC8l6l++TCoXJjGtpk/g=,tag:urVD9LfMtO5c95tHouX7YQ==,type:str] +tailscale: + auth-key: ENC[AES256_GCM,data:u1TCO6pEKnOemhWSnb9UPCURFoKcR0uuipGzwu5QYVtzm7MLtvd5llhha8/H7WYQ,iv:0rwuQ3b6UOJth7YqaLJGNp0OqRYCb/z/HFK0vOY9ACw=,tag:H79JGEfBYB8hNrGZKAxHzg==,type:str] +anything-llm-oci: + openrouter-api-key: ENC[AES256_GCM,data:iEi1ZDGnhNaFjuL/cv/XkMH/GtEgW4cmRPc/PrSgCBcJai2uA2NfhpS4ZJfzvzXyhvCEBVK05932N0PFAkYqryFD4PhGPE6N7g==,iv:tWlM8NlzV9/6vpbIEM0lt39ZJQGm/trEwYbnqpTCpro=,tag:OAUbTc4PbJsy7jqLixZOvw==,type:str] + jwt-secret: ENC[AES256_GCM,data:TBgjAwOH8pzRYxSvGaqaY5kFk0vVQjbKu+i2o3xPl4pRILQrzll0R4Sll5Qu7kW8WqyBBEEsEBBvY0sz2YR6aQ==,iv:8/yViXyTpxdRWthJt4D0KhZJ2+uTKXUV8UZUEsy8+kk=,tag:eWkaFZg2rtqziUAcjdcs1g==,type:str] + sig-key: ENC[AES256_GCM,data:VRFkIK2ywV0b1Dz40XtdcFk3aZ/iIaNxiB4C1zbh8P5EQbkIEE0AcSHlWc3gFwhLEjrAz37D/Js7lmGaR9XLaQ==,iv:pBv/cuciNXbV5IHmNbu8MCwiVK4MSwaBsiJ6SjpXjyU=,tag:VB9RuEC7orBBdR0qECOalQ==,type:str] + sig-salt: ENC[AES256_GCM,data:I3ggthhiehT54ad5O4Y7sqR4yo9Cs2RBnAB3jUem755N3MqjaPhw6PVpE92/UacNfqkMeHVINImUUo/nvuwr1w==,iv:qextgxloGUs0dSDrK29XnF68P89WICywktolqXJpY8k=,tag:9ilT8TKdAKu18J422uhN5Q==,type:str] +syncthing: + gui-pw: ENC[AES256_GCM,data:dDccKohXulosuG4JQzLCtdf0+cY=,iv:Yk41rJqt4y4QhWkcP2upMd4h/orNMYTX4wO0TObrYpI=,tag:X3/ig+Kv2t7Wy8muxX3RGw==,type:str] +sops: + age: + - recipient: age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxM2pkS3lOaVpuUFdHVy9h + UU9ZcVIyTGlUUVpqdHFzU3llVENyOXV2eTFZCnVwVWlzR0N4QXZsNEZvRFFScHpl + cnBucWp6ZkN2Q3VKMmJMWlhOVVNtYmcKLS0tIG5ENjVtVjhqeWlBMFFRM3RoS0pC + bml1R3djSEgxbDVxZ1Jwc28zQWoycEkKUwt/8zCkhD1b7dVMYd7FHxABjwPhTQxA + Lw1sBePiKQxeZTiWVucMrrHk85omGQEPNECTdhBqF4aOS0glRrwCEQ== + -----END AGE ENCRYPTED FILE----- + - recipient: age1km907lx69fwvmwgt7rspkuyxtkdrhr7r7t0mw20e5rymsu364exs3rl28q + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJNGdEd3hJcTc0QzF5ZitN + SnNTV1NSOWRRV1VTczZmcStjRmJ5Q01mSEZFCi80cFN0TVY0WmJseFVBM1JEaTlK + WmNiWFBMT1dudVp1REsyYU1OUm1haVUKLS0tIFRZdE11WnpNQW1kbEZzNlpSWE5m + T1JDdVlwRVYwLy9ud0EyNldFcXNDaUUKdXq2ulChfK6XBpX/bkP/fz9XCm/YVHkX + QRPemdtP2Sp7VBcAtlWNbXFcr3osRR2nLKxDl+NntEHRCNs3ffnGew== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-01-13T21:05:39Z" + mac: ENC[AES256_GCM,data:aSOlu1iuSDuUdSt6cZhbzorY37ECHqIkz73iPi2Sn6WyDNCsEwn2rJpQxXSDG/O0+HLoyCgkyR9PwrI0Gn0sDAtcPHhVjOQC8656muNEV3fZWBPIJ+K4++xZDAH66L1UN7Y210EnYtYT6pY61jrFz2NWVjd1V9hTcCmbfpySrAA=,iv:gmPRLuMagjY/Dgc3VvurvLz4qgfTsMp/YIgqHXuG6ag=,tag:I5hKLnEXDvMRXOY2YuFG9g==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 diff --git a/hosts/16ach6/virtualisation.nix b/hosts/16ach6/virtualisation.nix new file mode 100644 index 0000000..31b856f --- /dev/null +++ b/hosts/16ach6/virtualisation.nix @@ -0,0 +1,42 @@ +{ + inputs, + config, + lib, + pkgs, + ... +}: + +{ + imports = [ inputs.synix.nixosModules.virtualisation ]; + + virtualisation = { + vfio = { + enable = true; + IOMMUType = "amd"; + devices = [ + "10de:1f9d" + ]; + blacklistNvidia = true; + ignoreMSRs = true; + }; + libvirtd.deviceACL = [ + "/dev/kvm" + "/dev/net/tun" + "/dev/vfio/vfio" + "/dev/null" + "/dev/ptmx" + ]; + hugepages.enable = true; + quickemu.enable = true; + }; + + users.extraGroups.libvirtd.members = [ "sid" ]; + users.extraGroups.qemu-libvirtd.members = [ "sid" ]; + users.extraGroups.kvm.members = [ "sid" ]; + + systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 sid libvirtd -" ]; + + environment.systemPackages = [ + pkgs.looking-glass-client + ]; +} diff --git a/hosts/16ach6/winapps.nix b/hosts/16ach6/winapps.nix new file mode 100644 index 0000000..c761b88 --- /dev/null +++ b/hosts/16ach6/winapps.nix @@ -0,0 +1,11 @@ +{ inputs, pkgs, ... }: + +let + inherit (pkgs.stdenv.hostPlatform) system; +in +{ + environment.systemPackages = with inputs.winapps.packages."${system}"; [ + winapps + winapps-launcher + ]; +} diff --git a/hosts/16ach6/wireguard.nix b/hosts/16ach6/wireguard.nix new file mode 100644 index 0000000..8152a83 --- /dev/null +++ b/hosts/16ach6/wireguard.nix @@ -0,0 +1,18 @@ +{ inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.wg-client ]; + + networking.wg-client = { + enable = true; + interfaces = { + wg0 = { + clientAddress = "10.0.0.2"; + peer = { + publicIP = "91.99.172.127"; + publicKey = "hRrnXl1heROHfpXkHOmjITUpG/ht3omVsWurLcChIS4="; + }; + }; + }; + }; +} diff --git a/hosts/nuc8/README.md b/hosts/nuc8/README.md new file mode 100644 index 0000000..2c32ea7 --- /dev/null +++ b/hosts/nuc8/README.md @@ -0,0 +1,45 @@ +# Windows 10 installation + +> Important: Install Windows 10 *before* NixOS + +Before setup, press `SHIFT+F10`. Then, enter the following commands in the terminal window: + +``` +diskpart +``` + +Get your drive number with: + +``` +list disk +``` + +> most likely `0` + +``` +select disk 0 +clean +convert gpt + +create partition efi size=1024 +format quick fs=fat32 label="System" + +create partition msr size=16 + +create partition primary +shrink minimum=1024 +format quick fs=ntfs label="Windows" + +create partition primary +format quick fs=ntfs label="Recovery" + +exit +``` + +Close the terminal and proceed as usual. + +After booting into your finished Windows installation, resize the C drive to make some space for your Linux root and swap partitions. + +# NixOS config + +See [*Autodetection with systemd-boot*](https://nixos.wiki/wiki/Dual_Booting_NixOS_and_Windows). diff --git a/hosts/nuc8/boot.nix b/hosts/nuc8/boot.nix new file mode 100644 index 0000000..53a9686 --- /dev/null +++ b/hosts/nuc8/boot.nix @@ -0,0 +1,7 @@ +{ + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 10; + }; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/nuc8/default.nix b/hosts/nuc8/default.nix new file mode 100644 index 0000000..748fa5b --- /dev/null +++ b/hosts/nuc8/default.nix @@ -0,0 +1,46 @@ +{ inputs, outputs, ... }: + +{ + imports = [ + ./boot.nix + ./hardware.nix + ./packages.nix + + ../../users/sid + + inputs.synix.nixosModules.bluetooth + inputs.synix.nixosModules.common + inputs.synix.nixosModules.device.desktop + inputs.synix.nixosModules.hyprland + inputs.synix.nixosModules.openssh + inputs.synix.nixosModules.virtualisation + + outputs.nixosModules.common + outputs.nixosModules.docs + ]; + + networking.hostName = "nuc8"; + + services = { + openssh.enable = true; + pipewire.enable = true; + }; + + normalUsers = { + sid = { + extraGroups = [ + "audio" + "floppy" + "input" + "libvirtd" + "lp" + "networkmanager" + "video" + ]; + }; + }; + + time.hardwareClockInLocalTime = true; # Windows compatibility + + system.stateVersion = "24.11"; +} diff --git a/hosts/nuc8/disks.sh b/hosts/nuc8/disks.sh new file mode 100644 index 0000000..206a686 --- /dev/null +++ b/hosts/nuc8/disks.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +SSD='/dev/disk/by-id/nvme-Micron_MTFDHBA512TDV_21212F5AAB85' +MNT='/mnt' +SWAP_GB=16 + +# Helper function to wait for devices +wait_for_device() { + local device=$1 + echo "Waiting for device: $device ..." + while [[ ! -e $device ]]; do + sleep 1 + done + echo "Device $device is ready." +} + +if ! command -v sgdisk &> /dev/null; then + nix-env -iA nixos.gptfdisk +fi + +swapoff --all +udevadm settle + +wait_for_device $SSD + +echo "Partitioning $SSD..." +sgdisk -n5:0:+"$SWAP_GB"G -t5:8200 -c5:SWAP $SSD +sgdisk -n6:0:0 -t6:8304 -c6:ROOT $SSD +partprobe -s $SSD +udevadm settle + +wait_for_device ${SSD}-part1 # Windows ESP +wait_for_device ${SSD}-part5 +wait_for_device ${SSD}-part6 + +echo "Formatting partitions..." +mkswap -L SWAP "${SSD}-part5" +mkfs.ext4 -L ROOT "${SSD}-part6" + +echo "Mounting partitions..." +mount -o X-mount.mkdir "${SSD}-part6" "$MNT" +mkdir -p "$MNT/boot" +mount "${SSD}-part1" "$MNT/boot" + +echo "Enabling swap..." +swapon "${SSD}-part5" + +echo "Partitioning and setup complete:" +lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL diff --git a/hosts/nuc8/hardware.nix b/hosts/nuc8/hardware.nix new file mode 100644 index 0000000..0d6e1d1 --- /dev/null +++ b/hosts/nuc8/hardware.nix @@ -0,0 +1,49 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/SYSTEM"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/SWAP"; } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/nuc8/packages.nix b/hosts/nuc8/packages.nix new file mode 100644 index 0000000..2eee3ed --- /dev/null +++ b/hosts/nuc8/packages.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + environment = { + systemPackages = with pkgs; [ + ]; + }; +} diff --git a/hosts/pc/boot.nix b/hosts/pc/boot.nix new file mode 100644 index 0000000..6252b08 --- /dev/null +++ b/hosts/pc/boot.nix @@ -0,0 +1,7 @@ +{ + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 20; + }; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/pc/default.nix b/hosts/pc/default.nix new file mode 100644 index 0000000..6d83c37 --- /dev/null +++ b/hosts/pc/default.nix @@ -0,0 +1,49 @@ +{ + inputs, + outputs, + ... +}: + +{ + imports = [ + ./boot.nix + ./hardware.nix + ./networking.nix + ./packages.nix + ./secrets + ./services.nix + + ../../users/sid + + inputs.synix.nixosModules.bluetooth + inputs.synix.nixosModules.common + inputs.synix.nixosModules.device.desktop + inputs.synix.nixosModules.hyprland + + outputs.nixosModules.common + outputs.nixosModules.docs + # outputs.nixosModules.syncthing + outputs.nixosModules.tailscale + outputs.nixosModules.wine + ]; + + normalUsers = { + sid = { + extraGroups = [ + "audio" + "dialout" + "floppy" + "input" + "lp" + "networkmanager" + "video" + ]; + }; + }; + + programs.steam.enable = true; + + boot.enableContainers = true; + + system.stateVersion = "25.11"; +} diff --git a/hosts/pc/disks.sh b/hosts/pc/disks.sh new file mode 100644 index 0000000..f215437 --- /dev/null +++ b/hosts/pc/disks.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash + +SSD='/dev/disk/by-id/nvme-SPCC_M.2_PCIe_SSD_7E1D079A184C00191521' +MNT='/mnt' +SWAP_GB=8 + +# Helper function to wait for devices +wait_for_device() { + local device=$1 + echo "Waiting for device: $device ..." + while [[ ! -e $device ]]; do + sleep 1 + done + echo "Device $device is ready." +} + +# Function to install a package if it's not already installed +install_if_missing() { + local cmd="$1" + local package="$2" + if ! command -v "$cmd" &> /dev/null; then + echo "$cmd not found, installing $package..." + nix-env -iA "nixos.$package" + fi +} + +install_if_missing "sgdisk" "gptfdisk" +install_if_missing "partprobe" "parted" + +wait_for_device $SSD + +echo "Wiping filesystem on $SSD..." +wipefs -a $SSD + +echo "Clearing partition table on $SSD..." +sgdisk --zap-all $SSD + +echo "Partitioning $SSD..." +sgdisk -n1:1M:+1G -t1:EF00 -c1:BOOT $SSD +sgdisk -n2:0:+"$SWAP_GB"G -t2:8200 -c2:SWAP $SSD +sgdisk -n3:0:0 -t3:8304 -c3:ROOT $SSD +partprobe -s $SSD +udevadm settle + +wait_for_device ${SSD}-part1 +wait_for_device ${SSD}-part2 +wait_for_device ${SSD}-part3 + +echo "Formatting partitions..." +mkfs.vfat -F 32 -n BOOT "${SSD}-part1" +mkswap -L SWAP "${SSD}-part2" +mkfs.ext4 -L ROOT "${SSD}-part3" + +echo "Mounting partitions..." +mount -o X-mount.mkdir "${SSD}-part3" "$MNT" +mkdir -p "$MNT/boot" +mount -t vfat -o fmask=0077,dmask=0077,iocharset=iso8859-1 "${SSD}-part1" "$MNT/boot" + +echo "Enabling swap..." +swapon "${SSD}-part2" + +echo "Partitioning and setup complete:" +lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL diff --git a/hosts/pc/hardware.nix b/hosts/pc/hardware.nix new file mode 100644 index 0000000..082f73a --- /dev/null +++ b/hosts/pc/hardware.nix @@ -0,0 +1,50 @@ +{ + inputs, + config, + lib, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ { device = "/dev/disk/by-label/SWAP"; } ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + hardware.graphics.enable = true; + hardware.nvidia.open = false; + services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ]; +} diff --git a/hosts/pc/networking.nix b/hosts/pc/networking.nix new file mode 100644 index 0000000..95ada9f --- /dev/null +++ b/hosts/pc/networking.nix @@ -0,0 +1,7 @@ +{ + networking.hostName = "pc"; + networking.interfaces.enp6s0.wakeOnLan = { + enable = true; + policy = [ "magic" ]; + }; +} diff --git a/hosts/pc/packages.nix b/hosts/pc/packages.nix new file mode 100644 index 0000000..8a44336 --- /dev/null +++ b/hosts/pc/packages.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + environment = { + systemPackages = with pkgs; [ + evtest + linuxConsoleTools + ]; + }; +} diff --git a/hosts/pc/secrets/default.nix b/hosts/pc/secrets/default.nix new file mode 100644 index 0000000..db5b0d9 --- /dev/null +++ b/hosts/pc/secrets/default.nix @@ -0,0 +1,5 @@ +{ inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.sops ]; +} diff --git a/hosts/pc/secrets/secrets.yaml b/hosts/pc/secrets/secrets.yaml new file mode 100644 index 0000000..c5c5dd0 --- /dev/null +++ b/hosts/pc/secrets/secrets.yaml @@ -0,0 +1,28 @@ +tailscale: + auth-key: ENC[AES256_GCM,data:ieDjXpk1YJ2+rb5X5dV3NPtr8+FGwcQtdinSbB+SIuyNbLoSogKrutsBqa+v0I5g,iv:0bV4VwRGCf0yIKpR850/CuTvGFUPXOnFaHpWkdyokjk=,tag:vlRo7cZqgYnvSJiCPSutmw==,type:str] +forgejo-runner: + token: ENC[AES256_GCM,data:rDwc/w9RpL/++VXg+YEYTP0CPz+trQp2OP5rHgWrPU0qODh1VjHjJA==,iv:SEFGOTB4YVnZqaJ2Lg87MSPV++8kAgtYMabvqouLuaw=,tag:NvRQHU8yvc6BdyTsnmIqyg==,type:str] +sops: + age: + - recipient: age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBucExCZjNtNGFnUTlnMjl0 + RVpCU1NxazNXSjBma2tTTlIvWDlPcy9EcGxZCmp2WC9xa2ptVkQvaWFYcnRqcHgz + Mk1scjBWY3g1TzNWalNVYVVqN3JLS0UKLS0tIGJQTG42aXFENFdVd0hkWGxLWVVu + STI4aWJxR3A4VUNyek5JMEtHeG1RZUUKKRDWdOXfarN7UZZzIBoSpmGlcWFsyJtX + bZgccbigI6TJpnssTkFT89FysD6i++mmC0mmTeZ/oNOXUk5OuwrCgA== + -----END AGE ENCRYPTED FILE----- + - recipient: age1zdd344x69n8umt2qjjvz8pjnt43lacvvqfdquc5jqz4x9x7pnu3sg0as0k + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBNeThiZGhmNTB6Uk1YdGg3 + WFlvNGtENnNlOU1wUXJyOWFPb3M2bm5UQVd3CkE0ck81ZjRwa2hIY1hQLzF2VmY3 + NWN4Z0x5MVlJY2Z5OGszbnBxd3ZIM1EKLS0tIGlMUUlXN1ZLRUlwRmhCek5ZR29l + OHNTYTFFYTJQeXkzWDN3bE91RFgyMzAKV49+02ik78/chrQ1arlkQZH4G6oeRHCa + Gp/WhuuOUJ7gwERNxhduhl4+IOSGcepgN5EJeTDXppUtiKXvNzmxpA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-02-18T17:43:14Z" + mac: ENC[AES256_GCM,data:1QcpQcLQ/TQwfzzHSGsoveB4HoN5ByCURoJn+TZjXd/szx0dBtUIxzc4ktkQZ388HFgYJ4rqpNudlc4AvYvDJULSpfP7KRADKG1reSuqpInGjU79t5U4Wwp+KJ+o29lulTV4fIqfCuqB9QhD4lqLjMSjnKUx5wkmtPuvIEjvWDw=,iv:T3ygIFwbXA/GLAbRAbQn9AP+V6evdmUCOlUfVbZc4fs=,tag:V7tLIukIAo5jyN/HkrciAw==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 diff --git a/hosts/pc/services.nix b/hosts/pc/services.nix new file mode 100644 index 0000000..639108f --- /dev/null +++ b/hosts/pc/services.nix @@ -0,0 +1,32 @@ +{ + inputs, + outputs, + config, + ... +}: + +{ + imports = [ + inputs.synix.nixosModules.openssh + + outputs.nixosModules.forgejo-runner + ]; + + services = { + openssh.enable = true; + }; + + services.forgejo-runner = { + enable = true; + url = "https://git.sid.ovh"; + tokenFile = config.sops.templates."forgejo-runner/token".path; + label = "runner"; + }; + + sops = { + secrets."forgejo-runner/token" = { }; + templates."forgejo-runner/token".content = '' + TOKEN=${config.sops.placeholder."forgejo-runner/token"} + ''; + }; +} diff --git a/hosts/rv2/boot.nix b/hosts/rv2/boot.nix new file mode 100644 index 0000000..53a9686 --- /dev/null +++ b/hosts/rv2/boot.nix @@ -0,0 +1,7 @@ +{ + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 10; + }; + boot.loader.efi.canTouchEfiVariables = true; +} diff --git a/hosts/rv2/default.nix b/hosts/rv2/default.nix new file mode 100644 index 0000000..92231fd --- /dev/null +++ b/hosts/rv2/default.nix @@ -0,0 +1,58 @@ +{ inputs, outputs, ... }: + +{ + imports = [ + ./boot.nix + ./hardware.nix + ./packages.nix + ./secrets + ./services.nix + + ../../users/sid + + inputs.synix.nixosModules.bluetooth + inputs.synix.nixosModules.common + inputs.synix.nixosModules.device.desktop + inputs.synix.nixosModules.hyprland + inputs.synix.nixosModules.virtualisation + + outputs.nixosModules.appimage + outputs.nixosModules.common + # outputs.nixosModules.docker # conflicts with `virtualisation.podman.dockerCompat` + outputs.nixosModules.docs + outputs.nixosModules.syncthing + outputs.nixosModules.tailscale + outputs.nixosModules.wine + ]; + + networking.hostName = "rv2"; + + programs.steam.enable = true; + + programs.adb.enable = true; + users.users.sid.extraGroups = [ + "adbusers" + "kvm" + ]; + + boot.binfmt.emulatedSystems = [ + "aarch64-linux" + ]; + + normalUsers = { + sid = { + extraGroups = [ + "audio" + "dialout" + "floppy" + "input" + "libvirtd" + "lp" + "networkmanager" + "video" + ]; + }; + }; + + system.stateVersion = "25.05"; +} diff --git a/hosts/rv2/disks.nix b/hosts/rv2/disks.nix new file mode 100644 index 0000000..f7d13cb --- /dev/null +++ b/hosts/rv2/disks.nix @@ -0,0 +1,90 @@ +{ + disko.devices = { + disk = { + root = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + zfs = { + size = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + }; + }; + }; + }; + }; + zpool = { + zroot = { + type = "zpool"; + rootFsOptions = { + mountpoint = "none"; + compression = "zstd"; + acltype = "posixacl"; + xattr = "sa"; + atime = "off"; + "com.sun:auto-snapshot" = "true"; + }; + options.ashift = "12"; + datasets = { + "root" = { + type = "zfs_fs"; + options = { + encryption = "aes-256-gcm"; + keyformat = "passphrase"; + keylocation = "prompt"; + }; + mountpoint = "/"; + }; + "root/nix" = { + type = "zfs_fs"; + mountpoint = "/nix"; + options.atime = "off"; + }; + "root/home" = { + type = "zfs_fs"; + mountpoint = "/home"; + }; + "root/swap" = { + type = "zfs_volume"; + size = "8G"; + content = { + type = "swap"; + randomEncryption = true; + }; + options = { + volblocksize = "4k"; + compression = "off"; + logbias = "throughput"; + sync = "always"; + primarycache = "metadata"; + secondarycache = "none"; + "com.sun:auto-snapshot" = "false"; + }; + }; + "root/reserved" = { + type = "zfs_fs"; + options = { + mountpoint = "none"; + reservation = "5G"; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/rv2/disks.sh b/hosts/rv2/disks.sh new file mode 100644 index 0000000..69d97ce --- /dev/null +++ b/hosts/rv2/disks.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +SSD='/dev/disk/by-id/nvme-TEAM_TM8FPD001T_TPBF2503240010201457' +MNT='/mnt' +SWAP_GB=16 + +# Helper function to wait for devices +wait_for_device() { + local device=$1 + echo "Waiting for device: $device ..." + while [[ ! -e $device ]]; do + sleep 1 + done + echo "Device $device is ready." +} + +if ! command -v sgdisk &> /dev/null; then + nix-env -iA nixos.gptfdisk +fi + +swapoff --all +udevadm settle + +wait_for_device $SSD + +echo "Partitioning $SSD..." +sgdisk -n5:0:+"$SWAP_GB"G -t5:8200 -c5:SWAP $SSD +sgdisk -n6:0:0 -t6:8304 -c6:ROOT $SSD +partprobe -s $SSD +udevadm settle + +wait_for_device ${SSD}-part1 # Windows ESP +wait_for_device ${SSD}-part5 +wait_for_device ${SSD}-part6 + +echo "Formatting partitions..." +mkswap -L SWAP "${SSD}-part5" +mkfs.ext4 -L ROOT "${SSD}-part6" + +echo "Mounting partitions..." +mount -o X-mount.mkdir "${SSD}-part6" "$MNT" +mkdir -p "$MNT/boot" +mount "${SSD}-part1" "$MNT/boot" + +echo "Enabling swap..." +swapon "${SSD}-part5" + +echo "Partitioning and setup complete:" +lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL diff --git a/hosts/rv2/hardware.nix b/hosts/rv2/hardware.nix new file mode 100644 index 0000000..d34a7cc --- /dev/null +++ b/hosts/rv2/hardware.nix @@ -0,0 +1,50 @@ +{ + inputs, + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + inputs.nixos-hardware.nixosModules.common-gpu-amd-southern-islands + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/ROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/SYSTEM"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/SWAP"; } + ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/rv2/packages.nix b/hosts/rv2/packages.nix new file mode 100644 index 0000000..2eee3ed --- /dev/null +++ b/hosts/rv2/packages.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: + +{ + environment = { + systemPackages = with pkgs; [ + ]; + }; +} diff --git a/hosts/rv2/secrets/default.nix b/hosts/rv2/secrets/default.nix new file mode 100644 index 0000000..db5b0d9 --- /dev/null +++ b/hosts/rv2/secrets/default.nix @@ -0,0 +1,5 @@ +{ inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.sops ]; +} diff --git a/hosts/rv2/secrets/secrets.yaml b/hosts/rv2/secrets/secrets.yaml new file mode 100644 index 0000000..31066d3 --- /dev/null +++ b/hosts/rv2/secrets/secrets.yaml @@ -0,0 +1,30 @@ +wireguard: + private-key: ENC[AES256_GCM,data:xUOZdGM2Wbi3ih6yankUMPqot4gDyj6AA4nMQKkHhM0dlsswyxnDQlEsNrQ=,iv:EtScTgdBYAuQUfa2TOMqCcCyVR5D60B8aA67W7uxnK4=,tag:RMd+ZplQDKaEl7qIIGIkoA==,type:str] +tailscale: + auth-key: ENC[AES256_GCM,data:oR4rdZlsq+gA5SMWXZW/2aOLU589EQGyfXl+u/CnXWPNbYRMDdmiHtZO/13PVOjJ,iv:B9RgTEom8naZxDZR9RPoQo3DNQeY4meyFcqqBqSBblA=,tag:BkCxbt67ErdidrLzjkEYnw==,type:str] +syncthing: + gui-pw: ENC[AES256_GCM,data:yu8e1JCzZxu/VIQ4mmyqPNBkxd0=,iv:X8U91uI5VlOluQmpkcdP2b3uf1rTI3j+RcBmK1gBqKI=,tag:SmMqsW+gfSZS/dA8GObnig==,type:str] +sops: + age: + - recipient: age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA3U2Z0UkxBL0xDOEgvNGlJ + SDQxNk9ndFRIZmdvdUZzUUpvZkR0dzZ1Um1FCm1sdFd2VU5CWmdsZk9lTzVqdXpP + ZXYvU3lkVXdxZlZaaGs0K1BBT0t3Z28KLS0tIHUvZ0R1ZTh1a25xQVRLTEFqVGVG + bU5CRm1iZGpZeTRvSjArQlBmQlhQelEKIhbrAQycS6WaCahA0PDPINEq12CKi0Ac + Z3o6puDD1v1QIqAHvZBvn1o2V/xN4gj/jHo73El1BJavgXvMBEneyg== + -----END AGE ENCRYPTED FILE----- + - recipient: age1j6s2ec3ltm9004fhvmd7xqq0zna2fr4m8kw4f235r9k0hfryjctq050vs2 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBrd2xwbmYwQytkUi9aY2JH + SUNiZXAwb0lYbFluYWw2eDlJV2RyNGg1bWpjCkpOUlUxSGpXbXl0NjBLZDAwaFF2 + UFBuaXhlZzloa0VCZFg1eTFldVQxV1UKLS0tIHVtKyt6czg2NGJNbldsZ1JiVzZa + MUVCWWVHbmVCRnlnRjI0TUt6cFVnazQKZeDi8y5khMHG2uEIXdxSDAU+Eew0AMv3 + jiEUyyClSas7BVaJvAGl56cIg1jfjrNEBb5rQD2mISsuM2rIuRNc/Q== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-02-02T12:15:13Z" + mac: ENC[AES256_GCM,data:HpbL6uC0wZTSsjGU4DrQE8NTd+DaImXqvRObReF4uDtBgUlKYmn0/UZIThL1QCMiwUYN/SeOwNtGiT5lH/xZeoBdS683AIGfULqXxPx1EZ3NRBkSmQfayt8ltGJwozitJ59Tipv2buDEEcefCw1aG8l3qrQRc0eM09iOIeoZv5o=,iv:wdn0I7YQ4f3IgdjEZP5MdpOO2WL3dKKVF3RryJZ2ODQ=,tag:0Ri3AoYwN9SuzXo92zf6FA==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 diff --git a/hosts/rv2/services.nix b/hosts/rv2/services.nix new file mode 100644 index 0000000..ca4c14f --- /dev/null +++ b/hosts/rv2/services.nix @@ -0,0 +1,52 @@ +{ + inputs, + outputs, + config, + ... +}: + +{ + imports = [ + inputs.synix.nixosModules.openssh + inputs.synix.nixosModules.windows-oci + + outputs.nixosModules.forgejo-runner + ]; + + services.openssh.enable = true; + + # FIXME: + # connect in weechat: + # /server add local localhost/6667 + # /set irc.server.local.password "abc" + # /set irc.server.local.tls off + # Access denied: Bad password? + services.ngircd = { + enable = true; + config = '' + [Global] + Name = irc.local + Info = Minimal ngIRCd Server + Password = yourmom69 + ''; + }; + + services.windows-oci = { + # enable = true; + sharedVolume = "/home/sid/pub"; + }; + time.hardwareClockInLocalTime = true; # Windows compatibility + + services.forgejo-runner = { + # enable = true; + url = "https://git.sid.ovh"; + # tokenFile = config.sops.templates."forgejo-runner/token".path; + label = "runner"; + }; + # sops = { + # secrets."forgejo-runner/token" = { }; + # templates."forgejo-runner/token".content = '' + # TOKEN=${config.sops.placeholder."forgejo-runner/token"} + # ''; + # }; +} diff --git a/modules/home/common/default.nix b/modules/home/common/default.nix new file mode 100644 index 0000000..afd8555 --- /dev/null +++ b/modules/home/common/default.nix @@ -0,0 +1,13 @@ +{ + imports = [ + ./overlays.nix + ]; + + nixpkgs.config.allowUnfree = true; + + # trace: warning: `programs.ssh` default values will be removed in the future. + # Consider setting `programs.ssh.enableDefaultConfig` to false, + # and manually set the default values you want to keep at + # `programs.ssh.matchBlocks."*"`. + programs.ssh.enableDefaultConfig = false; +} diff --git a/modules/home/common/overlays.nix b/modules/home/common/overlays.nix new file mode 100644 index 0000000..f3979b1 --- /dev/null +++ b/modules/home/common/overlays.nix @@ -0,0 +1,12 @@ +{ outputs, ... }: + +{ + nixpkgs.overlays = [ + outputs.overlays.synix-packages + outputs.overlays.local-packages + outputs.overlays.modifications + outputs.overlays.old-old-stable-packages + outputs.overlays.old-stable-packages + outputs.overlays.unstable-packages + ]; +} diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..28a636c --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,3 @@ +{ + common = import ./common; +} diff --git a/modules/nixos/anything-llm-oci/default.nix b/modules/nixos/anything-llm-oci/default.nix new file mode 100644 index 0000000..4d577c4 --- /dev/null +++ b/modules/nixos/anything-llm-oci/default.nix @@ -0,0 +1,30 @@ +{ config, inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.anything-llm-oci ]; + + services.anything-llm-oci = { + enable = true; + environment = { + LLM_PROVIDER = "openrouter"; + OPENROUTER_MODEL_PREF = "google/gemini-3-pro-preview"; + }; + environmentFile = config.sops.templates."anything-llm-oci/environment".path; + }; + + sops = { + secrets."anything-llm-oci/openrouter-api-key" = { }; + + # Generate with: nix-shell -p openssl --run "openssl rand -hex 32" + secrets."anything-llm-oci/jwt-secret" = { }; + secrets."anything-llm-oci/sig-key" = { }; + secrets."anything-llm-oci/sig-salt" = { }; + + templates."anything-llm-oci/environment".content = '' + OPENROUTER_API_KEY=${config.sops.placeholder."anything-llm-oci/openrouter-api-key"} + JWT_SECRET=${config.sops.placeholder."anything-llm-oci/jwt-secret"} + SIG_KEY=${config.sops.placeholder."anything-llm-oci/sig-key"} + SIG_SALT=${config.sops.placeholder."anything-llm-oci/sig-salt"} + ''; + }; +} diff --git a/modules/nixos/appimage/default.nix b/modules/nixos/appimage/default.nix new file mode 100644 index 0000000..eb93727 --- /dev/null +++ b/modules/nixos/appimage/default.nix @@ -0,0 +1,6 @@ +{ + programs.appimage = { + enable = true; + binfmt = true; + }; +} diff --git a/modules/nixos/common/default.nix b/modules/nixos/common/default.nix new file mode 100644 index 0000000..ebba501 --- /dev/null +++ b/modules/nixos/common/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./nix.nix + ./overlays.nix + ]; + + nixpkgs.config.allowUnfree = true; +} diff --git a/modules/nixos/common/nix.nix b/modules/nixos/common/nix.nix new file mode 100644 index 0000000..b0eed13 --- /dev/null +++ b/modules/nixos/common/nix.nix @@ -0,0 +1,29 @@ +{ + nix = { + # TODO: add distributed build support for portuus.de + # distributedBuilds = true; + # buildMachines = [ + # { + # hostName = "portuus.de"; + # supportedFeatures = [ + # "benchmark" + # "big-parallel" + # "kvm" + # "nixos-test" + # ]; + # maxJobs = 8; + # system = "x86_64-linux"; + # } + # ]; + + settings = { + # binary caches + # substituters = [ + # "https://cache.portuus.de" + # ]; + # trusted-public-keys = [ + # "cache.portuus.de:INZRjwImLIbPbIx8Qp38gTVmSNL0PYE4qlkRzQY2IAU=" + # ]; + }; + }; +} diff --git a/modules/nixos/common/overlays.nix b/modules/nixos/common/overlays.nix new file mode 100644 index 0000000..f3979b1 --- /dev/null +++ b/modules/nixos/common/overlays.nix @@ -0,0 +1,12 @@ +{ outputs, ... }: + +{ + nixpkgs.overlays = [ + outputs.overlays.synix-packages + outputs.overlays.local-packages + outputs.overlays.modifications + outputs.overlays.old-old-stable-packages + outputs.overlays.old-stable-packages + outputs.overlays.unstable-packages + ]; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..63a8f0b --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,13 @@ +{ + anything-llm-oci = import ./anything-llm-oci; + appimage = import ./appimage; + common = import ./common; + docker = import ./docker; + docs = import ./docs; + forgejo-runner = import ./forgejo-runner; + monero = import ./monero; + nh = import ./nh; + syncthing = import ./syncthing; + tailscale = import ./tailscale; + wine = import ./wine; +} diff --git a/modules/nixos/docker/default.nix b/modules/nixos/docker/default.nix new file mode 100644 index 0000000..6d377bd --- /dev/null +++ b/modules/nixos/docker/default.nix @@ -0,0 +1,9 @@ +{ + virtualisation.docker = { + enable = true; + rootless = { + enable = true; + setSocketVariable = true; + }; + }; +} diff --git a/modules/nixos/docs/default.nix b/modules/nixos/docs/default.nix new file mode 100644 index 0000000..62a1e93 --- /dev/null +++ b/modules/nixos/docs/default.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: + +{ + documentation = { + dev.enable = true; + man = { + man-db.enable = true; + mandoc.enable = false; + generateCaches = true; + }; + }; + + environment.systemPackages = with pkgs; [ + synix.cppman + synix.pyman + man-pages + man-pages-posix + ]; +} diff --git a/modules/nixos/forgejo-runner/default.nix b/modules/nixos/forgejo-runner/default.nix new file mode 100644 index 0000000..75c8035 --- /dev/null +++ b/modules/nixos/forgejo-runner/default.nix @@ -0,0 +1,79 @@ +{ + config, + lib, + pkgs, + ... +}: + +let + cfg = config.services.forgejo-runner; + + inherit (lib) + mkEnableOption + mkIf + mkOption + types + ; +in +{ + options.services.forgejo-runner = { + enable = mkEnableOption "Nix-based Forgejo Runner service"; + url = mkOption { + type = types.str; + description = "Forgejo instance URL."; + }; + tokenFile = mkOption { + type = types.path; + description = "Path to EnvironmentFile containing TOKEN=..."; + }; + instance = mkOption { + type = types.str; + default = "default"; + description = "Name of the runner instance."; + }; + label = mkOption { + type = types.str; + default = "host"; + description = "Runner label."; + }; + }; + + config = mkIf cfg.enable { + nix.settings.trusted-users = [ "gitea-runner" ]; + + services.gitea-actions-runner = { + package = pkgs.forgejo-runner; + instances."${cfg.instance}" = { + enable = true; + name = "${config.networking.hostName}-nix"; + inherit (cfg) url tokenFile; + + labels = [ "${cfg.label}:host" ]; + + hostPackages = with pkgs; [ + bash + coreutils + curl + deploy-rs + gitMinimal + gnused + nix + nodejs + openssh + ]; + + settings = { + log.level = "info"; + runner = { + capacity = 4; + envs = { + NIX_CONFIG = "extra-experimental-features = nix-command flakes"; + NIX_REMOTE = "daemon"; + # inherit (config.systemd.services."gitea-runner-${cfg.instance}".environment) HOME; + }; + }; + }; + }; + }; + }; +} diff --git a/modules/nixos/monero/default.nix b/modules/nixos/monero/default.nix new file mode 100644 index 0000000..aa3df93 --- /dev/null +++ b/modules/nixos/monero/default.nix @@ -0,0 +1,111 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + cfg = config.services.monero; + sops = config.sops; + + inherit (lib) mkDefault mkIf getExe; +in +{ + config = mkIf cfg.enable { + services.monero = { + environmentFile = sops.templates."monero/environment-file".path; + mining.enable = false; # use XMRig + P2Pool + rpc = { + address = mkDefault "127.0.0.1"; + port = mkDefault 18081; + user = mkDefault "monero"; + password = mkDefault "$MONERO_RPC_PASSWORD"; + }; + extraConfig = '' + zmq-pub=tcp://127.0.0.1:18083 + out-peers=32 + in-peers=64 + prune-blockchain=1 + sync-pruned-blocks=1 + add-priority-node=p2pmd.xmrvsbeast.com:18080 + add-priority-node=nodes.hashvault.pro:18080 + enforce-dns-checkpointing=1 + enable-dns-blocklist=1 + ''; + }; + + systemd.services.p2pool = { + description = "P2Pool Monero Sidechain Node"; + after = [ + "monero.service" + "network.target" + ]; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.p2pool ]; + + serviceConfig = { + User = "p2pool"; + Group = "p2pool"; + WorkingDirectory = "/var/lib/p2pool"; + ExecStart = "${getExe pkgs.p2pool} --host 127.0.0.1 --wallet ${cfg.mining.address}"; + Restart = "always"; + RestartSec = 10; + NoNewPrivileges = true; + PrivateTmp = true; + ProtectSystem = "strict"; + ProtectHome = true; + }; + }; + + users.users.p2pool = { + isSystemUser = true; + group = "p2pool"; + home = "/var/lib/p2pool"; + createHome = true; + }; + users.groups.p2pool = { }; + + services.xmrig = { + enable = true; + settings = { + autosave = true; + cpu = { + enabled = true; + huge-pages = true; + hw-aes = null; + asm = true; + yield = true; + }; + opencl.enabled = false; + cuda.enabled = false; + pools = [ + { + url = "127.0.0.1:3333"; + user = ""; + pass = ""; + } + ]; + api.enable = true; + }; + }; + + sops = + let + owner = "monero"; + group = "monero"; + mode = "0440"; + in + { + secrets."monero/rpc-password" = { + inherit owner group mode; + }; + templates."monero/environment-file" = { + inherit owner group mode; + content = '' + MONERO_RPC_PASSWORD=${sops.placeholder."monero/rpc-password"} + ''; + }; + }; + }; +} diff --git a/modules/nixos/nh/default.nix b/modules/nixos/nh/default.nix new file mode 100644 index 0000000..afbd633 --- /dev/null +++ b/modules/nixos/nh/default.nix @@ -0,0 +1,18 @@ +{ config, lib, ... }: + +let + # NOTE: Add a "main user" option to normalUsers? This would also set a sane default for the Syncthing module. + user = "sid"; + + inherit (lib) mkDefault mkForce; +in +{ + programs.nh = { + enable = mkDefault true; + clean.enable = mkDefault true; + clean.extraArgs = mkDefault "--keep-since 4d --keep 3"; + flake = config.users.users."${user}".home + "/.config/nixos"; + }; + + nix.gc.automatic = mkForce false; # collides with `programs.nh.clean` +} diff --git a/modules/nixos/syncthing/default.nix b/modules/nixos/syncthing/default.nix new file mode 100644 index 0000000..fa023c1 --- /dev/null +++ b/modules/nixos/syncthing/default.nix @@ -0,0 +1,86 @@ +{ config, lib, ... }: + +let + cfg = config.services.syncthing; + guiPort = 8384; + transferPort = 22000; + fqdn = "sync.local"; + + user = "sid"; + dirs = [ + "aud" + "doc" + "img" + "vid" + ]; + + allDevices = { + "16ach6" = { + id = "5IPAQ5C-V3KFUMD-NJM74SH-6MD246O-JGYCBN4-F77QG6W-W3WNSCA-NQY37AY"; + addresses = [ "tcp://100.64.0.2:${toString transferPort}" ]; + }; + rv2 = { + id = "JG6BYOJ-AW67R72-VA25U6I-VIZ57HU-3KXMPGY-HTYT2FQ-ZZL6U7B-Z2RWDQ4"; + addresses = [ "tcp://100.64.0.11:${toString transferPort}" ]; + }; + rx4 = { + id = "GBTCUX6-MAXC7NL-IGCJWWE-OEMANRO-BWZGWFU-HHO3NGN-GIUCXJJ-MTWM6QP"; + addresses = [ "tcp://100.64.0.10:${toString transferPort}" ]; + }; + }; + + inherit (lib) filterAttrs genAttrs mkIf; + inherit (builtins) attrNames toString; +in +{ + services.syncthing = { + enable = true; + inherit user; + group = config.users.users.${user}.group; + dataDir = config.users.users.${user}.home; + + guiAddress = "0.0.0.0:${toString guiPort}"; + guiPasswordFile = config.sops.secrets."syncthing/gui-pw".path; + openDefaultPorts = true; + + overrideDevices = true; + overrideFolders = true; + + settings = { + devices = filterAttrs (n: v: n != config.networking.hostName) allDevices; + folders = genAttrs dirs (dir: { + path = "${config.users.users.${user}.home}/${dir}"; + devices = attrNames cfg.settings.devices; + }); + gui = { + inherit user; + }; + options = { + urAccepted = -1; # disable usage reports + }; + }; + }; + + networking.firewall.interfaces = mkIf config.services.tailscale.enable { + ${config.services.tailscale.interfaceName}.allowedTCPPorts = [ guiPort ]; + }; + + networking.hosts."127.0.0.1" = [ fqdn ]; + + services.nginx = { + enable = true; + virtualHosts."${fqdn}" = { + locations."/" = { + proxyPass = "http://127.0.0.1:${toString guiPort}"; + proxyWebsockets = true; + }; + }; + }; + + sops.secrets."syncthing/gui-pw" = { + owner = cfg.user; + group = cfg.group; + mode = "0400"; + restartUnits = [ "syncthing.service" ]; + }; +} diff --git a/modules/nixos/tailscale/default.nix b/modules/nixos/tailscale/default.nix new file mode 100644 index 0000000..26acd6e --- /dev/null +++ b/modules/nixos/tailscale/default.nix @@ -0,0 +1,11 @@ +{ inputs, ... }: + +{ + imports = [ inputs.synix.nixosModules.tailscale ]; + + services.tailscale = { + enable = true; + enableSSH = true; + loginServer = "https://hs.sid.ovh"; + }; +} diff --git a/modules/nixos/wine/default.nix b/modules/nixos/wine/default.nix new file mode 100644 index 0000000..dc935c2 --- /dev/null +++ b/modules/nixos/wine/default.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + wineWowPackages.waylandFull + winetricks + ]; + + hardware.graphics.enable32Bit = true; +} diff --git a/overlays/default.nix b/overlays/default.nix new file mode 100644 index 0000000..fb7df46 --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,45 @@ +{ inputs, ... }: + +{ + # synix packages accessible through 'pkgs.synix' + synix-packages = final: prev: { synix = inputs.synix.overlays.additions final prev; }; + + # packages in `pkgs/` accessible through 'pkgs.local' + local-packages = final: prev: { local = import ../pkgs { pkgs = final; }; }; + + # https://nixos.wiki/wiki/Overlays + modifications = + final: prev: + let + files = [ + # ./instaloader.nix + # ./zathura.nix # FIXME: How to use overrideScope? + ]; + imports = builtins.map (f: import f final prev) files; + in + builtins.foldl' (a: b: a // b) { } imports // inputs.synix.overlays.modifications final prev; + + # unstable nixpkgs accessible through 'pkgs.unstable' + unstable-packages = final: prev: { + unstable = import inputs.nixpkgs-unstable { + inherit (final) system; + inherit (prev) config; + }; + }; + + # old-stable nixpkgs accessible through 'pkgs.old-stable' + old-stable-packages = final: prev: { + old-stable = import inputs.nixpkgs-old-stable { + inherit (final) system; + inherit (prev) config; + }; + }; + + # old-old-stable nixpkgs accessible through 'pkgs.old-old-stable' + old-old-stable-packages = final: prev: { + old-old-stable = import inputs.nixpkgs-old-old-stable { + inherit (final) system; + inherit (prev) config; + }; + }; +} diff --git a/overlays/instaloader.nix b/overlays/instaloader.nix new file mode 100644 index 0000000..43878d3 --- /dev/null +++ b/overlays/instaloader.nix @@ -0,0 +1,12 @@ +final: prev: + +{ + instaloader = prev.instaloader.overrideAttrs (oldAttrs: { + src = prev.pkgs.fetchFromGitHub { + owner = "instaloader"; + repo = "instaloader"; + rev = "pull/2533/head"; + sha256 = "sha256-LMRU49pyAWDdflPbA4cZ9pIdjGNThLWfZWZsQkcvTs4="; + }; + }); +} diff --git a/overlays/zathura.nix b/overlays/zathura.nix new file mode 100644 index 0000000..455d336 --- /dev/null +++ b/overlays/zathura.nix @@ -0,0 +1,19 @@ +# `zathura_core` is not a toplevel package, threfore `prev.zathura_core` is not available +# Maybe `overrideScope` is needed: overrideScope = (scope -> scope -> AttrSet) -> scope +# But I don't know how to use it. +# zathura package definition: https://github.com/NixOS/nixpkgs/blob/nixos-24.11/pkgs/applications/misc/zathura/default.nix + +final: prev: { + # error: attribute 'overrideScope' missing + zathura = prev.zathura.overrideScope { + zathura_core = prev.zathura_core.overrideAttrs (oldAttrs: rec { + version = "0.5.4"; # latest version before https://github.com/pwmt/zathura/issues/447 + src = prev.fetchFromGitHub { + owner = "pwmt"; + repo = "zathura"; + rev = version; + hash = ""; + }; + }); + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..d569a09 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,16 @@ +{ + pkgs ? import , + ... +}: + +{ + gitingest = pkgs.python3Packages.callPackage ./gitingest { }; + open-webui-desktop = pkgs.callPackage ./open-webui-desktop { }; + otp = pkgs.callPackage ./otp { }; + pdf2printable = pkgs.callPackage ./pdf2printable { }; + transcribe = pkgs.callPackage ./transcribe { }; + udiskie-dmenu = pkgs.callPackage ./udiskie-dmenu { }; + yt2rss = pkgs.callPackage ./yt2rss { }; + + # spotify-to-tidal = pkgs.callPackage ./spotify-to-tidal { }; # FIXME +} diff --git a/pkgs/gitingest/default.nix b/pkgs/gitingest/default.nix new file mode 100644 index 0000000..7fcc46b --- /dev/null +++ b/pkgs/gitingest/default.nix @@ -0,0 +1,100 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # Dependencies + setuptools, + click, + fastapi, + pathspec, + pydantic, + python-dotenv, + slowapi, + starlette, + tiktoken, + tomli, + uvicorn, + loguru, + + # Tests + httpx, + jinja2, + gitMinimal, + pytest-asyncio, + pytest-mock, + pytestCheckHook, + python-multipart, +}: + +buildPythonPackage rec { + pname = "gitingest"; + version = "0.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "cyclotruc"; + repo = "gitingest"; + tag = "v${version}"; + hash = "sha256-drsncGneZyOCC2GJbrDM+bf4QGI2luacxMhrmdk03l4="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + click + fastapi + pathspec + pydantic + python-dotenv + slowapi + starlette + tiktoken + tomli + uvicorn + + httpx + loguru + ]; + + pythonImportsCheck = [ + "gitingest" + ]; + + nativeCheckInputs = [ + httpx + jinja2 + gitMinimal + pytest-asyncio + pytest-mock + pytestCheckHook + python-multipart + ]; + + doCheck = false; + + disabledTests = [ + # Tests require network + "test_cli_with_default_options" + "test_cli_with_options" + "test_cli_with_stdout_output" + "test_cli_writes_file" + "test_clone_specific_branch" + "test_include_ignore_patterns" + "test_ingest_with_gitignore" + "test_parse_query_with_branch" + "test_parse_query_without_host" + "test_run_ingest_query" + ]; + + meta = { + changelog = "https://github.com/cyclotruc/gitingest/releases/tag/${src.tag}"; + description = "Replace 'hub' with 'ingest' in any github url to get a prompt-friendly extract of a codebase"; + homepage = "https://github.com/cyclotruc/gitingest"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + mainProgram = "gitingest"; + }; +} diff --git a/pkgs/gitingest/default_nix-init.nix b/pkgs/gitingest/default_nix-init.nix new file mode 100644 index 0000000..e94ada4 --- /dev/null +++ b/pkgs/gitingest/default_nix-init.nix @@ -0,0 +1,68 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "gitingest"; + version = "0.3.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "coderamp-labs"; + repo = "gitingest"; + rev = "v${version}"; + hash = "sha256-drsncGneZyOCC2GJbrDM+bf4QGI2luacxMhrmdk03l4="; + }; + + build-system = [ + python3.pkgs.setuptools + python3.pkgs.wheel + ]; + + dependencies = with python3.pkgs; [ + click + httpx + loguru + pathspec + pydantic + python-dotenv + starlette + strenum + tiktoken + typing-extensions + ]; + + optional-dependencies = with python3.pkgs; { + dev = [ + eval-type-backport + pre-commit + pytest + pytest-asyncio + pytest-cov + pytest-mock + ]; + server = [ + boto3 + fastapi + prometheus-client + sentry-sdk + slowapi + uvicorn + ]; + }; + + pythonImportsCheck = [ + "gitingest" + ]; + + meta = { + description = "Replace 'hub' with 'ingest' in any GitHub URL to get a prompt-friendly extract of a codebase"; + homepage = "https://github.com/coderamp-labs/gitingest"; + changelog = "https://github.com/coderamp-labs/gitingest/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + mainProgram = "gitingest"; + }; +} diff --git a/pkgs/open-webui-desktop/default.nix b/pkgs/open-webui-desktop/default.nix new file mode 100644 index 0000000..a0a76ea --- /dev/null +++ b/pkgs/open-webui-desktop/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildNpmPackage, + fetchFromGitHub, + electron, +}: + +buildNpmPackage rec { + pname = "open-webui-desktop"; + version = "7e54042"; + + src = fetchFromGitHub { + owner = "open-webui"; + repo = "desktop"; + rev = "build-e${version}"; + hash = "sha256-eW3B8CS2T46Z91JRAlZJ3rNxAru4p7eJwyxn6P20pnA="; + }; + + npmDepsHash = "sha256-HdkgbcLzY/9T26hpw6Jej8sUWlcIIn1FkJ7IVvG3P4o="; + + makeCacheWritable = true; + + # Create .npmrc to prevent scripts from running during install + postPatch = '' + cat >> .npmrc << 'EOF' + ignore-scripts=true + EOF + ''; + + preInstall = '' + sed -i '/postinstall/d' package.json + ''; + + npmRebuild = false; + + buildPhase = '' + export ELECTRON_SKIP_BINARY_DOWNLOAD=1 + npm run build + ''; + + installPhase = '' + mkdir -p $out/opt/${pname} + cp -r out $out/opt/${pname}/ + cp -r resources $out/opt/${pname}/ + cp -r node_modules $out/opt/${pname}/ + mkdir -p $out/bin + + makeWrapper ${electron}/bin/electron $out/bin/${pname} \ + --add-flags "$out/opt/${pname}/out/main/index.js" \ + --run "cd $out/opt/${pname}" + ''; + + meta = { + description = "Open WebUI Desktop 🌐 (Alpha)"; + homepage = "https://github.com/open-webui/desktop"; + # license = lib.licenses.TODO; + mainProgram = "open-webui-desktop"; + platforms = lib.platforms.linux; + }; +} diff --git a/pkgs/otp/default.nix b/pkgs/otp/default.nix new file mode 100644 index 0000000..cfad4d0 --- /dev/null +++ b/pkgs/otp/default.nix @@ -0,0 +1,15 @@ +{ + writeShellScriptBin, + symlinkJoin, + ... +}: + +let + wrapped = writeShellScriptBin "otp" (builtins.readFile ./otp.sh); +in +symlinkJoin { + name = "otp"; + paths = [ + wrapped + ]; +} diff --git a/pkgs/otp/otp.sh b/pkgs/otp/otp.sh new file mode 100644 index 0000000..1012b01 --- /dev/null +++ b/pkgs/otp/otp.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +DMENU="bemenu" +OPTIONS="github\nth-koeln" + +CHOICE=$(echo -e "$OPTIONS" | "$DMENU" -p "OTP:") + +get_pass() { + pass otp -c "$1" 2>/dev/null +} + +case "$CHOICE" in + "github") + get_pass "www/github.com" + ;; + "th-koeln") + get_pass "www/login.th-koeln.de" + ;; + *) + echo "Error: Unknown option '$CHOICE'" + exit 1 + ;; +esac + +exit 0 diff --git a/pkgs/pdf2printable/default.nix b/pkgs/pdf2printable/default.nix new file mode 100644 index 0000000..899ca99 --- /dev/null +++ b/pkgs/pdf2printable/default.nix @@ -0,0 +1,39 @@ +{ + writeShellScriptBin, + pdftk, + texlivePackages, +}: + +let + _pdfjam = "${texlivePackages.pdfjam}/bin/pdfjam"; + _pdftk = "${pdftk}/bin/pdftk"; +in +writeShellScriptBin "pdf2printable" '' + if [ "$#" -ne 2 ]; then + echo "Usage: $0 input.pdf output.pdf" + exit 1 + fi + + input_pdf="$1" + output_pdf="$2" + + even_pdf="even.pdf" + even_rotated_pdf="even_rotated.pdf" + landscape_pdf="landscape.pdf" + odd_pdf="odd.pdf" + + # Convert the PDF to landscape + ${_pdfjam} --landscape --nup 2x1 "$input_pdf" -o "$landscape_pdf" + + # Split the PDF into odd and even pages + ${_pdftk} "$landscape_pdf" cat odd output "$odd_pdf" + ${_pdftk} "$landscape_pdf" cat even output "$even_pdf" + + # Rotate the even pages by 180 degrees + ${_pdfjam} --landscape "$even_pdf" --angle 180 --outfile "$even_rotated_pdf" + + # Merge the odd and rotated even pages + ${_pdftk} A="$odd_pdf" B="$even_rotated_pdf" shuffle A B output "$output_pdf" + + rm "$odd_pdf" "$even_pdf" "$landscape_pdf" "$even_rotated_pdf" +'' diff --git a/pkgs/spotify-to-tidal/default.nix b/pkgs/spotify-to-tidal/default.nix new file mode 100644 index 0000000..90958b0 --- /dev/null +++ b/pkgs/spotify-to-tidal/default.nix @@ -0,0 +1,44 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "spotify-to-tidal"; + version = "1.0.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "spotify2tidal"; + repo = "spotify_to_tidal"; + rev = "v${version}"; + hash = "sha256-NexwO4Qwv1P58QAgBHPfCf4Q/mhTicWHaRubh8En9AE="; + }; + + build-system = [ + python3.pkgs.setuptools + python3.pkgs.wheel + ]; + + dependencies = with python3.pkgs; [ + pytest + pytest-mock + pyyaml + spotipy + sqlalchemy + tidalapi + tqdm + ]; + + pythonImportsCheck = [ + "spotify_to_tidal" + ]; + + meta = { + description = "A command line tool for importing your Spotify playlists into Tidal"; + homepage = "https://github.com/spotify2tidal/spotify_to_tidal"; + license = lib.licenses.agpl3Only; + mainProgram = "spotify-to-tidal"; + }; +} diff --git a/pkgs/transcribe/default.nix b/pkgs/transcribe/default.nix new file mode 100644 index 0000000..8b9b6bd --- /dev/null +++ b/pkgs/transcribe/default.nix @@ -0,0 +1,22 @@ +{ + python3Packages, + ... +}: + +python3Packages.buildPythonApplication { + pname = "transcribe"; + version = "1.0.0"; + + src = ./.; + pyproject = true; + + build-system = [ python3Packages.setuptools ]; + + propagatedBuildInputs = [ python3Packages.openai ]; + + doCheck = false; + + meta = { + description = "Transcribe a given audio file using the OpenAI API."; + }; +} diff --git a/pkgs/transcribe/setup.py b/pkgs/transcribe/setup.py new file mode 100644 index 0000000..049572c --- /dev/null +++ b/pkgs/transcribe/setup.py @@ -0,0 +1,7 @@ +from setuptools import setup + +setup( + name='transcribe', + version='1.0.0', +scripts=['transcribe'], +) diff --git a/pkgs/transcribe/transcribe b/pkgs/transcribe/transcribe new file mode 100644 index 0000000..4f7778b --- /dev/null +++ b/pkgs/transcribe/transcribe @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 + +import sys +import os +from openai import OpenAI + +def transcribe_audio(file_path): + """Transcribe the given audio file using OpenAI API.""" + if not os.environ.get("OPENAI_API_KEY"): + print("Error: OPENAI_API_KEY environment variable is not set.") + return None + + if not os.path.exists(file_path): + print(f"Error: File '{file_path}' not found.") + return None + + try: + client = OpenAI() + + with open(file_path, "rb") as audio_file: + transcription = client.audio.transcriptions.create( + # model="gpt-4o-transcribe", + model="whisper-1", + file=audio_file, + response_format="text" + ) + + return transcription + + except Exception as e: + print(f"Error occurred during transcription: {e}") + return None + +def main(): + if len(sys.argv) != 2: + print("Usage: transcribe ") + sys.exit(1) + + audio_file_path = sys.argv[1] + + transcription = transcribe_audio(audio_file_path) + + if transcription: + print(transcription) + +if __name__ == "__main__": + main() diff --git a/pkgs/udiskie-dmenu/Cargo.lock b/pkgs/udiskie-dmenu/Cargo.lock new file mode 100644 index 0000000..5a9cb33 --- /dev/null +++ b/pkgs/udiskie-dmenu/Cargo.lock @@ -0,0 +1,1241 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "async-broadcast" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532" +dependencies = [ + "event-listener", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-executor" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +dependencies = [ + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-fs" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" +dependencies = [ + "async-lock", + "blocking", + "futures-lite", +] + +[[package]] +name = "async-io" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" +dependencies = [ + "async-lock", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite", + "parking", + "polling", + "rustix", + "slab", + "tracing", + "windows-sys", +] + +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener", + "event-listener-strategy", + "pin-project-lite", +] + +[[package]] +name = "async-process" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" +dependencies = [ + "async-channel", + "async-io", + "async-lock", + "async-signal", + "async-task", + "blocking", + "cfg-if", + "event-listener", + "futures-lite", + "rustix", + "tracing", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-signal" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" +dependencies = [ + "async-io", + "async-lock", + "atomic-waker", + "cfg-if", + "futures-core", + "futures-io", + "rustix", + "signal-hook-registry", + "slab", + "windows-sys", +] + +[[package]] +name = "async-task" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" + +[[package]] +name = "async-trait" +version = "0.1.85" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + +[[package]] +name = "blocking" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +dependencies = [ + "async-channel", + "async-task", + "futures-io", + "futures-lite", + "piper", +] + +[[package]] +name = "cc" +version = "1.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "endi" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" + +[[package]] +name = "enumflags2" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba2f4b465f5318854c6f8dd686ede6c0a9dc67d4b1ac241cf0eb51521a309147" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4caf64a58d7a6d65ab00639b046ff54399a39f5f2554728895ace4b297cd79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-lite" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-io", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "indexmap" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "log" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" + +[[package]] +name = "mac-notification-sys" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce8f34f3717aa37177e723df6c1fc5fb02b2a1087374ea3fe0ea42316dc8f91" +dependencies = [ + "cc", + "dirs-next", + "objc-foundation", + "objc_id", + "time", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", + "memoffset", +] + +[[package]] +name = "notify-rust" +version = "4.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ae13fb6065b0865d2310dfa55ce319245052ed95fbbe2bc87c99962c58d73f" +dependencies = [ + "log", + "mac-notification-sys", + "serde", + "tauri-winrt-notification", + "zbus", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "once_cell" +version = "1.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" + +[[package]] +name = "ordered-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" +dependencies = [ + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "piper" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" +dependencies = [ + "atomic-waker", + "fastrand", + "futures-io", +] + +[[package]] +name = "polling" +version = "3.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi", + "pin-project-lite", + "rustix", + "tracing", + "windows-sys", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + +[[package]] +name = "rustix" +version = "0.38.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "serde" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.217" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.136" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "336a0c23cf42a38d9eaa7cd22c7040d04e1228a19a933890805ffd00a16437d2" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "syn" +version = "2.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tauri-winrt-notification" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89f5fb70d6f62381f5d9b2ba9008196150b40b75f3068eb24faeddf1c686871" +dependencies = [ + "quick-xml", + "windows", + "windows-version", +] + +[[package]] +name = "tempfile" +version = "3.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +dependencies = [ + "cfg-if", + "fastrand", + "getrandom", + "once_cell", + "rustix", + "windows-sys", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[package]] +name = "udiskie-dmenu" +version = "0.1.0" +dependencies = [ + "notify-rust", + "serde", + "serde_json", +] + +[[package]] +name = "uds_windows" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" +dependencies = [ + "memoffset", + "tempfile", + "winapi", +] + +[[package]] +name = "unicode-ident" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows-version" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c12476c23a74725c539b24eae8bfc0dac4029c39cdb561d9f23616accd4ae26d" +dependencies = [ + "windows-targets 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.6.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +dependencies = [ + "memchr", +] + +[[package]] +name = "xdg-home" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "zbus" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "192a0d989036cd60a1e91a54c9851fb9ad5bd96125d41803eed79d2e2ef74bd7" +dependencies = [ + "async-broadcast", + "async-executor", + "async-fs", + "async-io", + "async-lock", + "async-process", + "async-recursion", + "async-task", + "async-trait", + "blocking", + "enumflags2", + "event-listener", + "futures-core", + "futures-util", + "hex", + "nix", + "ordered-stream", + "serde", + "serde_repr", + "static_assertions", + "tracing", + "uds_windows", + "windows-sys", + "winnow", + "xdg-home", + "zbus_macros", + "zbus_names", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3685b5c81fce630efc3e143a4ded235b107f1b1cdf186c3f115529e5e5ae4265" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zbus_names", + "zvariant", + "zvariant_utils", +] + +[[package]] +name = "zbus_names" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "519629a3f80976d89c575895b05677cbc45eaf9f70d62a364d819ba646409cc8" +dependencies = [ + "serde", + "static_assertions", + "winnow", + "zvariant", +] + +[[package]] +name = "zvariant" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55e6b9b5f1361de2d5e7d9fd1ee5f6f7fcb6060618a1f82f3472f58f2b8d4be9" +dependencies = [ + "endi", + "enumflags2", + "serde", + "static_assertions", + "winnow", + "zvariant_derive", + "zvariant_utils", +] + +[[package]] +name = "zvariant_derive" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "573a8dd76961957108b10f7a45bac6ab1ea3e9b7fe01aff88325dc57bb8f5c8b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", + "zvariant_utils", +] + +[[package]] +name = "zvariant_utils" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd46446ea2a1f353bfda53e35f17633afa79f4fe290a611c94645c69fe96a50" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "static_assertions", + "syn", + "winnow", +] diff --git a/pkgs/udiskie-dmenu/Cargo.toml b/pkgs/udiskie-dmenu/Cargo.toml new file mode 100644 index 0000000..aa890b4 --- /dev/null +++ b/pkgs/udiskie-dmenu/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "udiskie-dmenu" +version = "0.1.0" +edition = "2021" + +[dependencies] +notify-rust = "4.5.0" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" diff --git a/pkgs/udiskie-dmenu/default.nix b/pkgs/udiskie-dmenu/default.nix new file mode 100644 index 0000000..8fbe05e --- /dev/null +++ b/pkgs/udiskie-dmenu/default.nix @@ -0,0 +1,13 @@ +{ + lib, + rustPlatform, + ... +}: + +rustPlatform.buildRustPackage { + pname = "udiskie-dmenu"; + version = "0.1.0"; + + cargoLock.lockFile = ./Cargo.lock; + src = lib.cleanSource ./.; +} diff --git a/pkgs/udiskie-dmenu/src/main.rs b/pkgs/udiskie-dmenu/src/main.rs new file mode 100644 index 0000000..c1e17fb --- /dev/null +++ b/pkgs/udiskie-dmenu/src/main.rs @@ -0,0 +1,190 @@ +use notify_rust::Notification; +use serde::{Deserialize, Serialize}; +use std::collections::HashMap; +use std::io::{self, Write}; +use std::process::{Command, Stdio}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +struct DeviceInfo { + label: Option, + isLuks: Option, + mountPath: Option, + devPath: String, +} + +fn main() { + match run_udiskie_info() { + Ok(block_devices) => { + let options = parse_udiskie_info(&block_devices); + if options.is_empty() { + notify_if_err("Nothing to unmount / mount".to_string()); + std::process::exit(0); + } + + match get_selection(pretty_print(&options)) { + Ok(Some(selected)) => { + let parsed_selection = parse_selection(&selected, &options); + for device in parsed_selection { + process_device(&device); + } + } + Ok(None) => {} // User cancelled input, do nothing + Err(err) => notify_if_err(err), + } + } + Err(err) => notify_if_err(err), + } +} + +fn run_udiskie_info() -> Result, String> { + let output = Command::new("udiskie-info") + .args(&["-C", "-a", "-o", r#""label":"{ui_label}", "isLuks":"{is_luks}", "mountPath": "{mount_path}""#]) + .output() + .map_err(|e| e.to_string())?; + + if !output.status.success() { + return Err(format!( + "Error running `udiskie-info`: {}", + String::from_utf8_lossy(&output.stderr) + )); + } + + let stdout = String::from_utf8_lossy(&output.stdout); + parse_udiskie_json(&stdout) +} + +fn parse_udiskie_json(json_lines: &str) -> Result, String> { + json_lines + .lines() + .filter(|line| !line.is_empty()) + .map(|line| { + let wrapped_line = format!("{{{}}}", line); + serde_json::from_str(&wrapped_line).map_err(|e| format!("JSON parsing error: {}", e)) + }) + .collect() +} + +fn parse_udiskie_info(devices: &[DeviceInfo]) -> HashMap { + let mut options: HashMap = HashMap::new(); + for device in devices { + if device.devPath.starts_with("/dev/loop") { + // Skip snap packages + continue; + } + + let key = device.devPath.clone(); + if let Some(existing) = options.get(&key) { + if existing.mountPath.is_some() && device.mountPath.is_none() { + continue; + } + if existing.isLuks.unwrap_or(false) && !device.isLuks.unwrap_or(false) { + continue; + } + } + + options.insert(key, device.clone()); + } + options +} + +fn pretty_print(parsed_info: &HashMap) -> String { + let mut output = String::new(); + for (dev_path, device) in parsed_info { + let dev_path_padded = format!("{: <9}", dev_path); + let label_or_mount_path = device + .mountPath + .clone() + .or_else(|| device.label.clone()) + .unwrap_or_else(|| "".to_string()); + output.push_str(&format!("{}: {}\n", dev_path_padded, label_or_mount_path)); + } + output +} + +fn get_selection(options: String) -> Result, String> { + let launcher = std::env::var("UDISKIE_DMENU_LAUNCHER").unwrap_or_else(|_| "dmenu".to_string()); + + let mut child = Command::new(launcher) + .stdin(Stdio::piped()) + .stdout(Stdio::piped()) + .spawn() + .map_err(|e| e.to_string())?; + + if let Some(stdin) = child.stdin.as_mut() { + stdin + .write_all(options.as_bytes()) + .map_err(|e| e.to_string())?; + } + + let output = child + .wait_with_output() + .map_err(|e| e.to_string())?; + + match output.status.code() { + Some(0) | Some(10) => { + let selection = String::from_utf8_lossy(&output.stdout).to_string(); + Ok(Some(selection)) + } + Some(_) | None => Ok(None), + } +} + +fn parse_selection(selection: &str, options: &HashMap) -> Vec { + let mut devices = Vec::new(); + + for line in selection.lines() { + if let Some((dev_path, _label_or_mount)) = line.split_once(":") { + let trimmed_path = dev_path.trim(); + if let Some(device) = options.get(trimmed_path) { + devices.push(device.clone()); + } + } + } + + devices +} + +fn notify_if_err(err: String) { + Notification::new() + .summary("Error") + .body(&err) + .show() + .ok(); + eprintln!("{}", err); +} + +fn process_device(device: &DeviceInfo) { + let udiskie_opt = if device.isLuks.unwrap_or(false) { + "--force" + } else { + "" + }; + + if let Some(mount_path) = &device.mountPath { + run_command( + &format!("udiskie-umount {} \"{}\"", udiskie_opt, mount_path), + Some("Failed to unmount device"), + ); + } else if let Some(label) = &device.label { + run_command( + &format!("udiskie-mount {} \"{}\"", udiskie_opt, device.devPath), + Some(&format!("Failed to mount device: {}", label)), + ); + } else { + notify_if_err("Unknown device - aborting".to_string()); + } +} + +fn run_command(command: &str, error_msg: Option<&str>) { + let status = Command::new("sh") + .arg("-c") + .arg(command) + .status() + .unwrap_or_else(|e| panic!("Failed to execute command: {}", e)); + + if !status.success() { + if let Some(msg) = error_msg { + notify_if_err(msg.to_string()); + } + } +} diff --git a/pkgs/yt2rss/default.nix b/pkgs/yt2rss/default.nix new file mode 100644 index 0000000..10d4594 --- /dev/null +++ b/pkgs/yt2rss/default.nix @@ -0,0 +1,15 @@ +{ + writeShellScriptBin, + symlinkJoin, + ... +}: + +let + wrapped = writeShellScriptBin "yt2rss" (builtins.readFile ./yt2rss.sh); +in +symlinkJoin { + name = "create"; + paths = [ + wrapped + ]; +} diff --git a/pkgs/yt2rss/yt2rss.sh b/pkgs/yt2rss/yt2rss.sh new file mode 100644 index 0000000..71459e9 --- /dev/null +++ b/pkgs/yt2rss/yt2rss.sh @@ -0,0 +1,21 @@ +if [ $# -eq 0 ]; then + echo "Usage: $0 " + exit 1 +fi + +url=$1 + +# Check if input URL is a playlist URL +if [[ "$url" == *"playlist"* ]]; then + playlist_id=$(echo "$url" | grep -o 'list=[A-Za-z0-9_-]*' | cut -d'=' -f2) + + if [ -n "$playlist_id" ]; then + echo "https://www.youtube.com/feeds/videos.xml?playlist_id=$playlist_id" + else + echo "Could not extract playlist ID from URL." + fi +else + curl -s "$url" | grep -o 'https://www.youtube.com/feeds/videos.xml?channel_id=[A-Za-z0-9_-]*' | sort | uniq +fi + +exit 0 diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..a33eea0 --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +{ + pkgs ? import { }, + ... +}: + +pkgs.mkShell { + NIX_CONFIG = "extra-experimental-features = nix-command flakes"; + nativeBuildInputs = with pkgs; [ home-manager ]; +} diff --git a/users/sid/default.nix b/users/sid/default.nix new file mode 100644 index 0000000..c9709e6 --- /dev/null +++ b/users/sid/default.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.synix.nixosModules.normalUsers + ]; + + normalUsers = { + sid = { + extraGroups = [ "wheel" ]; + sshKeyFiles = [ + ./pubkeys/gpg.pub + ]; + }; + }; +} diff --git a/users/sid/home/default.nix b/users/sid/home/default.nix new file mode 100644 index 0000000..02734cf --- /dev/null +++ b/users/sid/home/default.nix @@ -0,0 +1,18 @@ +{ + inputs, + outputs, + ... +}: + +{ + imports = [ + ./git.nix + ./home.nix + ./nixvim.nix + ./secrets + + inputs.synix.homeModules.common + + outputs.homeModules.common + ]; +} diff --git a/users/sid/home/git.nix b/users/sid/home/git.nix new file mode 100644 index 0000000..c8d8e3b --- /dev/null +++ b/users/sid/home/git.nix @@ -0,0 +1,9 @@ +{ + programs.git = { + enable = true; + settings.user = { + name = "sid"; + email = "sid@sid.ovh"; + }; + }; +} diff --git a/users/sid/home/home.nix b/users/sid/home/home.nix new file mode 100644 index 0000000..b4a48ee --- /dev/null +++ b/users/sid/home/home.nix @@ -0,0 +1,12 @@ +{ + home = { + username = "sid"; + + shellAliases = { + gpr = "git remote prune origin"; + search-store = "find /nix/store -maxdepth 1 -type d | rg -i"; + }; + + stateVersion = "24.11"; + }; +} diff --git a/users/sid/home/hosts/16ach6/default.nix b/users/sid/home/hosts/16ach6/default.nix new file mode 100644 index 0000000..be25e15 --- /dev/null +++ b/users/sid/home/hosts/16ach6/default.nix @@ -0,0 +1,48 @@ +{ pkgs, ... }: + +{ + imports = [ ../../hyprland ]; + + wayland.windowManager.hyprland.settings.monitor = [ + "eDP-1, 2560x1600@120, 0x0, 1.25" + "desc:LG Electronics 34GL750 0x000417A0, 2560x1080@60, auto, 1" + "desc:Eizo Nanao Corporation S2433W 24885089, 1920x1200, auto, 1" # , transform, 1" + ]; + + programs.waybar.settings.mainBar.output = "eDP-1"; + + programs.ssh.matchBlocks = { + arch = { + host = "a arch"; + hostname = "192.168.122.105"; + port = 22; + user = "sid"; + }; + pc = { + host = "pc"; + hostname = "192.168.178.140"; + port = 2299; + user = "sid"; + }; + }; + + programs.sftpman.mounts = { + arch = { + host = "192.168.122.105"; + user = "sid"; + port = 22; + mountPoint = "/home/sid"; + }; + }; + + home.shellAliases = { + vbox-up = "VBoxManage startvm ubuntu-sopc --type headless"; + vbox-down = "VBoxManage controlvm ubuntu-sopc poweroff"; + vbox-list = "VBoxManage list vms --long | grep -e '^Name:' -e '^State:'"; + + dock-on = "hyprctl keyword monitor eDP-1, disable"; + dock-off = "hyprctl keyword monitor eDP-1, enable"; + }; + + services.spotifyd.settings.device_name = "16ach6"; +} diff --git a/users/sid/home/hosts/nuc8/default.nix b/users/sid/home/hosts/nuc8/default.nix new file mode 100644 index 0000000..869b5ee --- /dev/null +++ b/users/sid/home/hosts/nuc8/default.nix @@ -0,0 +1,40 @@ +{ + imports = [ ../../hyprland ]; + + wayland.windowManager.hyprland.settings.monitor = [ + "desc:Eizo Nanao Corporation S2433W 24885089, 1920x1200, 0x0, 1" + "desc:Eizo Nanao Corporation S1921 C9188037, 1280x1024, 1920x0, 1, transform, 1" + ]; + + home.sessionVariables = { + AQ_NO_MODIFIERS = 1; + }; + + programs.waybar.settings.mainBar.output = "DP-2"; + + programs.ssh.matchBlocks = { + arch = { + host = "a arch"; + hostname = "192.168.122.210"; + port = 22; + user = "sid"; + }; + vde = { + host = "v vde"; + hostname = "192.168.188.22"; + port = 2299; + user = "sid"; + }; + }; + + programs.sftpman.mounts = { + vde = { + host = "192.168.188.22"; + user = "sid"; + port = 2299; + mountPoint = "/home/sid/.config/nixos"; + }; + }; + + services.spotifyd.settings.device_name = "nuc8"; +} diff --git a/users/sid/home/hosts/pc/default.nix b/users/sid/home/hosts/pc/default.nix new file mode 100644 index 0000000..31665ca --- /dev/null +++ b/users/sid/home/hosts/pc/default.nix @@ -0,0 +1,14 @@ +{ lib, ... }: + +{ + imports = [ ../../hyprland ]; + + wayland.windowManager.hyprland.settings.monitor = [ + "DP-3, 2560x1080@144, 1920x0, 1" + "HDMI-A-1, 1920x1080@144, 0x0, 1" + ]; + + programs.waybar.settings.mainBar.output = "DP-3"; + + home.stateVersion = lib.mkForce "25.11"; +} diff --git a/users/sid/home/hosts/rv2/default.nix b/users/sid/home/hosts/rv2/default.nix new file mode 100644 index 0000000..db10093 --- /dev/null +++ b/users/sid/home/hosts/rv2/default.nix @@ -0,0 +1,34 @@ +{ + imports = [ ../../hyprland ]; + + wayland.windowManager.hyprland.settings.monitor = [ + "DVI-D-1, 1920x1200, 0x0, 1" + "DVI-I-1, 1280x1024, 1920x0, 1, transform, 1" + ]; + + programs.waybar.settings.mainBar.output = "DVI-D-1"; + + programs.ssh.matchBlocks = { + arch = { + host = "a arch"; + hostname = "192.168.122.12"; + port = 22; + user = "sid"; + }; + vde = { + host = "v vde"; + hostname = "192.168.1.224"; + port = 2299; + user = "sid"; + }; + }; + + programs.sftpman.mounts = { + arch = { + host = "192.168.122.12"; + user = "sid"; + port = 22; + mountPoint = "/home/sid"; + }; + }; +} diff --git a/users/sid/home/hyprland/README.md b/users/sid/home/hyprland/README.md new file mode 100644 index 0000000..5697888 --- /dev/null +++ b/users/sid/home/hyprland/README.md @@ -0,0 +1,128 @@ +# Manual configuration + +The following things are not (yet) automated by Nix. Follow these steps after finishing the installation (including Home Manager). + +## Import secrets + +It is assumed that your secrets are stored on a LUKS encrypted USB drive partition (sda3 in this case). + +```bash +USB=/dev/sda +USER=$(whoami) +HOST=$(cat /etc/hostname) + +# Open crypt +sudo mkdir -p /mnt/crypt +sudo cryptsetup open "$USB"3 crypt +sudo mount /dev/mapper/crypt /mnt/crypt + +# Copy secrets +sudo rsync -vP /mnt/crypt/gpg-backup.sec.asc /tmp +sudo rsync -vP /mnt/crypt/$HOST/keys.txt /tmp +sudo chown $USER:$USER /tmp/gpg-backup.sec.asc +sudo chown $USER:$USER /tmp/keys.txt + +# Import secrets +mkdir -p ~/.config/sops/age && mv /tmp/keys.txt ~/.config/sops/age && chmod 0400 ~/.config/sops/age/keys.txt +gpg --decrypt /tmp/gpg-backup.sec.asc | gpg --import +gpg --edit-key D371C8E7D58F9D1E # replace with your key ID +gpg> trust +Your decision? 5 +Do you really want to set this key to ultimate trust? (y/N) y +gpg> q + +# Close crypt +sudo umount -lf /mnt/crypt +sudo cryptsetup close crypt +``` + +## Clone password store repository + +```bash +git clone ssh://git.portuus.de:2299/home/sid/git/password-store $PASSWORD_STORE_DIR +``` + +## Librewolf + +Librewolf is handled through its Home Manager module. Extensions do not need to be installed, just activated. + +- Extensions (allow every extension to run in private windows) + - PassFF + - Preferences + - Behavior of Enter key: Fill and submit + - Behavior of Shift-Enter key: Goto, fill and submit + - floccus + - Add profile + - Nextcloud Bookmarks + - Bookmarks folder: Bookmarks Toolbar + +TODO +- all custom search bookmarks lost their keywords +- set Searx as the default search engine + +## Element Desktop + +- Authentication via username, password and security key +- Settings + - Appearance + - Theme: Dark + - Preferences + - Allow spell check + - Add: German (Germany) + - Keyboard shortcuts + - Use Ctrl + F to search timeline: true + +## Thunderbird + +The account setup must be done manually, as the `accounts.email` HM module requires setting personal information that would end up being public on the Git web frontend. + +- Spelling + - Add Dictionaries... + - German: Download Dictionary + +## Spotify + +- Authentication via username and password + +## Jellyfin Media Player + +- Add server +- Authentication via username and password + +## OBS-Studio + +- Scenes + - Scene + - Sources + - Add: Screen Capture (PipeWire) > OK > Screen 0 (or a window or a region) > OK +- Audio Mixer + - Mic/Aux: Mute +- File + - Settings + - Output + - Recording + - Recording Path: /home/sid/vid/recordings + - Generate File Name without Space + - Video + - Base Resolution: 2560x1600 + - Output Resolution: 2560x1600 + - Common FPS Values: 60 + +> TODO: adjust video and audio codecs/quality + +> TODO: keyboard shortcuts (currently using waybar tray icon) + +## Eduroam + +Download the eduroam configuration script [here](https://cat.eduroam.org/?idp=5134&profile=8268). + +Execute it: + +```bash +nix-shell -p python3 python3Packages.dbus-python --run 'python eduroam-linux-THK-members_of_TH_Koln.py' +``` + +## Zoom + +- Authentication via username and password +- Check "Keep me signed in" diff --git a/users/sid/home/hyprland/anyrun.nix b/users/sid/home/hyprland/anyrun.nix new file mode 100644 index 0000000..0d55779 --- /dev/null +++ b/users/sid/home/hyprland/anyrun.nix @@ -0,0 +1,103 @@ +{ + inputs, + config, + pkgs, + ... +}: + +let + mkDir = dir: { + path = config.home.homeDirectory + "/" + dir; + recurse = true; + }; + + mkDirs = dirs: map mkDir dirs; + + dirs = [ + "aud" + "dls" + "doc" + "img" + "src" + "vid" + ]; + + inherit (pkgs.stdenv.hostPlatform) system; +in +{ + imports = [ + inputs.kidex.homeModules.kidex + ]; + + programs.anyrun = { + enable = true; + package = inputs.anyrun.packages."${system}".anyrun-with-all-plugins; + config = { + x = { + fraction = 0.5; + }; + y = { + fraction = 0.3; + }; + width = { + fraction = 0.3; + }; + hideIcons = true; + layer = "overlay"; + hidePluginInfo = true; + showResultsImmediately = true; + plugins = with inputs.anyrun.packages."${system}"; [ + applications + dictionary + kidex + randr + rink + translate + websearch + ]; + }; + extraCss = '' + #window { + background-color: rgba(0, 0, 0, 0); + } + ''; + extraConfigFiles = { + "dictionary.ron".text = '' + Config( + prefix: ":def", + max_entries: 5, + ) + ''; + "translate.ron".text = '' + Config( + prefix: ":t", + language_delimiter: ">", + max_entries: 3, + ) + ''; + "randr.ron".text = '' + Config( + prefix: ":dp", + max_entries: 5, + ) + ''; + # TODO: websearch.ron: set custom search engine + }; + }; + + services.kidex = { + enable = true; + settings = { + ignored = [ + "*/.git/*" + "*/.cache/*" + "*/.direnv/*" + ]; + directories = mkDirs dirs; + }; + }; + + wayland.windowManager.hyprland.settings.bind = [ + "$mod, space, exec, anyrun" + ]; +} diff --git a/users/sid/home/hyprland/default.nix b/users/sid/home/hyprland/default.nix new file mode 100644 index 0000000..2258c0b --- /dev/null +++ b/users/sid/home/hyprland/default.nix @@ -0,0 +1,34 @@ +{ + inputs, + lib, + pkgs, + ... +}: + +{ + imports = [ + # ./anyrun.nix + ./flatpak.nix + ./fzf-open.nix + ./gpg.nix + ./hyprland.nix + ./librewolf.nix + ./newsboat.nix + # ./nextcloud-sync.nix + ./obs-studio.nix + ./opencode.nix + ./packages.nix + ./rclone.nix + # ./recoll.nix + ./shell-aliases.nix + ./spotify-player.nix + ./ssh-hosts.nix + ./stylix.nix + ./vscode.nix + ./waybar.nix + ./xdg.nix + ./yazi.nix + + inputs.synix.homeModules.virtualisation + ]; +} diff --git a/users/sid/home/hyprland/flatpak.nix b/users/sid/home/hyprland/flatpak.nix new file mode 100644 index 0000000..f2441c6 --- /dev/null +++ b/users/sid/home/hyprland/flatpak.nix @@ -0,0 +1,38 @@ +{ inputs, pkgs, ... }: + +{ + imports = [ + inputs.nix-flatpak.homeManagerModules.nix-flatpak + ]; + + services.flatpak = { + enable = true; + update = { + onActivation = false; + auto = { + enable = true; + onCalendar = "weekly"; + }; + }; + packages = [ + { + appId = "org.mypaint.MyPaint"; + origin = "flathub"; + } + # FIXME: does not start. installed `chat.commet.commetapp.flatpak` manually + { + appId = "im.riot.Riot"; + origin = "flathub"; + } + { + appId = "us.zoom.Zoom"; + origin = "flathub"; + } + ]; + }; + + home.packages = with pkgs; [ + flatpak + flatpak-builder + ]; +} diff --git a/users/sid/home/hyprland/fzf-open.nix b/users/sid/home/hyprland/fzf-open.nix new file mode 100644 index 0000000..97d6f82 --- /dev/null +++ b/users/sid/home/hyprland/fzf-open.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: + +let + fzf-dirs = "~/doc ~/img ~/aud ~/dls ~/src ~/.config ~/.local"; + + fzf-open = pkgs.writeShellScriptBin "fzf-open" '' + fzf --preview="pistol {}" --bind "enter:execute(hyprctl dispatch togglespecialworkspace fzf-open && xdg-open {} > /dev/null 2>&1 &)" + ''; +in +{ + wayland.windowManager.hyprland = { + settings = { + bind = [ + "$mod, Space, togglespecialworkspace, fzf-open" + ]; + windowrulev2 = [ + "float, class:floating" + "size 50% 50%, title:fzf-open" + ]; + }; + extraConfig = '' + workspace = special:fzf-open, on-created-empty:kitty --class=floating -e ${fzf-open}/bin/fzf-open + ''; + }; + + home = { + sessionVariables = { + # FZF_DEFAULT_COMMAND = "rg --files --hidden --glob '!.git/**' ${fzf-dirs}"; + FZF_DEFAULT_COMMAND = "rg --files ${fzf-dirs}"; + }; + packages = [ + fzf-open + ]; + }; +} diff --git a/users/sid/home/hyprland/gpg.nix b/users/sid/home/hyprland/gpg.nix new file mode 100644 index 0000000..1e1f562 --- /dev/null +++ b/users/sid/home/hyprland/gpg.nix @@ -0,0 +1,12 @@ +{ inputs, ... }: + +let + key.a.grip = "F8BCC76BE2E55D52C3E92B963ADD3FDD8C153911"; + key.e.id = "97BEF39E76001BC0"; +in +{ + imports = [ inputs.synix.homeModules.gpg ]; + + services.gpg-agent.sshKeys = [ key.a.grip ]; + programs.passwordManager.key = key.e.id; +} diff --git a/users/sid/home/hyprland/hyprland.nix b/users/sid/home/hyprland/hyprland.nix new file mode 100644 index 0000000..52e23a2 --- /dev/null +++ b/users/sid/home/hyprland/hyprland.nix @@ -0,0 +1,49 @@ +{ + inputs, + config, + pkgs, + ... +}: + +{ + imports = [ inputs.synix.homeModules.hyprland ]; + + wayland.windowManager.hyprland = { + enable = true; + autostart = true; + settings = { + bind = + let + flatpakRun = "${pkgs.flatpak}/bin/flatpak --user run"; + wineRun = "wine ${config.home.homeDirectory}/.wine/drive_c"; + in + [ + "$mod, g, exec, gimp" + "$mod, s, exec, kitty -T spotify -e spotify_player" + "$mod, t, exec, teams-for-linux" + "$mod, v, exec, virt-manager" + "$mod, z, exec, ${flatpakRun} us.zoom.Zoom" + "$mod CTRL, i, exec, ${wineRun}/Program\\ Files/AccessData/FTK\\ Imager/FTK\\ Imager.exe" + "$mod CTRL, m, exec, ${flatpakRun} org.mypaint.MyPaint" + "$mod CTRL, o, exec, obs" + "$mod CTRL, p, exec, otp" + "$mod SHIFT, a, exec, chromium --app=https://ai.portuus.de" + ]; + windowrule = [ + "workspace 4, title:^newsboat$" + "workspace 6, class:^thunderbird$, title:Thunderbird$" + "workspace 7, title:^Jellyfin Media Player$" + "workspace 7, title:^spotify$" + "workspace 8, class:^Element$, title:^Element" + "workspace 9, class:^chrome-ai.portuus.de" + "workspace 10, class:^zoom$, title:^Zoom" + "workspace 10, class:^org.qbittorrent.qBittorrent$" + "workspace 10, title:^Virtual Machine Manager$" + ]; + exec-once = [ + "[workspace 5 silent] librewolf" + "[workspace 6 silent] thunderbird" + ]; + }; + }; +} diff --git a/users/sid/home/hyprland/librewolf.nix b/users/sid/home/hyprland/librewolf.nix new file mode 100644 index 0000000..e5363f2 --- /dev/null +++ b/users/sid/home/hyprland/librewolf.nix @@ -0,0 +1,13 @@ +{ inputs, pkgs, ... }: + +let + inherit (pkgs.stdenv.hostPlatform) system; +in +{ + programs.librewolf = { + profiles.default.extensions.packages = + with inputs.nur.legacyPackages."${system}".repos.rycee.firefox-addons; [ + zotero-connector + ]; + }; +} diff --git a/users/sid/home/hyprland/newsboat.nix b/users/sid/home/hyprland/newsboat.nix new file mode 100644 index 0000000..6f60c33 --- /dev/null +++ b/users/sid/home/hyprland/newsboat.nix @@ -0,0 +1,12 @@ +{ config, ... }: + +{ + programs.newsboat = { + extraConfig = '' + urls-source "miniflux" + miniflux-url "https://miniflux.portuus.de/" + miniflux-login "sid" + miniflux-passwordfile "${config.sops.secrets.miniflux.path}" + ''; + }; +} diff --git a/users/sid/home/hyprland/nextcloud-sync.nix b/users/sid/home/hyprland/nextcloud-sync.nix new file mode 100644 index 0000000..fbe684d --- /dev/null +++ b/users/sid/home/hyprland/nextcloud-sync.nix @@ -0,0 +1,29 @@ +{ inputs, config, ... }: + +let + mkConnection = dir: { + local = config.home.homeDirectory + "/" + dir; + remote = "/" + dir; + }; + + mkConnections = dirs: map mkConnection dirs; + + connections = [ + "aud" + "doc" + "img" + "vid" + ]; +in +{ + imports = [ + inputs.synix.homeModules.nextcloud-sync + ]; + + services.nextcloud-sync = { + enable = true; + remote = "cloud.portuus.de"; + passwordFile = config.sops.secrets.nextcloud.path; + connections = mkConnections connections; + }; +} diff --git a/users/sid/home/hyprland/obs-studio.nix b/users/sid/home/hyprland/obs-studio.nix new file mode 100644 index 0000000..f0eed71 --- /dev/null +++ b/users/sid/home/hyprland/obs-studio.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: + +{ + programs.obs-studio = { + enable = true; + package = pkgs.obs-studio; + plugins = [ pkgs.obs-studio-plugins.wlrobs ]; + }; +} diff --git a/users/sid/home/hyprland/opencode.nix b/users/sid/home/hyprland/opencode.nix new file mode 100644 index 0000000..de02166 --- /dev/null +++ b/users/sid/home/hyprland/opencode.nix @@ -0,0 +1,10 @@ +{ + programs.opencode = { + enable = true; + settings = { + model = "openrouter/qwen/qwen3-coder"; + autoshare = false; + autoupdate = false; + }; + }; +} diff --git a/users/sid/home/hyprland/packages.nix b/users/sid/home/hyprland/packages.nix new file mode 100644 index 0000000..83430bd --- /dev/null +++ b/users/sid/home/hyprland/packages.nix @@ -0,0 +1,84 @@ +{ inputs, pkgs, ... }: + +let + inherit (pkgs.stdenv.hostPlatform) system; +in +{ + home.packages = + with pkgs; + [ + prismlauncher + audacity + drawio + gimp + inkscape + kicad + mermaid-cli + octaveFull + pdfarranger + remmina + spotify + syncthingtray + teams-for-linux + texliveFull + xournalpp + zotero + + # inputs.gen-dmc.packages."${system}".gen-dmc + + # angryipscanner # FIXME + # autopsy # gradle-7.6.6 is marked as insecure + # jellyfin-media-player # qtwebengine-5.15.19 is marked as insecure + ] + # tools + ++ [ + aichat + compose2nix + duden + ftx-prog + gf + glab + gtkterm + localsend + magic-wormhole + naabu + ocrmypdf + rpi-imager + rustfmt + showmethekey + songrec + speedtest-cli + subfinder + synadm + yt-dlp + + inputs.multios-usb.packages."${system}".default + + (instaloader.overridePythonAttrs (oldAttrs: { + propagatedBuildInputs = (oldAttrs.propagatedBuildInputs or [ ]) ++ [ + python3Packages.browser-cookie3 + ]; + })) + + local.gitingest # TODO: PR Nixpkgs + local.otp + local.pdf2printable + local.transcribe + local.yt2rss + + synix.bulk-rename + # synix.marker-pdf # FIXME + ] + # reverse engineering + # ++ [ + # checksec + # ghidra-bin + # ida-free + # ] + # android + ++ [ + adbfs-rootless + android-tools + scrcpy + ]; +} diff --git a/users/sid/home/hyprland/rclone.nix b/users/sid/home/hyprland/rclone.nix new file mode 100644 index 0000000..039b237 --- /dev/null +++ b/users/sid/home/hyprland/rclone.nix @@ -0,0 +1,23 @@ +{ config, ... }: + +let + sops = config.sops; +in +{ + sops.templates.rclone.path = config.xdg.configHome + "/rclone/rclone.conf"; + sops.templates.rclone.content = '' + [portuus] + type = webdav + url = https://cloud.portuus.de/remote.php/dav/files/sid/ + vendor = nextcloud + user = sid + pass = ${sops.placeholder."rclone/portuus/pass"} + + [sciebo] + type = webdav + url = ${sops.placeholder."rclone/sciebo/url"} + vendor = owncloud + user = ${sops.placeholder."rclone/sciebo/user"} + pass = ${sops.placeholder."rclone/sciebo/pass"} + ''; +} diff --git a/users/sid/home/hyprland/recoll.nix b/users/sid/home/hyprland/recoll.nix new file mode 100644 index 0000000..f9ce256 --- /dev/null +++ b/users/sid/home/hyprland/recoll.nix @@ -0,0 +1,31 @@ +{ config, ... }: + +{ + services.recoll = { + enable = true; + configDir = "${config.xdg.configHome}/recoll"; + settings = { + nocjk = true; + loglevel = 5; + topdirs = [ + "~/aud" + "~/dls" + "~/doc" + "~/img" + "~/src" + ]; + + "~/dls" = { + "skippedNames+" = [ "*.iso" ]; + }; + + "~/src" = { + "skippedNames+" = [ + "node_modules" + "target" + "result" + ]; + }; + }; + }; +} diff --git a/users/sid/home/hyprland/shell-aliases.nix b/users/sid/home/hyprland/shell-aliases.nix new file mode 100644 index 0000000..5fe73f6 --- /dev/null +++ b/users/sid/home/hyprland/shell-aliases.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: + +{ + home.shellAliases = { + bt = "bluetoothctl"; + ff = "find . -type f -name"; + dd-iso = "dd bs=4M status=progress oflag=sync"; + nc-sync = "nextcloud-sync-all"; + synapse_change_display_name = "${pkgs.synix.synapse_change_display_name}/bin/synapse_change_display_name -t $(${pkgs.pass}/bin/pass sid.ovh/matrix/access-token) -r sid.ovh"; + }; +} diff --git a/users/sid/home/hyprland/spotify-player.nix b/users/sid/home/hyprland/spotify-player.nix new file mode 100644 index 0000000..dfc3ba5 --- /dev/null +++ b/users/sid/home/hyprland/spotify-player.nix @@ -0,0 +1,47 @@ +{ config, ... }: + +{ + programs.spotify-player = { + enable = true; + # package = pkgs.spotify-player.override { + # withImage = false; + # withSixel = false; + # }; + settings = { + actions = [ + { + command = "GoToArtist"; + key_sequence = "g A"; + } + { + command = "GoToAlbum"; + key_sequence = "g B"; + target = "PlayingTrack"; + } + ]; + pause_icon = " "; + play_icon = " "; + device = { + audio_cache = true; + autoplay = true; + normalization = true; + volume = 100; + }; + layout = { + playback_window_position = "Bottom"; + library = { + playlist_percent = 80; + album_percent = 0; + }; + }; + }; + }; + + services.spotifyd = { + enable = true; + settings = { + username = "zephyrius17"; + password_cmd = "cat ${config.sops.secrets.spotify.path}"; + }; + }; +} diff --git a/users/sid/home/hyprland/ssh-hosts.nix b/users/sid/home/hyprland/ssh-hosts.nix new file mode 100644 index 0000000..f5bdfda --- /dev/null +++ b/users/sid/home/hyprland/ssh-hosts.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: + +{ + programs.ssh.matchBlocks = { + edge = { + host = "e edge"; + hostname = "49.12.227.10"; + port = 2299; + user = "sid"; + }; + uvm = { + host = "u uvm"; + hostname = "localhost"; + port = 2222; + user = "root"; + checkHostIP = false; + }; + portuus = { + host = "p portuus *.portuus.de"; + hostname = "portuus.de"; + port = 2299; + user = "sid"; + }; + sid = { + host = "s sid *.sid.ovh"; + hostname = "sid.ovh"; + port = 2299; + user = "sid"; + }; + X99S = { + host = "X X99S"; + hostname = "steffen.fail"; + port = 2299; + user = "sid"; + }; + }; + + # setup: sudo mkdir -p /mnt/sshfs && sudo chown sid:sid /mnt/sshfs + programs.sftpman = { + enable = true; + # gpg --export-ssh-key > ~/.ssh/id_rsa.pub + defaultSshKey = "/home/sid/.ssh/id_rsa.pub"; + mounts = { + portuus = { + host = "portuus.de"; + user = "sid"; + port = 2299; + mountPoint = "/home/sid/.config/nixos"; + }; + }; + }; + home.shellAliases.sm = "sftpman"; + home.packages = [ pkgs.sshfs ]; +} diff --git a/users/sid/home/hyprland/stylix.nix b/users/sid/home/hyprland/stylix.nix new file mode 100644 index 0000000..c73aafa --- /dev/null +++ b/users/sid/home/hyprland/stylix.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.synix.homeModules.stylix + ]; + + stylix = { + enable = true; + scheme = "moonfly"; + targets = { + waybar'.enable = true; + bemenu'.enable = true; + }; + }; +} diff --git a/users/sid/home/hyprland/vscode.nix b/users/sid/home/hyprland/vscode.nix new file mode 100644 index 0000000..8b64276 --- /dev/null +++ b/users/sid/home/hyprland/vscode.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: + +{ + programs = { + vscode = { + enable = true; + package = pkgs.vscodium; + profiles.default.extensions = with pkgs.vscode-extensions; [ + mkhl.direnv + ms-vscode.cmake-tools + ms-vscode.cpptools + ]; + }; + direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; +} diff --git a/users/sid/home/hyprland/waybar.nix b/users/sid/home/hyprland/waybar.nix new file mode 100644 index 0000000..6e22e1a --- /dev/null +++ b/users/sid/home/hyprland/waybar.nix @@ -0,0 +1,19 @@ +{ + programs.waybar.settings = { + mainBar = { + modules-right = [ + "custom/timer" + "custom/newsboat" + "network" + "bluetooth" + "cpu" + "memory" + "disk" + "pulseaudio#input" + "pulseaudio#output" + "battery" + "tray" + ]; + }; + }; +} diff --git a/users/sid/home/hyprland/xdg.nix b/users/sid/home/hyprland/xdg.nix new file mode 100644 index 0000000..032d8bb --- /dev/null +++ b/users/sid/home/hyprland/xdg.nix @@ -0,0 +1,18 @@ +{ config, ... }: + +{ + xdg.userDirs = + let + homeDir = config.home.homeDirectory; + in + { + desktop = "${homeDir}"; + documents = "${homeDir}/doc"; + download = "${homeDir}/dls"; + music = "${homeDir}/aud/music"; + pictures = "${homeDir}/img"; + publicShare = "${homeDir}"; + templates = "${homeDir}"; + videos = "${homeDir}/vid"; + }; +} diff --git a/users/sid/home/hyprland/yazi.nix b/users/sid/home/hyprland/yazi.nix new file mode 100644 index 0000000..dbbd726 --- /dev/null +++ b/users/sid/home/hyprland/yazi.nix @@ -0,0 +1,33 @@ +{ pkgs, lib, ... }: + +{ + programs.yazi = + let + hide-yazi-workspace = pkgs.writeShellScript "hide-yazi-workspace.sh" '' + (hyprctl monitors -j | ${lib.getExe pkgs.jq} -e 'any(.specialWorkspace.name == "special:yazi")' > /dev/null) && hyprctl dispatch togglespecialworkspace yazi + ''; + in + { + keymap = { + mgr.prepend_keymap = [ + { + on = "o"; + run = [ + "shell --orphan ${hide-yazi-workspace}" + "open" + ]; + desc = ""; + } + ]; + }; + }; + + wayland.windowManager.hyprland = { + extraConfig = '' + workspace = special:yazi, on-created-empty:kitty -T yazi -e yazi + bind = $mod, x, togglespecialworkspace, yazi + windowrule = float, title:^yazi$ + windowrule = size 50% 50%, title:^yazi$ + ''; + }; +} diff --git a/users/sid/home/nixvim.nix b/users/sid/home/nixvim.nix new file mode 100644 index 0000000..34dcd51 --- /dev/null +++ b/users/sid/home/nixvim.nix @@ -0,0 +1,113 @@ +{ inputs, config, ... }: + +{ + imports = [ + inputs.synix.homeModules.nixvim + ]; + + programs.nixvim = { + enable = true; + plugins = { + avante = { + enable = true; + settings = { + auto_suggestions_provider = null; + diff = { + autojump = true; + debug = false; + list_opener = "copen"; + }; + highlights = { + diff = { + current = "DiffText"; + incoming = "DiffAdd"; + }; + }; + hints = { + enabled = true; + }; + selector = { + provider = "telescope"; + }; + provider = "openrouter"; + providers = { + openrouter = { + __inherited_from = "openai"; + endpoint = "https://openrouter.ai/api/v1"; + api_key_name = "cmd:cat ${config.sops.secrets.openrouter-api-key.path}"; + model = "google/gemini-3-flash-preview"; + }; + }; + }; + }; + render-markdown = { + enable = true; + settings = { + file_types = [ + "Avante" + ]; + }; + }; + }; + extraConfigLua = '' + _G.cppman_picker = function(opts) + local pickers = require "telescope.pickers" + local finders = require "telescope.finders" + local conf = require("telescope.config").values + local actions = require "telescope.actions" + local action_state = require "telescope.actions.state" + local previewers = require "telescope.previewers" + + opts = opts or {} + pickers.new(opts, { + prompt_title = "Cppman Search", + finder = finders.new_oneshot_job({ "cppman", "-l" }, opts), + sorter = conf.generic_sorter(opts), + + previewer = previewers.new_buffer_previewer({ + title = "Manual Page", + define_preview = function(self, entry, status) + return require("telescope.previewers.utils").job_maker( + { "cppman", entry.value }, + self.state.bufnr, + { + callback = function(bufnr, content) + if content then + vim.api.nvim_buf_set_option(bufnr, "filetype", "man") + end + end, + } + ) + end, + }), + + attach_mappings = function(prompt_bufnr, map) + actions.select_default:replace(function() + local selection = action_state.get_selected_entry() + + if not selection then + return + end + + actions.close(prompt_bufnr) + vim.cmd("terminal cppman " .. selection.value) + vim.cmd("startinsert") + end) + return true + end, + }):find() + end + ''; + keymaps = [ + { + mode = "n"; + key = "fc"; + action = "lua cppman_picker()"; + options = { + desc = "Search C/C++ Docs (cppman)"; + silent = true; + }; + } + ]; + }; +} diff --git a/users/sid/home/secrets/default.nix b/users/sid/home/secrets/default.nix new file mode 100644 index 0000000..4e5b1d5 --- /dev/null +++ b/users/sid/home/secrets/default.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.synix.homeModules.sops + ]; + + sops.secrets = { + "rclone/portuus/pass" = { }; + "rclone/sciebo/pass" = { }; + "rclone/sciebo/url" = { }; + "rclone/sciebo/user" = { }; + gemini-api-key = { }; + miniflux = { }; + nextcloud = { }; + openrouter-api-key = { }; + spotify = { }; + }; +} diff --git a/users/sid/home/secrets/secrets.yaml b/users/sid/home/secrets/secrets.yaml new file mode 100644 index 0000000..4b3823d --- /dev/null +++ b/users/sid/home/secrets/secrets.yaml @@ -0,0 +1,27 @@ +miniflux: ENC[AES256_GCM,data:8AraKHhALBBJ5vzXc3t3UKX1DqA=,iv:VWv7MaTfDXZIr/dVWOMyRm6rFqLVhvTU0CYv5a2/PAM=,tag:nStt3Rn08KWadYVECRyObA==,type:str] +nextcloud: ENC[AES256_GCM,data:ge1GukFPmVe0vO1oL98loLpHkpE=,iv:7OTKSpxeKVmDFIvC8yd+c3TglZMIb6iLmXtUQgONWDE=,tag:1PYvJAYfSnZquyXz4eseDw==,type:str] +rclone: + portuus: + pass: ENC[AES256_GCM,data:QcI6y3AKEh0+PWT4a7NXxbt0te78BJeZT3JxRxGpfkjxhqFWGNHHs6I0pxBFuyAkFa8=,iv:qcMmuAI1odd32YWO8OB+CB2cMHHK2raFBWJ/dSbBSuA=,tag:uxD2CVq9i5quK7QuQuwQTQ==,type:str] + sciebo: + url: ENC[AES256_GCM,data:T8eSTFOYRu+dOF3wnOBSorIgeOs1VkZ8xqH5mh2/g2VeKnvjeLmUg6/4X+ZthsBpetPeiELkeg+XzzT+F5qxEaaV5OdTT8c=,iv:qmpvVJLJwE6CmIEdne9vgoP5H1GTiZYOXb5yR2DaS5k=,tag:QdTmUW+O2Z2Dpqcb/Ug2/A==,type:str] + user: ENC[AES256_GCM,data:FrZZtV05qq15bwZko/2qFhWLfn4=,iv:sddWcvc1K8J008bkqSrf22fCR9w+fD5uOykNVb0aBS8=,tag:XkwZtGtDskUBpbj0vJyHGg==,type:str] + pass: ENC[AES256_GCM,data:osKqEPF3MXzGSA3bziw6hx+5fQNXkXfrWKAUiK7yV+r48nTsJ+YYzUlIjYluioM0,iv:TANLg8RW2NUwj0RKUZW09U//l//ijOjRB3uRLITlu/E=,tag:yJxkCWL0Y0a8MPH57duOMw==,type:str] +spotify: ENC[AES256_GCM,data:PQ5eUxL/oi+SE6gbe5+XQYExHw0=,iv:vz5TCa6jS+LMZsxFOQZhC4EwetcHmu/zxK6JTVXucwA=,tag:+cyc2hdUsvfDwLbxzoeogg==,type:str] +gemini-api-key: ENC[AES256_GCM,data:UvLB1vq56Wv4MpL/KPJ4M4p5Lx1Se/dv/vT/Vim2HSxHiyXWoVow,iv:xepkGlDG4doKeskQTyzxVx7SE7veUQVrzZahLdDxVQg=,tag:ue6lphZcPovfrgyibhRkDA==,type:str] +openrouter-api-key: ENC[AES256_GCM,data:VGSlgUfEBwUKjEwdGqYTLvGlMJ3VSwApJexYZ4YVpKTE6oFQeZpsjMc6dymkSsLITVw2n92rfkhJi7e+MEvBCkNVNbb+KP5PnA==,iv:GvYq5+QhuONaPzHleGMuqzWQhhCcb9oxU9Pr/mWwKh4=,tag:iAlf173z7pW97LvkUPQgBA==,type:str] +sops: + age: + - recipient: age19yeqvv28fgrtk6jsh3xyaf0lch86kna6rcz4dwe962yyyyevu30sx474xy + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSbXBZV3VlYy91MWs5eFpa + d1ZoTVlhbjNnaFZtTGtxQmpTTU1YcEJ1bTJjCndwMmNtZlBYWjJtQUl5QzVzNFhE + bGprbjV0T3Njd3NjdTZxeHlxYTNOREkKLS0tIFllbUluejZJOUlWTWhUWVV2NU4r + d0lFU3lCVHVxN2xveUE4V2VtanFBY2cKD4qYxFo7G6B0fsLcNeNZaK4k3DGwVocA + XYHwoqEZ58xspiuVkp3F+fFpgoysuVusB9ZimjLkt2D6phk+0SGKfA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2026-02-18T17:07:22Z" + mac: ENC[AES256_GCM,data:U3c9xDqKHIGFM9YCwR/1W2U2blWyXfFOljzyht+2aOA15v8Ys23vG5UJNO91frIRqZYnoSLTrJADlrW0S7zD4ft+7GHKK1XuriUXm5hzOl62HdB3pSX5nvWVdkPBdKE5e/se3HyQuiu0ZM9EHd0hepxLBh3YfQxGjhsaHZX2Q1g=,iv:r+1sC+MuONmFwEN935KJ0CFn9jsSGoI7rH+d6uDGYF8=,tag:2SNEFn1TNVQ2K/Jr9uIypQ==,type:str] + unencrypted_suffix: _unencrypted + version: 3.11.0 diff --git a/users/sid/pubkeys/gpg.pub b/users/sid/pubkeys/gpg.pub new file mode 100644 index 0000000..22901a8 --- /dev/null +++ b/users/sid/pubkeys/gpg.pub @@ -0,0 +1 @@ +ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDYeVnKDUk3SYN70qB6nVEqSCsCiUtObR2OHLexzinmdFU4xxSL76+9SCMFk7EHZpE5JouBBqVjCxEuZpCZUzCaKLFSL6KBQ+nFxqWTLJ2na7lbECXLrk6IlfGqnfPJzy0hcqszqy/MuZXAC2YgiNZfGxAJNY1UqOuaMAub18yHNo/mYfIS6ZDlRXdPEgsEzndTvE6znNQ2WsZk+jH4yRwKqkmEYqIiGRU8K4czCZchMH9vY/dGhi4kM/QJLmjj3pEZCt/d+tI88MkPzE0FagaNELcylmInLTbctv4eCwMn4waKLml53sRqhxkfVO1ZUfBPZq7pBNy90sqe7El3lKYM7n65T0Iry9pSJhvzMm7XkybpWZM834Y78okZEs1opsIZsCWVMXGInAmVs5bPPjrUNDKLqlfIb5fgUqclJiE4Hni5qF4iOSdQ2Xvex04GRwin4owmOKcpHAvAOHufLYjKxy+U4gd4VNzdYuRbr5Qs2kzPNl1JLWu8IKTUKzqpI5xZuDFOby8ZxhFqLZ1FWcIkFUiRVhVbz8GCtTLaMQeNV2ukkfIE4rK2u2UB+DBKEnQbBiRFbyCGhraEen2PvPi/wyE/71+AaOLM/JyYUt/S2+bz5lgugLFwNi9VJM4HgShcwwvzs7i//Hm2lj6Aj+dCPat8IquJ7QSVDUuu746Idw== (none)