From 41ec9a4c435cc0a6f26878b1e6c09fecbd6bf292 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 4 Mar 2025 00:00:08 -0800 Subject: [PATCH 1/9] updating website --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 36370d9f..3a8d43c9 100644 --- a/flake.lock +++ b/flake.lock @@ -390,11 +390,11 @@ ] }, "locked": { - "lastModified": 1739858464, - "narHash": "sha256-WfADdP9Jc+YerTaqcuOG18ALWBHwUSPb99vFqpLJxGU=", + "lastModified": 1741068065, + "narHash": "sha256-ENeyd7JAyBbrOMAKv2b+EruOYaESHcmxL/VSDH9KrMw=", "ref": "main", - "rev": "8d189090ac768f70a9c7d4c93f72c2129a79f59f", - "revCount": 1566, + "rev": "1892ab927494834ed9e1a7221e9f2a074c68f434", + "revCount": 1567, "type": "git", "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" }, From 403f91bd1204bf2838cf5dc42fa62574bd61121e Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 8 Mar 2025 00:00:12 -0800 Subject: [PATCH 2/9] updating website --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 3a8d43c9..4f594a41 100644 --- a/flake.lock +++ b/flake.lock @@ -390,11 +390,11 @@ ] }, "locked": { - "lastModified": 1741068065, - "narHash": "sha256-ENeyd7JAyBbrOMAKv2b+EruOYaESHcmxL/VSDH9KrMw=", + "lastModified": 1741255265, + "narHash": "sha256-plq6gdcs3pAQC6Wjg3ristnD/WQc1dCqW3Hr8KT+4RU=", "ref": "main", - "rev": "1892ab927494834ed9e1a7221e9f2a074c68f434", - "revCount": 1567, + "rev": "7325a34c690e41e0dd1cc7ce97ed12335aa318f7", + "revCount": 1568, "type": "git", "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" }, From 8fc361d8199ea8b2d01d8a2312d72391c20b8020 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 26 Aug 2025 00:00:10 -0700 Subject: [PATCH 3/9] updating website --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index 4f594a41..f29f6e44 100644 --- a/flake.lock +++ b/flake.lock @@ -390,11 +390,11 @@ ] }, "locked": { - "lastModified": 1741255265, - "narHash": "sha256-plq6gdcs3pAQC6Wjg3ristnD/WQc1dCqW3Hr8KT+4RU=", + "lastModified": 1756180823, + "narHash": "sha256-pKgTO9CPcvKvJ0YconJuAgWmtDAeUhBy7IIQzKlDXvw=", "ref": "main", - "rev": "7325a34c690e41e0dd1cc7ce97ed12335aa318f7", - "revCount": 1568, + "rev": "236e9a36d728f2c115b052d48f489f7b79a5c620", + "revCount": 1592, "type": "git", "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" }, From f01e535157d2d62794fd2c6fb3d2c264e03e8049 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 30 Aug 2025 00:00:09 -0700 Subject: [PATCH 4/9] updating website --- flake.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.lock b/flake.lock index f29f6e44..bc143d94 100644 --- a/flake.lock +++ b/flake.lock @@ -390,11 +390,11 @@ ] }, "locked": { - "lastModified": 1756180823, - "narHash": "sha256-pKgTO9CPcvKvJ0YconJuAgWmtDAeUhBy7IIQzKlDXvw=", + "lastModified": 1756350023, + "narHash": "sha256-4S6EUvEFvOnwjSo/LqAVVuX2/JjAJ8gQFmQQ0DS4oXU=", "ref": "main", - "rev": "236e9a36d728f2c115b052d48f489f7b79a5c620", - "revCount": 1592, + "rev": "a807111f9b20c501183516baf8082c4359aaaaa1", + "revCount": 1594, "type": "git", "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" }, From d67ade06c802b4bd29890e0805ba1e319886a705 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 12 Sep 2025 16:48:03 -0700 Subject: [PATCH 5/9] fix: music downloads --- hosts/profiles/sync/music/default.nix | 2 +- hosts/profiles/sync/music/get-music.sh | 55 +++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 7 deletions(-) mode change 100644 => 100755 hosts/profiles/sync/music/get-music.sh diff --git a/hosts/profiles/sync/music/default.nix b/hosts/profiles/sync/music/default.nix index 4c070e43..461e9d6c 100644 --- a/hosts/profiles/sync/music/default.nix +++ b/hosts/profiles/sync/music/default.nix @@ -15,6 +15,6 @@ systemd.timers.get-music-timer = { wantedBy = [ "timers.target" ]; partOf = [ "get-music-sync.service" ]; - timerConfig.OnCalendar = [ "daily" ]; + timerConfig.OnCalendar = [ "hourly" ]; }; } diff --git a/hosts/profiles/sync/music/get-music.sh b/hosts/profiles/sync/music/get-music.sh old mode 100644 new mode 100755 index 2269bb89..242cbe55 --- a/hosts/profiles/sync/music/get-music.sh +++ b/hosts/profiles/sync/music/get-music.sh @@ -1,9 +1,52 @@ #!/usr/bin/env bash -rsync -r --ignore-existing --log-file=/data/incoming/download-log hypercube@talos.feralhosting.com:private/transmission/data/* /data/incoming -# you need to set defaults for beets -# if already imported -> Skip -# Auto accept changes -# also install it lmao -#beet import /data/incoming +set -euo pipefail + +REMOTE_HOST="anish@talos.feralhosting.com" +REMOTE_PATH="private/transmission/data/" +LOCAL_PATH="/data/incoming" +TRACKING_FILE="/data/incoming/.downloaded_albums" +LOG_FILE="/data/incoming/download-log" + +# Create tracking file if it doesn't exist +touch "$TRACKING_FILE" + +# Get list of albums on remote server +echo "$(date): Checking for new albums on seedbox..." >> "$LOG_FILE" +REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{print $5}' | grep -v '^\.') || true + +if [ -z "$REMOTE_ALBUMS" ]; then + echo "$(date): No albums found on remote server" >> "$LOG_FILE" + exit 0 +fi + +# Check each album against tracking file +NEW_ALBUMS="" +while IFS= read -r album; do + if [ -n "$album" ] && ! grep -q "^$album$" "$TRACKING_FILE"; then + NEW_ALBUMS="$NEW_ALBUMS$album\n" + echo "$(date): Found new album: $album" >> "$LOG_FILE" + fi +done <<< "$REMOTE_ALBUMS" + +if [ -z "$NEW_ALBUMS" ]; then + echo "$(date): No new albums to download" >> "$LOG_FILE" + exit 0 +fi + +# Download new albums only +echo "$(date): Starting download of new albums..." >> "$LOG_FILE" +while IFS= read -r album; do + if [ -n "$album" ]; then + echo "$(date): Downloading $album" >> "$LOG_FILE" + if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/"; then + echo "$album" >> "$TRACKING_FILE" + echo "$(date): Successfully downloaded $album" >> "$LOG_FILE" + else + echo "$(date): Failed to download $album" >> "$LOG_FILE" + fi + fi +done <<< "$(echo -e "$NEW_ALBUMS")" + +echo "$(date): Music sync completed" >> "$LOG_FILE" From e585ffe73ecd8b5d6106dce02934013062b03645 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sat, 13 Sep 2025 00:06:03 -0700 Subject: [PATCH 6/9] actually fix music --- hosts/box/default.nix | 1 + hosts/profiles/gonic/default.nix | 3 ++ hosts/profiles/sync/music/default.nix | 1 + hosts/profiles/sync/music/get-music.sh | 61 ++++++++++++++------------ 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/hosts/box/default.nix b/hosts/box/default.nix index 2c651928..6e73a783 100644 --- a/hosts/box/default.nix +++ b/hosts/box/default.nix @@ -18,6 +18,7 @@ ../profiles/wallabag ../profiles/finance ../profiles/sync/website + ../profiles/sync/music ../profiles/grasp # ../profiles/archivebox # ../profiles/woodpecker-agent diff --git a/hosts/profiles/gonic/default.nix b/hosts/profiles/gonic/default.nix index 1dd18e42..6c17e54f 100644 --- a/hosts/profiles/gonic/default.nix +++ b/hosts/profiles/gonic/default.nix @@ -1,11 +1,14 @@ { config, lib, pkgs, ... }: { + environment.systemPackages = [ pkgs.ffmpeg ]; mossnet.gonic.enable = true; mossnet.gonic.settings = '' music-path /mnt/two/music/ podcast-path /data/podcasts cache-path /data/cache playlists-path /data/playlists + transcode-cache-size 1000 + transcode-eject-interval 1440 ''; mossnet.gonic.user = "gonic"; mossnet.gonic.group = "audio"; diff --git a/hosts/profiles/sync/music/default.nix b/hosts/profiles/sync/music/default.nix index 461e9d6c..7e9c1be6 100644 --- a/hosts/profiles/sync/music/default.nix +++ b/hosts/profiles/sync/music/default.nix @@ -6,6 +6,7 @@ path = [ pkgs.coreutils pkgs.rsync + pkgs.beets ]; script = builtins.readFile ./get-music.sh; serviceConfig = { diff --git a/hosts/profiles/sync/music/get-music.sh b/hosts/profiles/sync/music/get-music.sh index 242cbe55..6d9faf4c 100755 --- a/hosts/profiles/sync/music/get-music.sh +++ b/hosts/profiles/sync/music/get-music.sh @@ -2,51 +2,58 @@ set -euo pipefail -REMOTE_HOST="anish@talos.feralhosting.com" +REMOTE_HOST="aynish@talos.feralhosting.com" REMOTE_PATH="private/transmission/data/" -LOCAL_PATH="/data/incoming" -TRACKING_FILE="/data/incoming/.downloaded_albums" -LOG_FILE="/data/incoming/download-log" +LOCAL_PATH="/mnt/two/incoming" +TRACKING_FILE="/mnt/two/incoming/.downloaded_albums" +LOG_FILE="/mnt/two/incoming/download-log" # Create tracking file if it doesn't exist touch "$TRACKING_FILE" # Get list of albums on remote server -echo "$(date): Checking for new albums on seedbox..." >> "$LOG_FILE" -REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{print $5}' | grep -v '^\.') || true +echo "$(date): Checking for new albums on seedbox..." >>"$LOG_FILE" +REMOTE_ALBUMS=$(rsync --dry-run --list-only "$REMOTE_HOST:$REMOTE_PATH" | grep '^d' | awk '{$1=$2=$3=$4=""; sub(/^ +/, ""); print}' | grep -v '^\.') || true if [ -z "$REMOTE_ALBUMS" ]; then - echo "$(date): No albums found on remote server" >> "$LOG_FILE" - exit 0 + echo "$(date): No albums found on remote server" >>"$LOG_FILE" + exit 0 fi # Check each album against tracking file NEW_ALBUMS="" while IFS= read -r album; do - if [ -n "$album" ] && ! grep -q "^$album$" "$TRACKING_FILE"; then - NEW_ALBUMS="$NEW_ALBUMS$album\n" - echo "$(date): Found new album: $album" >> "$LOG_FILE" - fi -done <<< "$REMOTE_ALBUMS" + if [ -n "$album" ] && ! grep -qF "$album" "$TRACKING_FILE"; then + NEW_ALBUMS="$NEW_ALBUMS$album\n" + echo "$(date): Found new album: $album" >>"$LOG_FILE" + fi +done <<<"$REMOTE_ALBUMS" if [ -z "$NEW_ALBUMS" ]; then - echo "$(date): No new albums to download" >> "$LOG_FILE" - exit 0 + echo "$(date): No new albums to download" >>"$LOG_FILE" + exit 0 fi # Download new albums only -echo "$(date): Starting download of new albums..." >> "$LOG_FILE" +echo "$(date): Starting download of new albums..." >>"$LOG_FILE" while IFS= read -r album; do - if [ -n "$album" ]; then - echo "$(date): Downloading $album" >> "$LOG_FILE" - if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/"; then - echo "$album" >> "$TRACKING_FILE" - echo "$(date): Successfully downloaded $album" >> "$LOG_FILE" - else - echo "$(date): Failed to download $album" >> "$LOG_FILE" - fi - fi -done <<< "$(echo -e "$NEW_ALBUMS")" + if [ -n "$album" ]; then + echo "$(date): Downloading $album" >>"$LOG_FILE" + if rsync -r --log-file="$LOG_FILE" "$REMOTE_HOST:$REMOTE_PATH$album/" "$LOCAL_PATH/$album/"; then + echo "$album" >>"$TRACKING_FILE" + echo "$(date): Successfully downloaded $album" >>"$LOG_FILE" -echo "$(date): Music sync completed" >> "$LOG_FILE" + # Import to beets + echo "$(date): Importing $album to beets..." >>"$LOG_FILE" + if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then + echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE" + else + echo "$(date): Failed to import $album to beets" >>"$LOG_FILE" + fi + else + echo "$(date): Failed to download $album" >>"$LOG_FILE" + fi + fi +done <<<"$(echo -e "$NEW_ALBUMS")" +echo "$(date): Music sync completed" >>"$LOG_FILE" From 266c981cd4f3a1243daa8ecf77236da41f5295b3 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Tue, 16 Sep 2025 10:47:50 -0700 Subject: [PATCH 7/9] more music stuff --- hosts/profiles/sync/music/default.nix | 4 +++- hosts/profiles/sync/music/get-music.sh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hosts/profiles/sync/music/default.nix b/hosts/profiles/sync/music/default.nix index 7e9c1be6..b1f2020d 100644 --- a/hosts/profiles/sync/music/default.nix +++ b/hosts/profiles/sync/music/default.nix @@ -5,6 +5,8 @@ serviceConfig.Type = "oneshot"; path = [ pkgs.coreutils + pkgs.openssh + pkgs.gawk pkgs.rsync pkgs.beets ]; @@ -13,7 +15,7 @@ User = "anish"; }; }; - systemd.timers.get-music-timer = { + systemd.timers.get-music-sync = { wantedBy = [ "timers.target" ]; partOf = [ "get-music-sync.service" ]; timerConfig.OnCalendar = [ "hourly" ]; diff --git a/hosts/profiles/sync/music/get-music.sh b/hosts/profiles/sync/music/get-music.sh index 6d9faf4c..5d67289a 100755 --- a/hosts/profiles/sync/music/get-music.sh +++ b/hosts/profiles/sync/music/get-music.sh @@ -45,6 +45,8 @@ while IFS= read -r album; do # Import to beets echo "$(date): Importing $album to beets..." >>"$LOG_FILE" + # Set umask to allow group read/write access + umask 002 if beet -p fetchart import -m -l /home/anish/music.log -q -g "$LOCAL_PATH/$album"; then echo "$(date): Successfully imported $album to beets" >>"$LOG_FILE" else From 5daf0b0dc533ea2813e111b81dbada5c0ce9936d Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sun, 28 Sep 2025 20:18:46 -0700 Subject: [PATCH 8/9] vaguely more helpful commit message --- flake.lock | 452 +++++++++++++++++++++- flake.nix | 8 +- home/profiles/cli/default.nix | 3 +- home/profiles/desktop/kitty.conf | 7 +- home/profiles/desktop/rofi/emojimenu.rasi | 27 +- home/profiles/desktop/sxhkdrc | 4 +- hosts/curve/default.nix | 7 +- hosts/profiles/desktop/default.nix | 1 + hosts/profiles/gonic/default.nix | 2 - hosts/profiles/music/default.nix | 1 + 10 files changed, 488 insertions(+), 24 deletions(-) diff --git a/flake.lock b/flake.lock index 2984e35e..3085b83a 100644 --- a/flake.lock +++ b/flake.lock @@ -23,9 +23,36 @@ "type": "github" } }, + "autohide-tdrop": { + "inputs": { + "devenv": "devenv", + "fenix": "fenix", + "flake-parts": "flake-parts", + "flake-root": "flake-root", + "mk-shell-bin": "mk-shell-bin", + "nix2container": "nix2container", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1728286844, + "narHash": "sha256-JkCgvlN9uHltyc+GMHTo+VHZRwKpGMU6hwvL49tpd7U=", + "owner": "I-Want-ToBelieve", + "repo": "autohide-tdrop", + "rev": "c3eb1df4f4311de843179b03673296136ded0d2f", + "type": "github" + }, + "original": { + "owner": "I-Want-ToBelieve", + "repo": "autohide-tdrop", + "type": "github" + } + }, "basant": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_3", "nixpkgs": [ "nixpkgs" ], @@ -72,7 +99,7 @@ }, "deploy-rs": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixpkgs" ], @@ -92,6 +119,27 @@ "type": "github" } }, + "devenv": { + "inputs": { + "flake-compat": "flake-compat", + "nix": "nix", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1701187605, + "narHash": "sha256-NctguPdUeDVLXFsv6vI1RlEiHLsXkeW3pgZe/mwn1BU=", + "owner": "cachix", + "repo": "devenv", + "rev": "a7c4dd8f4eb1f98a6b8f04bf08364954e1e73e4f", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, "devshell": { "locked": { "lastModified": 1642188268, @@ -143,7 +191,45 @@ "type": "github" } }, + "fenix": { + "inputs": { + "nixpkgs": [ + "autohide-tdrop", + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1701671019, + "narHash": "sha256-ctG01Syj/7TrfV4arc3qyN4a3mAvgXbivYrdXKqdL8U=", + "owner": "nix-community", + "repo": "fenix", + "rev": "5e6667eda7fb055c0a8388172372fb89e5b33e05", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -159,7 +245,7 @@ "type": "github" } }, - "flake-compat_2": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1641205782, @@ -175,7 +261,74 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1698882062, + "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "path": "/nix/store/vf5ra8smwlqy3pi0300s580g5msc3xp7-source", + "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "type": "path" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, + "flake-root": { + "locked": { + "lastModified": 1692742795, + "narHash": "sha256-f+Y0YhVCIJ06LemO+3Xx00lIcqQxSKJHXT/yk1RTKxw=", + "owner": "srid", + "repo": "flake-root", + "rev": "d9a70d9c7a5fd7f3258ccf48da9335e9b47c3937", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "flake-root", + "type": "github" + } + }, "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { "locked": { "lastModified": 1638122382, "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", @@ -190,7 +343,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_4": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -205,9 +358,32 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "autohide-tdrop", + "devenv", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "grasp": { "inputs": { - "flake-utils": "flake-utils_2", + "flake-utils": "flake-utils_4", "nixpkgs": [ "nixpkgs" ] @@ -284,12 +460,68 @@ "type": "github" } }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, + "mk-shell-bin": { + "locked": { + "lastModified": 1677004959, + "narHash": "sha256-/uEkr1UkJrh11vD02aqufCxtbF5YnhRTIKlx5kyvf+I=", + "owner": "rrbutani", + "repo": "nix-mk-shell-bin", + "rev": "ff5d8bd4d68a347be5042e2f16caee391cd75887", + "type": "github" + }, + "original": { + "owner": "rrbutani", + "repo": "nix-mk-shell-bin", + "type": "github" + } + }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": [ + "autohide-tdrop", + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1676545802, + "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", + "owner": "domenkozar", + "repo": "nix", + "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "relaxed-flakes", + "repo": "nix", + "type": "github" + } + }, "nix-matrix-appservices": { "inputs": { "devshell": "devshell", - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "nixlib": "nixlib", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1683490239, @@ -305,6 +537,28 @@ "type": "gitlab" } }, + "nix2container": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "autohide-tdrop", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700389764, + "narHash": "sha256-hMsZ741ri9c4ZQpB6mgLY8KErk0yXVAOUjfNkP1nbbw=", + "owner": "nlewo", + "repo": "nix2container", + "rev": "4400b77e14f3095ee3215a9a5e0f9143bc0e8f2d", + "type": "github" + }, + "original": { + "owner": "nlewo", + "repo": "nix2container", + "type": "github" + } + }, "nixlib": { "locked": { "lastModified": 1643502816, @@ -337,6 +591,88 @@ } }, "nixpkgs": { + "locked": { + "lastModified": 1678875422, + "narHash": "sha256-T3o6NcQPwXjxJMn2shz86Chch4ljXgZn746c2caGxd8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "126f49a01de5b7e35a43fd43f891ecf6d3a51459", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1698611440, + "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "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-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1695644571, + "narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1662099760, "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", @@ -352,7 +688,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs_4": { "locked": { "lastModified": 1755274400, "narHash": "sha256-rTInmnp/xYrfcMZyFMH3kc8oko5zYfxsowaLv1LVobY=", @@ -404,9 +740,40 @@ "url": "ssh://gitea@git.sealight.xyz/aynish/kitaab" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "autohide-tdrop", + "devenv", + "flake-compat" + ], + "flake-utils": "flake-utils", + "gitignore": "gitignore", + "nixpkgs": [ + "autohide-tdrop", + "devenv", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1688056373, + "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5843cf069272d92b60c3ed9e55b7a8989c01d4c7", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", + "autohide-tdrop": "autohide-tdrop", "basant": "basant", "deploy-rs": "deploy-rs", "disko": "disko", @@ -415,7 +782,7 @@ "home-manager": "home-manager_2", "nix-matrix-appservices": "nix-matrix-appservices", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_4", "nur": "nur", "poonam": "poonam", "rust-overlay": "rust-overlay", @@ -424,6 +791,23 @@ "vimwikicli": "vimwikicli" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1701447636, + "narHash": "sha256-WaCcxLNAqo/FAK0QtYqweKCUVTGcbKpFIHClc+k2YlI=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "e402c494b7c7d94a37c6d789a216187aaf9ccd3e", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "rust-overlay": { "inputs": { "nixpkgs": [ @@ -490,6 +874,36 @@ "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" + } + }, "tidal-src": { "flake": false, "locked": { @@ -532,6 +946,24 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1699786194, + "narHash": "sha256-3h3EH1FXQkIeAuzaWB+nK0XK54uSD46pp+dMD3gAcB4=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "e82f32aa7f06bbbd56d7b12186d555223dc399d1", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1752687322, @@ -550,7 +982,7 @@ }, "utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_4" }, "locked": { "lastModified": 1701680307, diff --git a/flake.nix b/flake.nix index e8df696d..616d6edd 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,10 @@ }; tidalcycles.url = "github:mitchmindtree/tidalcycles.nix"; tidalcycles.inputs.nixpkgs.follows = "unstable"; + autohide-tdrop = { + url = "github:I-Want-ToBelieve/autohide-tdrop"; + inputs.nixpkgs.follows = "nixpkgs"; + }; # TODO hundred rabbits software # TODO needs secrets # dhyan.url = "git+ssh://gitea@git.sealight.xyz/aynish/dhyan?ref=main"; @@ -57,7 +61,7 @@ outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs , agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles - , rust-overlay, vimwikicli, ... }@inputs: + , rust-overlay, vimwikicli, autohide-tdrop, ... }@inputs: let forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" @@ -73,6 +77,7 @@ }; vimwikiOverlay = final: prev: { vimwiki-cli = vimwikicli.packages.${prev.system}.vimwiki-cli; + autohide-tdrop = autohide-tdrop.packages.${prev.system}.default; }; nixpkgsFor = forAllSystems (system: @@ -88,6 +93,7 @@ "vcv-rack" "SunVox" "renoise" + "bitwig-studio-unwrapped" ]; }; overlays = [ diff --git a/home/profiles/cli/default.nix b/home/profiles/cli/default.nix index 8a99cc12..a3da81a3 100644 --- a/home/profiles/cli/default.nix +++ b/home/profiles/cli/default.nix @@ -299,7 +299,8 @@ nepl = "n repl ''"; srch = "ns nixpkgs"; orch = "ns override"; - nrb = "cd /tmp; sudo nixos-rebuild switch --flake '/home/anish/usr/helm#curve'; cd $OLDPWD"; + # need --impure for bitwig, something about my flake setup doesn't like allow unfree + nrb = "cd /tmp; sudo nixos-rebuild switch --impure --flake '/home/anish/usr/helm#curve'; cd $OLDPWD"; nrt = "cd /tmp; sudo nixos-rebuild test --flake '/home/anish/usr/helm#curve'; cd $OLDPWD"; ned = "cd /home/anish/usr/helm; vim; cd $OLDPWD"; ncd = "cd /home/anish/usr/helm"; diff --git a/home/profiles/desktop/kitty.conf b/home/profiles/desktop/kitty.conf index 2122ff7c..b8cd3ec5 100644 --- a/home/profiles/desktop/kitty.conf +++ b/home/profiles/desktop/kitty.conf @@ -9,9 +9,8 @@ mouse_map left click ungrabbed mouse_click_url_or_select confirm_os_window_close 0 enable_audio_bell no + + # Ctrl+V for paste map ctrl+v paste_from_clipboard - --- Allows zen-mode.nvim to increase font size --- allow_remote_control socket-only --- listen_on unix:/tmp/kitty +mouse_map middle release ungrabbed paste_from_clipboard diff --git a/home/profiles/desktop/rofi/emojimenu.rasi b/home/profiles/desktop/rofi/emojimenu.rasi index 662aa044..00ab4a24 100644 --- a/home/profiles/desktop/rofi/emojimenu.rasi +++ b/home/profiles/desktop/rofi/emojimenu.rasi @@ -2,12 +2,35 @@ @import "config.rasi" +textbox { + vertical-align: 0.5; + horizontal-align: 0.5; +} + listview { - columns: 4; + columns: 9; + lines: 7; + cycle: true; + dynamic: true; + layout: vertical; + flow: horizontal; + reverse: false; + fixed-height: true; + fixed-columns: true; +} + +element { + orientation: vertical; +} + +element-text { + vertical-align: 0.5; + horizontal-align: 0.5; + font: "FiraCode Nerd Font 24"; } textbox-icon { - str: "🎑"; + str: "❇️ "; } prompt { diff --git a/home/profiles/desktop/sxhkdrc b/home/profiles/desktop/sxhkdrc index 160307c0..e33ccefd 100644 --- a/home/profiles/desktop/sxhkdrc +++ b/home/profiles/desktop/sxhkdrc @@ -16,7 +16,7 @@ super + Return kitty ctrl + super + Return - xst -e bash -c "(tmux ls | grep -qEv 'attached|scratch' && tmux at) || tmux" + tdrop -n tdrop_kitty --post-create-hook "autohide-tdrop &" -ma -h 60% -w 70% -x 15% -y 32 kitty --class=tdrop_kitty super + space rofi -show drun -modi drun,run -show-icons -theme theme/appmenu.rasi @@ -25,7 +25,7 @@ super + Tab rofi -show window -show-icons -theme theme/windowmenu.rasi super + e - rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy + rofimoji --selector-args "-theme theme/emojimenu.rasi" --skin-tone moderate --action copy --hidden-descriptions super + a paste diff --git a/hosts/curve/default.nix b/hosts/curve/default.nix index b166ef52..414c29ca 100644 --- a/hosts/curve/default.nix +++ b/hosts/curve/default.nix @@ -23,12 +23,15 @@ settings.PermitRootLogin = "no"; }; + hardware.keyboard.qmk.enable = true; + services.udev.packages = with pkgs; [ via ]; + # import profiling tools programs.systemtap.enable = true; virtualisation.docker.enable = true; virtualisation.docker.storageDriver = "btrfs"; - environment.systemPackages = with pkgs; [ docker-compose ]; + environment.systemPackages = with pkgs; [ docker-compose via ]; # Speed up boot by removing dependency on network systemd = { @@ -69,7 +72,7 @@ # lazy enable of ports necessary for KDE connect which is installed via cli home profile (for some reason?) networking.firewall = { - allowedTCPPorts = [ 22 4173 ]; # allow ssh + allowedTCPPorts = [ 22 4173 3000 ]; # allow ssh and vibekanban allowedTCPPortRanges = [{ from = 1714; to = 1764; diff --git a/hosts/profiles/desktop/default.nix b/hosts/profiles/desktop/default.nix index 6c17ce3b..f1b38f91 100644 --- a/hosts/profiles/desktop/default.nix +++ b/hosts/profiles/desktop/default.nix @@ -98,6 +98,7 @@ in { # tic-80 ytfzf yt-dlp + # autohide-tdrop ]; xdg.portal = { diff --git a/hosts/profiles/gonic/default.nix b/hosts/profiles/gonic/default.nix index 6c17e54f..e035cbbe 100644 --- a/hosts/profiles/gonic/default.nix +++ b/hosts/profiles/gonic/default.nix @@ -7,8 +7,6 @@ podcast-path /data/podcasts cache-path /data/cache playlists-path /data/playlists - transcode-cache-size 1000 - transcode-eject-interval 1440 ''; mossnet.gonic.user = "gonic"; mossnet.gonic.group = "audio"; diff --git a/hosts/profiles/music/default.nix b/hosts/profiles/music/default.nix index 5e0d4225..622af9fa 100644 --- a/hosts/profiles/music/default.nix +++ b/hosts/profiles/music/default.nix @@ -29,6 +29,7 @@ # ardour # reaper # renoise + bitwig-studio ]; services.pulseaudio.enable = false; From baa309eb4b6b8b107f48365c290b1f254f78280a Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Sun, 5 Oct 2025 20:51:20 -0700 Subject: [PATCH 9/9] some small nvim changes --- flake.lock | 191 +++++++++++++++++++++++++++++++++ flake.nix | 9 +- home/profiles/nvim/default.nix | 117 ++++++++++++++++++++ 3 files changed, 316 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index 5034bb7b..7d1edbb5 100644 --- a/flake.lock +++ b/flake.lock @@ -299,6 +299,20 @@ "type": "github" } }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1751685974, + "narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=", + "rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1", + "type": "tarball", + "url": "https://git.lix.systems/api/v1/repos/lix-project/flake-compat/archive/549f2762aebeff29a2e5ece7a7dc0f955281a1d1.tar.gz?rev=549f2762aebeff29a2e5ece7a7dc0f955281a1d1" + }, + "original": { + "type": "tarball", + "url": "https://git.lix.systems/lix-project/flake-compat/archive/main.tar.gz" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -417,6 +431,24 @@ "type": "github" } }, + "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gitignore": { "inputs": { "nixpkgs": [ @@ -440,6 +472,28 @@ "type": "github" } }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils_5", + "nixpkgs": [ + "tangled", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1754078208, + "narHash": "sha256-YVoIFDCDpYuU3riaDEJ3xiGdPOtsx4sR5eTzHTytPV8=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "7f963246a71626c7fc70b431a315c4388a0c95cf", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "type": "github" + } + }, "grasp": { "inputs": { "flake-utils": "flake-utils_4", @@ -567,6 +621,72 @@ "type": "github" } }, + "htmx-src": { + "flake": false, + "locked": { + "narHash": "sha256-nm6avZuEBg67SSyyZUhjpXVNstHHgUxrtBHqJgowU08=", + "type": "file", + "url": "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js" + }, + "original": { + "type": "file", + "url": "https://unpkg.com/htmx.org@2.0.4/dist/htmx.min.js" + } + }, + "htmx-ws-src": { + "flake": false, + "locked": { + "narHash": "sha256-2fg6KyEJoO24q0fQqbz9RMaYNPQrMwpZh29tkSqdqGY=", + "type": "file", + "url": "https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.2" + }, + "original": { + "type": "file", + "url": "https://cdn.jsdelivr.net/npm/htmx-ext-ws@2.0.2" + } + }, + "ibm-plex-mono-src": { + "flake": false, + "locked": { + "lastModified": 1731402384, + "narHash": "sha256-OwUmrPfEehLDz0fl2ChYLK8FQM2p0G1+EMrGsYEq+6g=", + "type": "tarball", + "url": "https://github.com/IBM/plex/releases/download/@ibm/plex-mono@1.1.0/ibm-plex-mono.zip" + }, + "original": { + "type": "tarball", + "url": "https://github.com/IBM/plex/releases/download/@ibm/plex-mono@1.1.0/ibm-plex-mono.zip" + } + }, + "indigo": { + "flake": false, + "locked": { + "lastModified": 1753693716, + "narHash": "sha256-DMIKnCJRODQXEHUxA+7mLzRALmnZhkkbHlFT2rCQYrE=", + "owner": "oppiliappan", + "repo": "indigo", + "rev": "5f170569da9360f57add450a278d73538092d8ca", + "type": "github" + }, + "original": { + "owner": "oppiliappan", + "repo": "indigo", + "type": "github" + } + }, + "inter-fonts-src": { + "flake": false, + "locked": { + "lastModified": 1731687360, + "narHash": "sha256-5vdKKvHAeZi6igrfpbOdhZlDX2/5+UvzlnCQV6DdqoQ=", + "type": "tarball", + "url": "https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip" + }, + "original": { + "type": "tarball", + "url": "https://github.com/rsms/inter/releases/download/v4.1/Inter-4.1.zip" + } + }, "jovian": { "inputs": { "nix-github-actions": "nix-github-actions", @@ -604,6 +724,19 @@ "type": "github" } }, + "lucide-src": { + "flake": false, + "locked": { + "lastModified": 1754044466, + "narHash": "sha256-+exBR2OToB1iv7ZQI2S4B0lXA/QRvC9n6U99UxGpJGs=", + "type": "tarball", + "url": "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip" + }, + "original": { + "type": "tarball", + "url": "https://github.com/lucide-icons/lucide/releases/download/0.536.0/lucide-icons-0.536.0.zip" + } + }, "mk-shell-bin": { "locked": { "lastModified": 1677004959, @@ -980,6 +1113,7 @@ "nur": "nur", "poonam": "poonam", "rust-overlay": "rust-overlay", + "tangled": "tangled", "tidalcycles": "tidalcycles", "unstable": "unstable", "vimwikicli": "vimwikicli" @@ -1022,6 +1156,19 @@ "type": "github" } }, + "sqlite-lib-src": { + "flake": false, + "locked": { + "lastModified": 1706631843, + "narHash": "sha256-bJoMjirsBjm2Qk9KPiy3yV3+8b/POlYe76/FQbciHro=", + "type": "tarball", + "url": "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip" + }, + "original": { + "type": "tarball", + "url": "https://sqlite.org/2024/sqlite-amalgamation-3450100.zip" + } + }, "superdirt-src": { "flake": false, "locked": { @@ -1098,6 +1245,50 @@ "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" + } + }, + "tangled": { + "inputs": { + "flake-compat": "flake-compat_4", + "gomod2nix": "gomod2nix", + "htmx-src": "htmx-src", + "htmx-ws-src": "htmx-ws-src", + "ibm-plex-mono-src": "ibm-plex-mono-src", + "indigo": "indigo", + "inter-fonts-src": "inter-fonts-src", + "lucide-src": "lucide-src", + "nixpkgs": [ + "nixpkgs" + ], + "sqlite-lib-src": "sqlite-lib-src" + }, + "locked": { + "lastModified": 1759559279, + "narHash": "sha256-gA0mh9Fx2uou2v75RMA6qUvWB3Z74Asc6pRjiojwaRo=", + "ref": "refs/heads/master", + "rev": "5ecd54b31547ac169a3b15d6034a67179f22aa33", + "revCount": 1486, + "type": "git", + "url": "https://tangled.org/@tangled.org/core" + }, + "original": { + "type": "git", + "url": "https://tangled.org/@tangled.org/core" + } + }, "tidal-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index ced56e29..2cb9d3d3 100644 --- a/flake.nix +++ b/flake.nix @@ -65,6 +65,12 @@ inputs.nixpkgs.follows = "unstable"; }; + # Tangled (atproto tools) + tangled = { + url = "git+https://tangled.org/@tangled.org/core"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Others nur.url = "github:nix-community/NUR"; rust-overlay = { @@ -89,7 +95,7 @@ outputs = { self, nixpkgs, unstable, nixos-hardware, home-manager, deploy-rs , agenix, disko, basant, grasp, nix-matrix-appservices, nur, tidalcycles , rust-overlay, vimwikicli, autohide-tdrop, darwin, nix-homebrew, homebrew-bundle - , homebrew-core, homebrew-cask, jovian, ... }@inputs: + , homebrew-core, homebrew-cask, jovian, tangled, ... }@inputs: let forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" @@ -147,6 +153,7 @@ # ]; overlays = [ agenix.overlays.default + tangled.overlays.default # atproto tools only on lite deployments self.overlays.additions self.overlays.modifications tidalcycles.overlays.default # needed for nvim which comes pre-installed lol diff --git a/home/profiles/nvim/default.nix b/home/profiles/nvim/default.nix index e34501d6..8a2c51b5 100644 --- a/home/profiles/nvim/default.nix +++ b/home/profiles/nvim/default.nix @@ -228,6 +228,7 @@ in nnoremap fb Telescope buffers nnoremap fh Telescope help_tags nnoremap ft Telescope tags + nnoremap fr lua KitaabRecent() " exit normal mode in terminal :tnoremap @@ -975,6 +976,110 @@ in vim.keymap.set('n', '', 'resize +2', {silent = true}) vim.keymap.set('n', '', 'vertical resize +2', {silent = true}) + -- Kitaab recent files (only date-based files, sorted reverse) + function KitaabRecent() + local pickers = require('telescope.pickers') + local finders = require('telescope.finders') + local conf = require('telescope.config').values + + -- Use current working directory + local kitaab_path = vim.fn.getcwd() + + -- Get all files (depth 1, exclude directories) + local files = vim.fn.readdir(kitaab_path, function(name) + return vim.fn.isdirectory(kitaab_path .. '/' .. name) == 0 + end) + + -- Filter to only date-based files (starting with digit) + local date_files = {} + for _, filename in ipairs(files) do + if filename:match('^%d') then + table.insert(date_files, filename) + end + end + + -- Sort in reverse (most recent first) + table.sort(date_files, function(a, b) return a > b end) + + pickers.new({}, { + prompt_title = 'Kitaab Recent', + finder = finders.new_table({ + results = date_files, + entry_maker = function(entry) + return { + value = kitaab_path .. '/' .. entry, + display = entry, + ordinal = entry, + path = kitaab_path .. '/' .. entry, + } + end + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }):find() + end + + -- Setup amp.nvim + require('amp').setup({ + auto_start = true, + log_level = "info" + }) + + -- Amp commands + vim.api.nvim_create_user_command("AmpSend", function(opts) + local message = opts.args + if message == "" then + print("Please provide a message to send") + return + end + local amp_message = require("amp.message") + amp_message.send_message(message) + end, { + nargs = "*", + desc = "Send a message to Amp", + }) + + vim.api.nvim_create_user_command("AmpSendBuffer", function(opts) + local buf = vim.api.nvim_get_current_buf() + local lines = vim.api.nvim_buf_get_lines(buf, 0, -1, false) + local content = table.concat(lines, "\n") + local amp_message = require("amp.message") + amp_message.send_message(content) + end, { + nargs = "?", + desc = "Send current buffer contents to Amp", + }) + + vim.api.nvim_create_user_command("AmpPromptSelection", function(opts) + local lines = vim.api.nvim_buf_get_lines(0, opts.line1 - 1, opts.line2, false) + local text = table.concat(lines, "\n") + local amp_message = require("amp.message") + amp_message.send_to_prompt(text) + end, { + range = true, + desc = "Add selected text to Amp prompt", + }) + + vim.api.nvim_create_user_command("AmpPromptRef", function(opts) + local bufname = vim.api.nvim_buf_get_name(0) + if bufname == "" then + print("Current buffer has no filename") + return + end + local relative_path = vim.fn.fnamemodify(bufname, ":.") + local ref = "@" .. relative_path + if opts.line1 ~= opts.line2 then + ref = ref .. "#L" .. opts.line1 .. "-" .. opts.line2 + elseif opts.line1 > 1 then + ref = ref .. "#L" .. opts.line1 + end + local amp_message = require("amp.message") + amp_message.send_to_prompt(ref) + end, { + range = true, + desc = "Add file reference (with selection) to Amp prompt", + }) + EOF ''; @@ -1093,6 +1198,17 @@ in yuck-vim nvim-parinfer # vim-processing + + # amp.nvim for Sourcegraph Amp integration + (pkgs.vimUtils.buildVimPlugin { + name = "amp-nvim"; + src = pkgs.fetchFromGitHub { + owner = "sourcegraph"; + repo = "amp.nvim"; + rev = "main"; + sha256 = "1n6d8nbakyg6yiq8mhhrvmsp9z0zb8cb67820jsg3wl6vqd1vwv5"; + }; + }) ]; withPython3 = true; extraPython3Packages = pkgs: with pkgs; [ tasklib six packaging ]; @@ -1100,3 +1216,4 @@ in }; } +