nixos/pkgsets/rustpkgs.nix

60 lines
1.2 KiB
Nix
Raw Normal View History

{ config, ... }:
let
mozRust =
with builtins;
(map (
p:
import (
(fetchTarball {
2023-09-11 20:23:04 +02:00
url = "https://github.com/mozilla/nixpkgs-mozilla/archive/e912ed4.tar.gz";
sha256 = "08fvzb8w80bkkabc1iyhzd15f4sm7ra10jn32kfch5klgl0gj3j3";
})
+ p
)
))
[
(toPath "/lib-overlay.nix")
(toPath "/rust-overlay.nix")
];
stablepkgs = import <nixos-stable> { overlays = mozRust; };
2020-06-12 08:41:24 +02:00
# https://rust-lang.github.io/rustup-components-history
nightly = stablepkgs.rustChannelOf {
date = "2020-06-10";
channel = "nightly";
};
rustNightly = {
2023-09-11 20:23:04 +02:00
rustc =
nightly.rust.override {
extensions = [
"clippy-preview"
"rls-preview"
"rust-analysis"
"rust-src"
"rustfmt-preview"
];
}
// {
src = nightly.rust-src;
};
2023-09-11 21:20:14 +02:00
inherit (nightly) cargo;
2020-06-12 08:41:24 +02:00
};
rustPNightly = stablepkgs.recurseIntoAttrs (
stablepkgs.makeRustPlatform {
inherit (rustNightly) rustc cargo;
}
);
in
{
2023-09-11 20:23:04 +02:00
config.machine.pkgsets.rustpkgs.pkgs =
(with stablepkgs; [
diesel-cli
carnix
rustracer
])
++ (with rustNightly; [
rustc
cargo
]);
}