cargo: add package option

This commit is contained in:
N4CH723HR3R 2026-01-26 16:03:34 +01:00 committed by Robert Helgesson
parent bd9f031efc
commit fdafcac367

View file

@ -5,10 +5,7 @@
...
}:
let
inherit (lib) mkEnableOption;
tomlFormat = pkgs.formats.toml { };
cfg = config.programs.cargo;
in
{
@ -17,7 +14,9 @@ in
options = {
programs = {
cargo = {
enable = mkEnableOption "management of cargo config";
enable = lib.mkEnableOption "management of cargo config";
package = lib.mkPackageOption pkgs "cargo" { nullable = true; };
settings = lib.mkOption {
inherit (tomlFormat) type;
@ -33,6 +32,8 @@ in
config = lib.mkIf cfg.enable {
home = {
packages = lib.mkIf (cfg.package != null) [ cfg.package ];
file = {
".cargo/config.toml" = {
source = tomlFormat.generate "config.toml" cfg.settings;