python/pdm: hide groups as implementation detail

The most important feature of the groups module was the overriding which is a separate module now. Therefore removing the fact that groups are used from the docs to decrease the API surface to maintain.

Instead render the override and overrideAll options in the manual of pdm correctly by setting `overrideType`.
This commit is contained in:
DavHau 2024-03-17 22:46:12 +07:00 committed by mergify[bot]
parent 41a1973ed3
commit 6bbac51494
4 changed files with 38 additions and 24 deletions

View File

@ -0,0 +1,24 @@
{
config,
lib,
specialArgs,
...
}: let
t = lib.types;
groupType = t.submoduleWith {
modules = [
(import ./group.nix {
inherit (config) overrideAll;
overrides = config.overrides;
})
];
inherit specialArgs;
};
in
lib.mkOption {
type = t.lazyAttrsOf groupType;
description = ''
Holds multiple package sets (eg. groups).
Holds shared config (overrideAll) and overrides on a global and on a per group basis.
'';
}

View File

@ -1,28 +1,10 @@
{
config,
lib,
dream2nix,
specialArgs,
...
}: let
t = lib.types;
groupType = t.submoduleWith {
modules = [
(import ./group.nix {
inherit (config) overrideAll;
overrides = config.overrides;
})
];
inherit specialArgs;
};
in {
options = {
groups = lib.mkOption {
type = t.lazyAttrsOf groupType;
description = ''
Holds multiple package sets (eg. groups).
Holds shared config (overrideAll) and overrides on a global and on a per group basis.
'';
};
}: {
options.groups = import ./groups-option.nix {
inherit config lib specialArgs;
};
}

View File

@ -56,9 +56,9 @@
};
in {
imports = [
dream2nix.modules.dream2nix.WIP-groups
dream2nix.modules.dream2nix.buildPythonPackage
../core/deps
../overrides
./interface.nix
./lock.nix
commonModule
@ -86,8 +86,10 @@ in {
;
python = lib.mkDefault config.deps.python3;
};
overrideAll = {
overrideType = {
imports = [commonModule];
};
overrideAll = {
deps = {nixpkgs, ...}: {
python = lib.mkDefault config.deps.python;
};

View File

@ -1,7 +1,7 @@
{
config,
lib,
dream2nix,
specialArgs,
...
}: let
l = lib // builtins;
@ -17,4 +17,10 @@ in {
sourceSelector = import ./sourceSelectorOption.nix {inherit lib;};
};
options.groups =
(import ../WIP-groups/groups-option.nix {inherit config lib specialArgs;})
// {
internal = true;
visible = "shallow";
};
}