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

View file

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

View file

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