From 2202f2bae87edf4a89e6203b3e226ebe64b2fe51 Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Sat, 22 Feb 2025 00:09:19 +0000 Subject: [PATCH] Add rust Signed-off-by: Nikolaos Karaolidis --- flake.lock | 24 +++++++++---------- flake.nix | 1 + .../user/console/nix-develop/treefmt.nix | 4 +--- .../user/gui/vscode/langs/rust/default.nix | 9 +++++++ .../configs/user/gui/vscode/options.nix | 2 ++ hosts/common/shells/rust/default.nix | 8 +++++++ .../users/nick/configs/gui/vscode/default.nix | 1 + .../nikara/configs/gui/vscode/default.nix | 1 + submodules/home-manager | 2 +- submodules/nixpkgs | 2 +- 10 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 hosts/common/configs/user/gui/vscode/langs/rust/default.nix create mode 100644 hosts/common/shells/rust/default.nix diff --git a/flake.lock b/flake.lock index 8e5eb29..6faf619 100644 --- a/flake.lock +++ b/flake.lock @@ -31,11 +31,11 @@ ] }, "locked": { - "lastModified": 1739787548, - "narHash": "sha256-Gt4yc0nM4l63NIBgSznxriZQtrE1Xk6NlZauGiMmJ/4=", + "lastModified": 1739969582, + "narHash": "sha256-ni6tM12mzArohqzvscZn/N52GHiXZsskN6yMYzo25XI=", "owner": "aylur", "repo": "astal", - "rev": "cbfe69a9c22f3b0e59c6e09fffbe0b7af4f543d1", + "rev": "a0de1526d2de8a02feec1cba4086f284ec9f6098", "type": "github" }, "original": { @@ -115,11 +115,11 @@ ] }, "locked": { - "lastModified": 1739877460, - "narHash": "sha256-0R74c61IDiLAi5xaAF4xUXHS5eQwYteJDGRIDU/L4sM=", + "lastModified": 1740068813, + "narHash": "sha256-8GRcU5uERvZDT/XNyI73ozHSBLrEmCdC0zgEY+Jff2s=", "owner": "karaolidis", "repo": "home-manager", - "rev": "3cf2f577ce131fca013dd4d94dca3639561a72b4", + "rev": "4d6357dad7350b01339955acb690c57026eacee2", "type": "github" }, "original": { @@ -131,11 +131,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739870578, - "narHash": "sha256-qyqT2uWe3RgUivggVZavLRVybJzCUzYpYFiwnVl1xlo=", + "lastModified": 1740070152, + "narHash": "sha256-sTFYmNhrBogFEAQ0DnpDMR+aZ+7cjV2XamgPIaqO3kI=", "owner": "karaolidis", "repo": "nixpkgs", - "rev": "e218d9413c9e4d6ebbd0a887daaadb34c4309311", + "rev": "6abb8f6d73fe6b7e9870f0ccc11a96958590b645", "type": "github" }, "original": { @@ -156,11 +156,11 @@ ] }, "locked": { - "lastModified": 1739868628, - "narHash": "sha256-+EZ2ISNFFnTQvY11irgaIidxcXDrQdBoyr/AyxU3yi0=", + "lastModified": 1740062783, + "narHash": "sha256-t+SH36EoF9vj/bTiqp71upfy0vdQgSM6WhtThiLBCxs=", "owner": "nix-community", "repo": "NUR", - "rev": "dfbf53ec75e21fa05e1635ebee68eab14af3abe2", + "rev": "86b71ef14fff48d7c19097bfee104ddc72a977a9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a6e156c..36f113f 100644 --- a/flake.nix +++ b/flake.nix @@ -175,6 +175,7 @@ nix = import ./hosts/common/shells/nix { inherit pkgs; }; nodejs = import ./hosts/common/shells/nodejs { inherit pkgs; }; python = import ./hosts/common/shells/python { inherit pkgs; }; + rust = import ./hosts/common/shells/rust { inherit pkgs; }; }; formatter = treefmt.config.build.wrapper; diff --git a/hosts/common/configs/user/console/nix-develop/treefmt.nix b/hosts/common/configs/user/console/nix-develop/treefmt.nix index 2819e9f..5a60284 100644 --- a/hosts/common/configs/user/console/nix-develop/treefmt.nix +++ b/hosts/common/configs/user/console/nix-develop/treefmt.nix @@ -11,9 +11,7 @@ settings = { global = { - excludes = [ - ".envrc" - ]; + excludes = [ ".envrc" ]; }; }; } diff --git a/hosts/common/configs/user/gui/vscode/langs/rust/default.nix b/hosts/common/configs/user/gui/vscode/langs/rust/default.nix new file mode 100644 index 0000000..2cec24f --- /dev/null +++ b/hosts/common/configs/user/gui/vscode/langs/rust/default.nix @@ -0,0 +1,9 @@ +{ + config, + lib, + pkgs, + ... +}: +lib.mkIf config.programs.vscode.languages.python.enable { + programs.vscode.extensions = with pkgs.vscode-extensions; [ rust-lang.rust-analyzer ]; +} diff --git a/hosts/common/configs/user/gui/vscode/options.nix b/hosts/common/configs/user/gui/vscode/options.nix index e538cfe..386269c 100644 --- a/hosts/common/configs/user/gui/vscode/options.nix +++ b/hosts/common/configs/user/gui/vscode/options.nix @@ -20,6 +20,7 @@ in nix.enable = mkEnableOption "Nix"; python.enable = mkEnableOption "Python"; rest.enable = mkEnableOption "REST"; + rust.enable = mkEnableOption "Rust"; sas.enable = mkEnableOption "SAS"; sops.enable = mkEnableOption "SOPS"; svelte.enable = mkEnableOption "Svelte"; @@ -41,6 +42,7 @@ in ./langs/nix ./langs/python ./langs/rest + ./langs/rust ./langs/sas ./langs/sops ./langs/svelte diff --git a/hosts/common/shells/rust/default.nix b/hosts/common/shells/rust/default.nix new file mode 100644 index 0000000..be59be2 --- /dev/null +++ b/hosts/common/shells/rust/default.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: +pkgs.mkShell { + packages = with pkgs; [ + cargo + rustc + rustfmt + ]; +} diff --git a/hosts/eirene/users/nick/configs/gui/vscode/default.nix b/hosts/eirene/users/nick/configs/gui/vscode/default.nix index 5ccbc9c..c825a8d 100644 --- a/hosts/eirene/users/nick/configs/gui/vscode/default.nix +++ b/hosts/eirene/users/nick/configs/gui/vscode/default.nix @@ -13,6 +13,7 @@ nix.enable = true; python.enable = true; rest.enable = true; + rust.enable = true; sops.enable = true; typescript.enable = true; yaml.enable = true; diff --git a/hosts/elara/users/nikara/configs/gui/vscode/default.nix b/hosts/elara/users/nikara/configs/gui/vscode/default.nix index 33a9aa5..3100b5c 100644 --- a/hosts/elara/users/nikara/configs/gui/vscode/default.nix +++ b/hosts/elara/users/nikara/configs/gui/vscode/default.nix @@ -17,6 +17,7 @@ nix.enable = true; python.enable = true; rest.enable = true; + rust.enable = true; sas.enable = true; sops.enable = true; typescript.enable = true; diff --git a/submodules/home-manager b/submodules/home-manager index 3cf2f57..4d6357d 160000 --- a/submodules/home-manager +++ b/submodules/home-manager @@ -1 +1 @@ -Subproject commit 3cf2f577ce131fca013dd4d94dca3639561a72b4 +Subproject commit 4d6357dad7350b01339955acb690c57026eacee2 diff --git a/submodules/nixpkgs b/submodules/nixpkgs index e218d94..6abb8f6 160000 --- a/submodules/nixpkgs +++ b/submodules/nixpkgs @@ -1 +1 @@ -Subproject commit e218d9413c9e4d6ebbd0a887daaadb34c4309311 +Subproject commit 6abb8f6d73fe6b7e9870f0ccc11a96958590b645