diff --git a/CODEOWNERS b/CODEOWNERS index f6e57524b..fccf9d157 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,4 @@ # yale-mistakes were made /pykanidm/* @yaleman +# Least qualified nix guy :P +shell.nix @cebbinghaus diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 000000000..31578d3bf --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "stable" \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..2f07072c3 --- /dev/null +++ b/shell.nix @@ -0,0 +1,25 @@ +{ pkgs ? import <nixpkgs> {} }: + let + overrides = (builtins.fromTOML (builtins.readFile ./rust-toolchain.toml)); +in +pkgs.mkShellNoCC rec { + # Kanidm dependencies + buildInputs = with pkgs; [ + pkg-config + + cargo + rustc + + clang + llvmPackages.bintools + + openssl + ] ++ pkgs.lib.optionals (pkgs.stdenv.isLinux) [ + systemd + linux-pam + ]; + + RUSTC_VERSION = overrides.toolchain.channel; + # https://github.com/rust-lang/rust-bindgen#environment-variables + LIBCLANG_PATH = pkgs.lib.makeLibraryPath [ pkgs.llvmPackages_latest.libclang.lib ]; +} \ No newline at end of file