add scripts

This commit is contained in:
2026-07-29 16:50:43 +02:00
parent 5a61ac8367
commit 01af2f43ea
4 changed files with 37 additions and 1 deletions
+2
View File
@@ -11,6 +11,7 @@
./modules/navidrome.nix ./modules/navidrome.nix
./modules/slskd.nix ./modules/slskd.nix
./modules/smb.nix ./modules/smb.nix
./modules/scripts.nix
]; ];
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@@ -94,6 +95,7 @@
services.tailscale.enable = true; services.tailscale.enable = true;
services.rsync.enable = true; services.rsync.enable = true;
programs.nix-ld.enable = true;
programs.nh.enable = true; programs.nh.enable = true;
programs.neovim.enable = true; programs.neovim.enable = true;
programs.tmux.enable = true; programs.tmux.enable = true;
+5 -1
View File
@@ -1,4 +1,4 @@
{pkgs, ... }: {pkgs, config, ... }:
{ {
imports = [ imports = [
./beets.nix ./beets.nix
@@ -36,6 +36,10 @@
EDITOR = "nvim"; EDITOR = "nvim";
}; };
home.sessionPath = [
"${config.home.homeDirectory}/.local/bin"
];
programs.fish = { programs.fish = {
enable = true; enable = true;
interactiveShellInit = '' interactiveShellInit = ''
+25
View File
@@ -0,0 +1,25 @@
{ pkgs, ... }:
{
environment.systemPackages = [
(pkgs.writeShellScriptBin "scan" ''
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.aiff" \) -print0 |
xargs -0 -P"$(nproc)" -I{} bash -c '
if ffprobe -v quiet -show_entries format_tags \
-of default=nw=1:nk=1 "$1" 2>/dev/null |
grep -q -E "Visit https?://[^ ]+"; then
echo "Match found in: $1"
fi
' _ {} | sort
'')
(pkgs.writeShellScriptBin "2scan" ''
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.aiff" \) -print0 |
xargs -0 -P"$(nproc)" -I{} sh -c '
if ! ffprobe -v quiet -show_entries format_tags \
-of default=nw=1:nk=1 "$1" 2>/dev/null |
grep -q -E "Visit https?://[^ ]+"; then
echo "Match found in: $1"
fi
' _ {}
'')
];
}
+5
View File
@@ -80,6 +80,11 @@
}; };
}; };
}; };
retention = {
files = {
incomplete = 20160;
};
};
}; };
}; };