From 733e41fe0a7fd5315d4434c91cc5ddd31c7aa4e8 Mon Sep 17 00:00:00 2001 From: Alexander Heldt Date: Sat, 28 Oct 2023 15:30:47 +0200 Subject: [PATCH] pinwheel: Add `rust` module --- hosts/pinwheel/configuration.nix | 1 + hosts/pinwheel/modules/rust/default.nix | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 hosts/pinwheel/modules/rust/default.nix diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index f1e69ca..981ad5d 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -86,6 +86,7 @@ git.enable = true; openvpn.enable = true; go.enable = true; + rust.enable = true; keyboard.enable = true; docker.enable = true; podman.enable = false; diff --git a/hosts/pinwheel/modules/rust/default.nix b/hosts/pinwheel/modules/rust/default.nix new file mode 100644 index 0000000..befa30b --- /dev/null +++ b/hosts/pinwheel/modules/rust/default.nix @@ -0,0 +1,23 @@ +{ pkgs, lib, config, ... }: +let + enabled = config.mod.rust.enable; +in +{ + options = { + mod.rust = { + enable = lib.mkEnableOption "enable rust module"; + }; + }; + + config = lib.mkIf enabled { + home-manager.users.alex = { + home.packages = [ + pkgs.rustc + pkgs.cargo + pkgs.rustfmt + pkgs.clippy + pkgs.rust-analyzer + ]; + }; + }; +}