1
0
Fork 0
mirror of https://gitlab.com/hagrid-keyserver/hagrid.git synced 2023-02-13 20:55:02 -05:00

nix: update shell.nix

This commit is contained in:
Vincent Breitmoser 2022-01-04 12:07:43 +01:00
parent 9d5ec287a9
commit 3aa26c10f3
2 changed files with 21 additions and 17 deletions

1
.envrc
View file

@ -1 +1,2 @@
watch_file rust-toolchain
use nix

View file

@ -1,21 +1,23 @@
with import <nixpkgs> {};
let
src = fetchFromGitHub {
owner = "mozilla";
repo = "nixpkgs-mozilla";
# commit from: 2019-07-15
rev = "8c007b60731c07dd7a052cce508de3bb1ae849b4";
sha256 = "sha256-RsNPnEKd7BcogwkqhaV5kI/HuNC4flH/OQCC/4W5y/8=";
};
rustOverlay = import "${src.out}/rust-overlay.nix" pkgs pkgs;
rustChannel = (rustOverlay.rustChannelOf { rustToolchain = ./rust-toolchain; });
oxalica_overlay = import (builtins.fetchTarball
"https://github.com/oxalica/rust-overlay/archive/master.tar.gz");
pkgs = import <nixpkgs> { overlays = [ oxalica_overlay ]; };
rust_channel = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain;
#rust_channel = pkgs.rust-bin.stable.latest.default;
in
stdenv.mkDerivation {
name = "rust-env";
buildInputs = [
rustChannel.rust
# latest.rustChannels.nightly.rust
# latest.rustChannels.stable.rust
pkgs.mkShell {
nativeBuildInputs = [
(rust_channel.override {
extensions = [ "rust-src" "rust-std" "clippy" ];
targets = [
"x86_64-unknown-linux-gnu"
];
})
];
buildInputs = with pkgs; [
openssl
clang
nettle
@ -30,6 +32,7 @@ stdenv.mkDerivation {
# compilation of -sys packages requires manually setting this :(
shellHook = ''
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang}/lib";
export LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
'';
}