diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index ea8c4bf..1edb211 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/.direnv \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..d3fd202 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1731245184, + "narHash": "sha256-vmLS8+x+gHRv1yzj3n+GTAEObwmhxmkkukB2DwtJRdU=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "aebe249544837ce42588aa4b2e7972222ba12e8f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..64e5674 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + 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 = "1.0"; + src = ./.; + cargoLock.lockFile = ./Cargo.lock; + buildInputs = [ final.mkvtoolnix-cli ]; + }; + }; + + packages."${system}" = rec { + subtitle-merge = (overlays.default pkgs pkgs).subtitle-merge; + default = subtitle-merge; + }; + }; +}