generic/rust: init
This commit is contained in:
35
flake.nix
Normal file
35
flake.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, rust-overlay }: let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
"armv7l-linux"
|
||||
];
|
||||
|
||||
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
(import rust-overlay)
|
||||
];
|
||||
};
|
||||
|
||||
in f system pkgs);
|
||||
|
||||
inherit (nixpkgs) lib;
|
||||
in {
|
||||
devShells = forAllSystems (system: pkgs: {
|
||||
rust = pkgs.callPackage ./generic/rust/shell.nix { };
|
||||
rust-nightly = pkgs.callPackage ./generic/rust/shell.nix { rust-channel = "nightly"; };
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user