bok/flake.nix

73 lines
2.1 KiB
Nix
Raw Permalink Normal View History

{
description = "bok";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = flakes@{ self, nixpkgs, nixpkgs-unstable, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
pkgs-unstable = import nixpkgs-unstable {
inherit system overlays;
};
RUST_VERSION="2024-03-24";
in
{
devShells.default = pkgs.mkShell {
name = "bok";
buildInputs = with pkgs; [
# system deps
git
gnupg
openssh
openssl
pkg-config
fd
# rust deps
#(rust-bin.stable.latest.default.override {
# go with nightly to have async fn in traits
#(rust-bin.nightly."2023-02-01".default.override {
# #extensions = [ "rust-src" ];
# #targets = [ "arm-unknown-linux-gnueabihf" ];
#})
clippy
cargo-watch
cargo-flamegraph
cargo-license
cargo-expand
lld
#rust-bin.stable.${RUST_VERSION}.default
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
#rust-bin.nightly.${RUST_VERSION}.default
rustfmt
pkgs-unstable.rust-analyzer
#clang_16
#mold
# fenrir deps
hwloc
];
# if you want to try the mold linker, add 'clang_16', 'mold', and append this to ~/.cargo/config.toml:
# [target.x86_64-unknown-linux-gnu]
# linker = "clang"
# rustflags = ["-C", "link-arg=--ld-path=mold"]
shellHook = ''
# use zsh or other custom shell
USER_SHELL="$(grep $USER /etc/passwd | cut -d ':' -f 7)"
if [ -n "$USER_SHELL" ]; then
exec $USER_SHELL
fi
'';
};
}
);
}