mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
modules/dependencies: coerce __depPackages
attr-paths to list
This commit is contained in:
parent
1164b39963
commit
fb80e0d0b5
1 changed files with 9 additions and 7 deletions
|
@ -21,13 +21,15 @@ let
|
||||||
if properties.example._type or null == "literalExpression" then
|
if properties.example._type or null == "literalExpression" then
|
||||||
properties.example
|
properties.example
|
||||||
else
|
else
|
||||||
rec {
|
{
|
||||||
_type = "literalExpression";
|
_type = "literalExpression";
|
||||||
text = "pkgs.${lib.showAttrPath path}";
|
text = "pkgs.${lib.showAttrPath properties.example}";
|
||||||
path = lib.toList properties.example;
|
path = properties.example;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
attrPathType = with types; coercedTo str lib.toList (listOf str);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
@ -36,17 +38,17 @@ in
|
||||||
types.submodule {
|
types.submodule {
|
||||||
options = {
|
options = {
|
||||||
default = lib.mkOption {
|
default = lib.mkOption {
|
||||||
type = with types; either str (listOf str);
|
type = attrPathType;
|
||||||
description = ''
|
description = ''
|
||||||
Default name (or path) for this package.
|
Attribute path for this dependency's default package, relative to `pkgs`.
|
||||||
'';
|
'';
|
||||||
example = "git";
|
example = "git";
|
||||||
};
|
};
|
||||||
|
|
||||||
example = lib.mkOption {
|
example = lib.mkOption {
|
||||||
type = with types; nullOr str;
|
type = types.nullOr attrPathType;
|
||||||
description = ''
|
description = ''
|
||||||
Example of another package to use instead of the default.
|
Attribute path for an alternative package that provides dependency, relative to `pkgs`.
|
||||||
'';
|
'';
|
||||||
example = "gitMinimal";
|
example = "gitMinimal";
|
||||||
default = null;
|
default = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue