libFenrir/flake.nix

51 lines
1.4 KiB
Nix

{
description = "libFenrir";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.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;
};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
git
gnupg
openssh
openssl
pkg-config
exa
fd
#(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
lld
cargo-watch
rustfmt
];
shellHook = ''
# use zsh or other custom shell
USER_SHELL="$(grep $USER /etc/passwd | cut -d ':' -f 7)"
if [ -n "$USER_SHELL" ] && [ "$USER_SHELL" != "$SHELL" ]; then
exec $USER_SHELL
fi
'';
};
}
);
}