forked from GitHub/bdwgc-rust
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
};
|
|
|
|
outputs = { self, nixpkgs, fenix, ... }:
|
|
let
|
|
supportedSystems = [
|
|
"aarch64-darwin" "aarch64-linux"
|
|
"x86_64-darwin" "x86_64-linux"
|
|
];
|
|
|
|
each-system = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec {
|
|
pkgs = import nixpkgs {
|
|
inherit system overlays;
|
|
};
|
|
inherit (pkgs) lib;
|
|
inherit system;
|
|
});
|
|
|
|
overlays = [
|
|
fenix.overlays.default
|
|
];
|
|
|
|
in {
|
|
_pkgs = each-system ({ pkgs, ... }: pkgs);
|
|
|
|
devShells = each-system ({ pkgs, lib, ... }: {
|
|
default = pkgs.mkShell {
|
|
packages = [
|
|
pkgs.pkg-config
|
|
(pkgs.fenix.complete.withComponents [
|
|
"cargo" "clippy" "rust-src" "rustc" "rustfmt"
|
|
])
|
|
pkgs.rust-analyzer-nightly
|
|
pkgs.cmake
|
|
];
|
|
};
|
|
});
|
|
};
|
|
|
|
nixConfig = {
|
|
extra-substituters = [
|
|
"https://fenix.cachix.org"
|
|
];
|
|
extra-trusted-public-keys = [
|
|
"fenix.cachix.org-1:ecJhr+RdYEdcVgUkjruiYhjbBloIEGov7bos90cZi0Q="
|
|
];
|
|
};
|
|
}
|