2024-11-13 20:35:07 +00:00
|
|
|
{
|
|
|
|
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";
|
2024-11-14 20:38:01 +00:00
|
|
|
version = "0.1";
|
2024-11-13 20:35:07 +00:00
|
|
|
src = ./.;
|
|
|
|
cargoLock.lockFile = ./Cargo.lock;
|
2024-11-14 20:38:01 +00:00
|
|
|
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
|
|
|
|
'';
|
2024-11-13 20:35:07 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
packages."${system}" = rec {
|
2024-11-14 20:38:01 +00:00
|
|
|
inherit (overlays.default pkgs pkgs) subtitle-merge;
|
2024-11-13 20:35:07 +00:00
|
|
|
default = subtitle-merge;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|