39 lines
977 B
Nix
39 lines
977 B
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
pre-commit-hooks = {
|
|
url = "github:cachix/git-hooks.nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{ self
|
|
, nixpkgs
|
|
, flake-utils
|
|
, ...
|
|
}@inputs:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs {
|
|
inherit system;
|
|
};
|
|
# Place all toolchain components in a single directory for IntelliJ
|
|
rust-toolchain = pkgs.symlinkJoin {
|
|
name = "rust-toolchain";
|
|
paths = with pkgs; [
|
|
rustc
|
|
cargo
|
|
rustPlatform.rustcSrc
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
libiconv
|
|
];
|
|
};
|
|
in
|
|
{
|
|
checks = import ./nix/git-hooks.nix { inherit inputs pkgs; };
|
|
devShells = import ./nix/shell.nix { inherit pkgs rust-toolchain self; };
|
|
formatter = pkgs.nixpkgs-fmt;
|
|
});
|
|
}
|