nix
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
This commit is contained in:
parent
c65ae95b43
commit
d7b7a72444
14 changed files with 2641 additions and 229 deletions
26
nix/devshell.nix
Normal file
26
nix/devshell.nix
Normal 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
|
||||
];
|
||||
}
|
9
nix/packages/vault-hier.nix
Normal file
9
nix/packages/vault-hier.nix
Normal 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
13
nix/rust-setup.nix
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue