Added shell.nix to create dev environment ()

This commit is contained in:
CEbbinghaus 2025-01-21 20:26:43 +11:00 committed by GitHub
parent c324fa92f5
commit 10f03e19c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 0 deletions

View file

@ -1,2 +1,4 @@
# yale-mistakes were made
/pykanidm/* @yaleman
# Least qualified nix guy :P
shell.nix @cebbinghaus

2
rust-toolchain.toml Normal file
View file

@ -0,0 +1,2 @@
[toolchain]
channel = "stable"

25
shell.nix Normal file
View file

@ -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 ];
}