add flake.nix

This commit is contained in:
Frieder Hannenheim 2025-03-16 11:46:27 +01:00
parent bc067e2739
commit 7364ac3e73
2 changed files with 140 additions and 0 deletions

41
flake.nix Normal file
View file

@ -0,0 +1,41 @@
{
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, fenix, flake-utils, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system: {
packages.default =
let
toolchain = fenix.packages.${system}.minimal.toolchain;
pkgs = nixpkgs.legacyPackages.${system};
nativeBuildInputs = with pkgs; [ pkg-config libclang ];
buildInputs = with pkgs; [ libclang ];
in
(pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
}).buildRustPackage {
pname = "taggart";
version = "0.1.0";
src = ./.;
inherit buildInputs nativeBuildInputs;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"enolib-0.5.0" = "sha256-NauWYmn1bUAJrIKJ2JN2XjcLsQehE3cjAxBOQ+Nme70=";
"tengri-0.1.0" = "sha256-jo7WovOsW/hpMPWuXBZYiaZukxXJUsbfCrjbNBe/5ww=";
};
};
};
});
}