Skip to content

Commit

Permalink
helpers: factor out borderType
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage committed Nov 16, 2023
1 parent 356e0e8 commit 707054b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/helpers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ with lib; rec {
};
};

borderType = with lib.types;
oneOf [
str
(listOf str)
(listOf (listOf str))
];

# Creates an option with a nullable type that defaults to null.
mkNullOrOption = type: desc:
lib.mkOption {
Expand Down Expand Up @@ -146,14 +153,7 @@ with lib; rec {
mkEnumFirstDefault = enum: mkEnum enum (head enum);
mkBorder = default: name: desc:
mkNullable
(
with lib.types;
oneOf [
str
(listOf str)
(listOf (listOf str))
]
)
borderType
default
(let
defaultDesc = ''
Expand Down

0 comments on commit 707054b

Please sign in to comment.