flake reorg

This commit is contained in:
Robin Appelman 2024-12-21 14:54:00 +01:00
commit 9802f5c405
13 changed files with 131 additions and 397 deletions

34
nix/package.nix Normal file
View file

@ -0,0 +1,34 @@
{ stdenv
, rustPlatform
, libsodium
, pkg-config
, lib
, rust-bin
,
}:
let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. [ "Cargo.*" "(src)(/.*)?" ];
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
in
rustPlatform.buildRustPackage rec {
pname = cargoPackage.name;
inherit (cargoPackage) version;
inherit src;
buildInputs = [
libsodium
];
nativeBuildInputs = [
pkg-config
];
doCheck = false;
cargoLock = {
lockFile = ../Cargo.lock;
};
}