nixos/pkgsets/rustpkgs.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2023-09-11 20:23:04 +02:00
{config, ...}: let
mozRust = with builtins;
(map (p:
import ((fetchTarball {
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
};
2023-09-11 20:23:04 +02:00
rustPNightly = stablepkgs.recurseIntoAttrs (stablepkgs.makeRustPlatform {
2020-06-12 08:41:24 +02:00
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]);
}