Add basic nix package

This commit is contained in:
Skye 2024-11-13 15:35:07 -05:00
parent 42406483ac
commit 5be313863e
4 changed files with 62 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View file

@ -1 +1,2 @@
/target
/.direnv

27
flake.lock Normal file
View file

@ -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
}

33
flake.nix Normal file
View file

@ -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;
};
};
}