2024-02-16 09:51:56 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
};
|
2024-03-24 21:32:49 +00:00
|
|
|
RUST_VERSION="2024-03-24";
|
2024-02-16 09:51:56 +00:00
|
|
|
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
|
2024-02-25 13:33:08 +00:00
|
|
|
cargo-expand
|
2024-02-16 09:51:56 +00:00
|
|
|
lld
|
2024-03-24 21:32:49 +00:00
|
|
|
#rust-bin.stable.${RUST_VERSION}.default
|
|
|
|
(rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
|
|
|
|
#rust-bin.nightly.${RUST_VERSION}.default
|
2024-02-16 09:51:56 +00:00
|
|
|
rustfmt
|
2024-02-25 13:33:08 +00:00
|
|
|
pkgs-unstable.rust-analyzer
|
2024-02-16 09:51:56 +00:00
|
|
|
#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
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|