diff --git a/home/default.nix b/home/default.nix index ddeabbc..c167090 100644 --- a/home/default.nix +++ b/home/default.nix @@ -82,7 +82,7 @@ in pkgs.sshfs pkgs.gitoxide pkgs.xplr - ] ++ lib.optional devcfg.rust.enable pkgs.rustup; + ] ++ devcfg.extraPackages ++ lib.optionals devcfg.rust.enable ([ pkgs.rustup ] ++ devcfg.rust.extraPackages); # Extra variables home.sessionVariables.CARGO_HOME = "${config.xdg.dataHome}/cargo"; diff --git a/home/options.nix b/home/options.nix index f0a5ca4..e1460b5 100644 --- a/home/options.nix +++ b/home/options.nix @@ -1,7 +1,14 @@ -{ lib, ... }: +{ lib, pkgs, ... }: let inherit (lib) types; + mkExtraPackagesOption = name: default: lib.mkOption { + description = "Extra ${name} Packages."; + type = types.listOf types.package; + inherit default; + example = [ ]; + }; + identity.options = { email = lib.mkOption { description = "Primary email adderss"; @@ -117,11 +124,13 @@ in description = lib.mdDoc "Setup development environment for programming languages."; default = { }; type = types.submodule { + options.extraPackages = mkExtraPackagesOption "dev" [ pkgs.typos pkgs.just ]; options.rust = lib.mkOption { description = "Jalil's default rust configuration."; default = { }; type = types.submodule { options.enable = lib.mkEnableOption "rust dev environment"; + options.extraPackages = mkExtraPackagesOption "Rust" [ pkgs.cargo-nextest pkgs.cargo-sort pkgs.cargo-msrv pkgs.cargo-kcov pkgs.cargo-watch ]; }; }; }; diff --git a/nixos/default.nix b/nixos/default.nix index ae1ee09..e5e6b12 100644 --- a/nixos/default.nix +++ b/nixos/default.nix @@ -20,7 +20,6 @@ in environment.systemPackages = [ # Dev tools pkgs.gcc - pkgs.just pkgs.clang # CLI tools pkgs.fd