From 5be313863eece59312def5fe271dad118f32bff7 Mon Sep 17 00:00:00 2001 From: Skye Date: Wed, 13 Nov 2024 15:35:07 -0500 Subject: [PATCH] Add basic nix package --- .envrc | 1 + .gitignore | 1 + flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 33 +++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 .envrc create mode 100644 flake.lock create mode 100644 flake.nix 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; + }; + }; +}