Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
Harald Hoyer 2025-03-24 09:46:21 +01:00
parent c65ae95b43
commit d7b7a72444
14 changed files with 2641 additions and 229 deletions

26
nix/devshell.nix Normal file
View file

@ -0,0 +1,26 @@
{
pkgs,
vault-hier,
rustVersion,
}:
let
toolchain_with_src = (
rustVersion.override {
extensions = [
"rustfmt"
"clippy"
"rust-src"
];
}
);
in
pkgs.mkShell {
packages = with pkgs; [
vault-hier # Add the vault-hier package to the dev shell
toolchain_with_src # Add the custom Rust toolchain with source code to the dev shell
];
nativeBuildInputs = [
vault-hier
];
}

View file

@ -0,0 +1,9 @@
{ pkgs
, craneLib
, individualCrateArgs
,
}:
craneLib.buildPackage (individualCrateArgs // {
pname = "vault-hier";
cargoExtraArgs = "-p vault-hier";
})

13
nix/rust-setup.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, crane }:
let
rustVersion = pkgs.rust-bin.fromRustupToolchainFile (../rust-toolchain.toml);
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
craneLib = (crane.mkLib pkgs).overrideToolchain rustVersion;
in
{
inherit rustVersion rustPlatform craneLib;
}