mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-18 18:57:32 -08:00
ytdlp and improvment to mounting engi
This commit is contained in:
parent
2477a97767
commit
0b60793ae7
@ -1,3 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
sudo mount -t cifs -o rw,uid=$(id -u $(whoami)),gid=$(id -g $(whoami)),vers=3.0,credentials=/home/tstarr/.smb //192.168.1.175/private /home/tstarr/mnt/engi
|
engi_path="$HOME/mnt/engi"
|
||||||
|
|
||||||
|
if mountpoint -q "$engi_path"; then
|
||||||
|
echo "engi already mounted"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
sudo mount -t cifs -o rw,uid=$(id -u $(whoami)),gid=$(id -g $(whoami)),vers=3.0,credentials=/home/tstarr/.smb //torus/private ~/mnt/engi 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check drive mounted correctly
|
||||||
|
if mountpoint -q "$engi_path"; then
|
||||||
|
echo "engi successfully mounted"
|
||||||
|
else
|
||||||
|
echo "engi failed to mount"
|
||||||
|
fi
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [ ./git.nix ./chezmoi.nix ./kitty.nix ];
|
imports = [
|
||||||
|
./git.nix
|
||||||
|
./chezmoi.nix
|
||||||
|
./kitty.nix
|
||||||
|
./yt-dlp.nix
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
25
provision/modules/programs/yt-dlp.nix
Normal file
25
provision/modules/programs/yt-dlp.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ config, lib, pkgs, user, ... }:
|
||||||
|
|
||||||
|
let cfg = config.modules.programs.yt-dlp;
|
||||||
|
in {
|
||||||
|
options.modules.programs.yt-dlp = with lib; {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
yt-dlp
|
||||||
|
(pkgs.writeScriptBin "ytd_audio" ''
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
linux-mount-engi
|
||||||
|
yt-dlp -f "bestaudio/best" \
|
||||||
|
--embed-metadata --embed-thumbnail \
|
||||||
|
-ciw -o "%(title)s.%(ext)s" \
|
||||||
|
-v --extract-audio "$1"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user