subtitle-merge/flake.nix
Skye f9df43f5e7 Shell completions and refactors
Output shell completions with `clap_complete`, moving the cli args types into a new file `cli_args.rs`, and add them to the nix package defined in the flake output. Update clap to 4.5.21. Various minor refactors in main.rs, including a removal of `itertools` as a dependency.
2024-11-14 15:38:01 -05:00

43 lines
1.2 KiB
Nix

{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }:
let pkgs = nixpkgs.legacyPackages.x86_64-linux;
inherit (pkgs) lib;
system = "x86_64-linux";
in rec {
formatter."${system}" = pkgs.nixfmt-rfc-style;
devShells."${system}".default = pkgs.mkShell {
packages = [
pkgs.mkvtoolnix-cli
];
};
overlays.default = final: prev: {
subtitle-merge = final.rustPlatform.buildRustPackage {
name = "subtitle-merge";
version = "0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildInputs = builtins.attrValues {
inherit (final) installShellFiles mkvtoolnix-cli;
};
postInstall = ''
installShellCompletion --cmd subtitle-merge \
--bash ./target/release-tmp/build/*/out/subtitle-merge.bash \
--fish ./target/release-tmp/build/*/out/subtitle-merge.fish \
--zsh ./target/release-tmp/build/*/out/_subtitle-merge
'';
};
};
packages."${system}" = rec {
inherit (overlays.default pkgs pkgs) subtitle-merge;
default = subtitle-merge;
};
};
}