generic/rust: init

This commit is contained in:
2024-12-05 13:24:10 +01:00
parent 20e2cc98a4
commit 5a65f05338
3 changed files with 152 additions and 0 deletions

35
flake.nix Normal file
View 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"; };
});
};
}