drv/rust: initial version
This commit is contained in:
parent
f75920ce70
commit
6f4f1a53bf
1 changed files with 19 additions and 0 deletions
19
derivations/dev/rust.nix
Normal file
19
derivations/dev/rust.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs {},
|
||||||
|
name ? "generic",
|
||||||
|
version,
|
||||||
|
extraBuildInputs ? [] }:
|
||||||
|
let
|
||||||
|
rustPackages = builtins.getAttr "rust${version}" pkgs;
|
||||||
|
rustBuildInputs = { rustPackages }: [
|
||||||
|
rustPackages.rustc
|
||||||
|
];
|
||||||
|
rustShellHook = { rustPackages, name }: ''
|
||||||
|
setPS1 rust${version}
|
||||||
|
unset name
|
||||||
|
'';
|
||||||
|
in pkgs.stdenv.mkDerivation {
|
||||||
|
inherit name;
|
||||||
|
buildInputs = extraBuildInputs ++ (rustBuildInputs){ inherit rustPackages; };
|
||||||
|
shellHook = (rustShellHook) { inherit name; inherit rustPackages; };
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue