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
|
||||
properties.example
|
||||
else
|
||||
rec {
|
||||
{
|
||||
_type = "literalExpression";
|
||||
text = "pkgs.${lib.showAttrPath path}";
|
||||
path = lib.toList properties.example;
|
||||
text = "pkgs.${lib.showAttrPath properties.example}";
|
||||
path = properties.example;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
attrPathType = with types; coercedTo str lib.toList (listOf str);
|
||||
in
|
||||
{
|
||||
options = {
|
||||
|
@ -36,17 +38,17 @@ in
|
|||
types.submodule {
|
||||
options = {
|
||||
default = lib.mkOption {
|
||||
type = with types; either str (listOf str);
|
||||
type = attrPathType;
|
||||
description = ''
|
||||
Default name (or path) for this package.
|
||||
Attribute path for this dependency's default package, relative to `pkgs`.
|
||||
'';
|
||||
example = "git";
|
||||
};
|
||||
|
||||
example = lib.mkOption {
|
||||
type = with types; nullOr str;
|
||||
type = types.nullOr attrPathType;
|
||||
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";
|
||||
default = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue