flake reorg

This commit is contained in:
Robin Appelman 2024-12-14 19:26:31 +01:00
commit 9b6e80d522
11 changed files with 125 additions and 231 deletions

19
nix/package.nix Normal file
View file

@ -0,0 +1,19 @@
{ rustPlatform
, lib
}:
let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. [ "Cargo.*" "(src)(/.*)?" ];
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
in
rustPlatform.buildRustPackage rec {
inherit (cargoPackage) version;
pname = cargoPackage.name;
inherit src;
cargoLock = {
lockFile = ../Cargo.lock;
};
}