diff --git a/flake.nix b/flake.nix index fb1e515..46f1669 100644 --- a/flake.nix +++ b/flake.nix @@ -78,6 +78,7 @@ ./presets/nixos.nix ./presets/terminal.nix ./modules/docker + ./modules/video ]; specialArgs = commonSpecialArgs; }; diff --git a/modules/nvim/default.nix b/modules/nvim/default.nix index b6c4ad5..f255760 100644 --- a/modules/nvim/default.nix +++ b/modules/nvim/default.nix @@ -7,6 +7,7 @@ let }; in { + environment.variables.EDITOR = nvim-rg; home-manager.users."${username}" = { programs.bash.shellAliases = aliases; programs.fish.shellAliases = aliases; diff --git a/modules/video/default.nix b/modules/video/default.nix new file mode 100644 index 0000000..0ec83d0 --- /dev/null +++ b/modules/video/default.nix @@ -0,0 +1,28 @@ +{ pkgs, username, ... }: +let + ffmpeg-nice = pkgs.writeShellApplication { + name = "ffmpeg-nice"; + runtimeInputs = [ pkgs.ffmpeg-full ]; + text = /* shell */ '' + set -o xtrace + output="''${1%.*}_NICE.mp4" + ffmpeg \ + -i "$1" \ + -n \ + -c:v libx265 \ + -crf 20 \ + -preset slow \ + -c:a aac -b:a 192k \ + -maxrate 4000k -bufsize 8000k \ + -movflags use_metadata_tags+faststart \ + -map_metadata 0 \ + "$output" + ''; + }; +in +{ + users.users."${username}".packages = [ + pkgs.ffmpeg-full + ffmpeg-nice + ]; +}