forked from GitHub/bdwgc-rust
been writing rust for like ten minutes and i'm already dealing with this shit
This commit is contained in:
54
flake.nix
Normal file
54
flake.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
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="
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user