mirror of
https://github.com/RGBCube/ncc
synced 2025-07-30 11:37:44 +00:00
Packages: Add rust
This commit is contained in:
parent
1ad15ac013
commit
541767ff37
4 changed files with 67 additions and 9 deletions
39
flake.lock
generated
39
flake.lock
generated
|
@ -1,5 +1,26 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1683354017,
|
||||||
|
"narHash": "sha256-r0BrHDaljUKyQS5FgA4P9xgK+dGa8L0XDL0vBdriEM8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"rev": "65fdcbdc0bf35510a013d8a0883b0fa7a4ecd2a8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -38,9 +59,27 @@
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"fenix": "fenix",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1683321754,
|
||||||
|
"narHash": "sha256-qvyrgObeXw+h+P0VAvaARjRUWn5Ey1ckbs+1El2dc0Y=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "a4966c92829f945d3846eb0ca0e240ac7f7c8c60",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
15
flake.nix
15
flake.nix
|
@ -17,13 +17,20 @@
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
fenix = {
|
||||||
|
url = "github:nix-community/fenix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
home-manager,
|
home-manager,
|
||||||
|
fenix,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
importConfiguration = directory:
|
importConfiguration = directory:
|
||||||
|
|
||||||
|
@ -33,7 +40,6 @@
|
||||||
hostName = builtins.baseNameOf directory;
|
hostName = builtins.baseNameOf directory;
|
||||||
userName = import (directory + "/username.nix");
|
userName = import (directory + "/username.nix");
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.${hostName} = nixpkgs.lib.nixosSystem {
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
@ -48,16 +54,21 @@
|
||||||
homeManagerConfiguration = attrs: {
|
homeManagerConfiguration = attrs: {
|
||||||
home-manager.users.${userName} = attrs;
|
home-manager.users.${userName} = attrs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inherit fenix;
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
directory
|
directory
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
|
|
||||||
# Extra configuration derived from the metadata.
|
|
||||||
{
|
{
|
||||||
networking.hostName = builtins.baseNameOf directory;
|
networking.hostName = builtins.baseNameOf directory;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = hostPlatform;
|
nixpkgs.hostPlatform = hostPlatform;
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
fenix.overlays.default
|
||||||
|
];
|
||||||
|
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.useUserPackages = true;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... } @ args:
|
{ pkgs, fenix, ... } @ args:
|
||||||
|
|
||||||
{
|
{
|
||||||
environment.systemPackages = import ./packages.nix args;
|
environment.systemPackages = import ./packages.nix args;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, ... }: with pkgs; []
|
{ pkgs, fenix, ... }: with pkgs; []
|
||||||
|
|
||||||
++ [ # APPLICATIONS
|
++ [ # APPLICATIONS
|
||||||
firefox
|
firefox
|
||||||
|
@ -53,6 +53,14 @@
|
||||||
poetry
|
poetry
|
||||||
]
|
]
|
||||||
|
|
||||||
|
++ [ (fenix.complete.withComponents [ # RUST
|
||||||
|
"rustc"
|
||||||
|
"rust-src"
|
||||||
|
"cargo"
|
||||||
|
"rustfmt"
|
||||||
|
"clippy"
|
||||||
|
]) ]
|
||||||
|
|
||||||
++ [ # SHELLS
|
++ [ # SHELLS
|
||||||
# nushell # Declared in nushell/.
|
# nushell # Declared in nushell/.
|
||||||
starship
|
starship
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue