Add rust toolchain

This commit is contained in:
Riley Apeldoorn 2023-06-19 22:14:22 +02:00
parent 2083556fad
commit c69e5c07be
5 changed files with 95 additions and 6 deletions

View File

@ -43,6 +43,24 @@
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
@ -175,9 +193,44 @@
"type": "github"
}
},
"pwnix": {
"nixpkgs_4": {
"locked": {
"lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"oxalica": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1687141659,
"narHash": "sha256-ckvEuxejYmFTyFF0u9CWV8h5u+ubuxA7vYrOw/GXRXg=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "86302751ef371597d48951983e1a2f04fe78d4ff",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"pwnix": {
"inputs": {
"flake-utils": "flake-utils_2",
"jwt-tool": "jwt-tool",
"nixpkgs": [
"nixpkgs"
@ -220,8 +273,24 @@
"home-manager": "home-manager_2",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs_3",
"oxalica": "oxalica",
"pwnix": "pwnix"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -9,9 +9,10 @@
};
agenix.url = github:ryantm/agenix;
nixos-hardware.url = github:NixOS/nixos-hardware;
oxalica.url = github:oxalica/rust-overlay;
};
outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, ... }: with nixpkgs; {
outputs = args@{ home-manager, nixpkgs, agenix, nixos-hardware, oxalica, ... }: with nixpkgs; {
# Configurations for NixOS machines.
nixosConfigurations =
@ -19,6 +20,8 @@
imports = [ home-manager.nixosModules.home-manager ];
config = {
home-manager.users."riley" = (import "${path}/home.nix");
home-manager.extraSpecialArgs = args;
home-manager.useGlobalPkgs = true;
};
};
in {
@ -42,8 +45,6 @@
modules = [
(mkUserConfig ./system/lime)
agenix.nixosModules.default
nixos-hardware.nixosModules.lenovo-thinkpad-x390
nixos-hardware.nixosModules.common-gpu-nvidia-disable
./system/lime/core.nix
./shared/core
./shared/secrets.nix

View File

@ -4,6 +4,7 @@
imports = [
./bash.nix
./rust.nix
./git.nix
./mpd.nix
./xdg.nix

14
shared/home/rust.nix Normal file
View File

@ -0,0 +1,14 @@
{ oxalica, nixpkgs, ... }: {
home.packages = let
pkgs = import nixpkgs { overlays = [ oxalica.overlays.default ]; };
# We want an up-to-date nightly but also we need there to be stdlib and stuff
rust = pkgs.rust-bin.selectLatestNightlyWith (tc: tc.default.override {
extensions = [ "rust-src" ];
});
in [
rust
pkgs.rust-analyzer
];
}

View File

@ -1,6 +1,10 @@
{ lib, modulesPath, ... }: {
{ lib, nixos-hardware, ... }: {
imports = [./hardware-configuration.nix];
imports = [
nixos-hardware.nixosModules.lenovo-thinkpad-x390
nixos-hardware.nixosModules.common-gpu-nvidia-disable
./hardware-configuration.nix
];
custom = {
gui.enable = true;