2023-11-25 05:05:29 +03:00
|
|
|
{
|
|
|
|
inputs = {
|
2023-11-27 18:55:01 +03:00
|
|
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
2023-11-25 05:05:29 +03:00
|
|
|
fenix = {
|
|
|
|
url = "github:nix-community/fenix";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-11-27 18:55:01 +03:00
|
|
|
flake-utils.url = "flake-utils";
|
2023-11-25 05:05:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = {self, fenix, flake-utils, nixpkgs}:
|
2023-11-27 18:55:01 +03:00
|
|
|
let
|
|
|
|
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"];
|
|
|
|
in flake-utils.lib.eachSystem supportedSystems (system:
|
|
|
|
let
|
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [(import ./nix/overlay.nix)];
|
|
|
|
};
|
|
|
|
parsedSystem = pkgs.lib.systems.parse.mkSystemFromString system;
|
|
|
|
in {
|
|
|
|
devShells.default = pkgs.mkShell {
|
2023-11-25 05:05:29 +03:00
|
|
|
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
|
|
|
|
buildInputs = [
|
|
|
|
(fenix.packages.${system}.complete.withComponents [
|
|
|
|
"cargo"
|
|
|
|
"clippy"
|
|
|
|
"rustc"
|
|
|
|
"rustfmt"
|
|
|
|
"rust-src"
|
|
|
|
])
|
2023-12-07 08:08:47 +03:00
|
|
|
pkgs.bacon
|
2023-11-25 05:05:29 +03:00
|
|
|
pkgs.iconv
|
|
|
|
pkgs.llvmPackages.clang
|
2023-11-28 02:06:59 +03:00
|
|
|
pkgs.pkg-config
|
|
|
|
pkgs.urcrypt
|
2023-11-25 05:05:29 +03:00
|
|
|
] ++
|
2024-02-09 02:07:27 +03:00
|
|
|
(nixpkgs.lib.lists.optional (parsedSystem.kernel.name != "darwin") pkgs.gdb) # nixpkgs won't build gdb for darwin
|
|
|
|
++
|
2024-02-09 02:21:47 +03:00
|
|
|
(nixpkgs.lib.lists.optional (parsedSystem.kernel.name != "darwin" || parsedSystem.cpu.name != "x86_64") pkgs.cargo-watch); # nixpkgs won't build cargo-watch for darwin-x86
|
2023-11-25 05:05:29 +03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|