Add rust overlay

Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
Ivan Bushchik 2023-12-24 08:49:44 +03:00
parent 9017e9e97d
commit 159b40598a
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C
3 changed files with 19 additions and 10 deletions

View file

@ -12,28 +12,29 @@
apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon";
#nixos-vf2 = { url = "path:/root/nixos-vf2"; };
#nixos-vf2 = { url = "github:Snektron/nixos-vf2"; };
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, home-manager, nix-darwin, apple-silicon-support
# , nixos-vf2
outputs = { self, nixpkgs, home-manager, rust-overlay, apple-silicon-support
, ... }@inputs: {
# Stella = Unchartevice 6540 (Ryzen 3 3250U, 16GB RAM)
nixosConfigurations."stella" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [ home-manager.nixosModules.home-manager ./machines/stella ];
};
# Vetus = iMac 27" 2017, i5, 64 GB RAM
nixosConfigurations."vetus" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = inputs;
modules = [ home-manager.nixosModules.home-manager ./machines/vetus ];
};
# Celerrime = MacBook Air M2
nixosConfigurations."celerrime" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = inputs;
modules = [
home-manager.nixosModules.home-manager
apple-silicon-support.nixosModules.apple-silicon-support
@ -44,12 +45,14 @@
# cursor = vm for "running" linux programs on aarch64
nixosConfigurations."cursor" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = inputs;
modules = [ home-manager.nixosModules.home-manager ./machines/cursor ];
};
# Raspberry Pi 4B 2GB RAM
nixosConfigurations."rubusidaeus" = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = inputs;
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
home-manager.nixosModules.home-manager

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, rust-overlay, ... }:
let my = import ../..;
in {
@ -18,7 +18,7 @@ in {
devel.enable = true;
gaming.enable = false;
graphical.enable = true;
latex.enable = true;
latex.enable = false;
media-client.enable = true;
torrent.enable = true;
virtualisation.enable = false;

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, rust-overlay, ... }:
let cfg = config.my.roles.devel;
in {
@ -7,10 +7,16 @@ in {
config = lib.mkIf (cfg.enable) (lib.mkMerge [
{
nixpkgs.config.allowUnfree = true;
nixpkgs.overlays = [ rust-overlay.overlays.default ];
environment.systemPackages = with pkgs; [
rustc
cargo
rustup
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [
pkgs.stdenv.hostPlatform.config
"x86_64-unknown-linux-musl"
"aarch64-unknown-linux-musl"
];
})
clang
llvm
lld