Skip to content

Commit

Permalink
nixos/aplaz: add rust language support
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Jan 8, 2024
1 parent 58058ee commit 9b1b5e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/configurations/aplaz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
inclyc.gui.enable = true;
inclyc.user.enable = true;
inclyc.user.zsh = true;
inclyc.development.rust.enable = true;

i18n = {
defaultLocale = "C.UTF-8";
Expand Down
1 change: 1 addition & 0 deletions nixos/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
./user.nix
./dae
./sops.nix
./rust.nix
];

home-manager = {
Expand Down
23 changes: 23 additions & 0 deletions nixos/modules/rust.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }:

let
cfg = config.inclyc.development.rust;
in
{
options = {
inclyc.development.rust.enable = lib.mkEnableOption "rust development";
};

config = lib.mkIf cfg.enable {
environment.systemPackages = with pkgs; [
rustc
cargo
rust-analyzer
rustfmt
clippy
];
environment.sessionVariables = {
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
};
}

0 comments on commit 9b1b5e3

Please sign in to comment.