libFenrir/flake.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

{
description = "libFenrir";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
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;
};
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
cargo-watch
cargo-license
lld
rust-bin.stable."1.69.0".default
rustfmt
rust-analyzer
];
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
'';
};
}
);
}