Jafner.net/nix/dungeon-master/home-manager/scripts.nix
Joey Hafner b83b70cb23
Some checks are pending
SSH and echo to file / ssh (push) Waiting to run
Update flake, fix OBS issues, prune flatpaks, add unstable packages list, add Spotify config:
- Update flake to get most recent versions of librespot, spotify-player
- Add obs-toggle-recording script, wrap OBS with nixGL
- Prune flatpaks: Bottles, Chromium, Gnome Platform, Zoom, Kontact, Neochat
- Add unstable packages: librespot, fzf, deploy-rs
- Create librespot Systemd unit, enable spotify-player.
2024-10-23 15:33:37 -07:00

26 lines
800 B
Nix

{ pkgs, ... }:{
home.packages = with pkgs; [
ffmpeg_7-full
( writeShellApplication {
name = "send-to-x264-mp4"; # { filePath }: { none } (side-effect: transcodes & remuxes file to x264/mp4)
runtimeInputs = [
libnotify
];
text = ''
INPUT_FILE=$(realpath "$1")
FILE_PATH=$(dirname "$INPUT_FILE")
FILE_NAME=$(basename "$INPUT_FILE")
FILE_NAME="''${''\FILE_NAME%.*}"
OUTFILE="$FILE_PATH/$FILE_NAME.mp4"
notify-send -t 2000 "Transcode starting" "$FILE_NAME"
nixGL ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 -i "$INPUT_FILE" -map 0 -vf 'format=nv12,hwupload' -c:v h264_vaapi -b:v 8M -c:a copy "$OUTFILE"
notify-send -t 4000 "Transcode complete" "$FILE_NAME"
'';
} )
];
}