nix setup

This commit is contained in:
Robin Appelman 2026-02-08 20:10:05 +01:00
commit 28ba46ec1a
8 changed files with 301 additions and 1 deletions

31
nix/package.nix Normal file
View file

@ -0,0 +1,31 @@
{
rustPlatform,
lib,
openssl,
pkg-config,
}: let
inherit (lib.sources) sourceByRegex;
inherit (builtins) fromTOML readFile;
src = sourceByRegex ../. ["Cargo.*" "(src)(/.*)?"];
cargoPackage = (fromTOML (readFile ../Cargo.toml)).package;
in
rustPlatform.buildRustPackage {
pname = cargoPackage.name;
inherit (cargoPackage) version;
inherit src;
buildInputs = [
openssl
];
nativeBuildInputs = [
pkg-config
];
cargoLock = {
lockFile = ../Cargo.lock;
};
meta.mainProgram = "cleanup";
}