refactor(nixos): simplify registry option definitions #129
@@ -5,40 +5,40 @@
|
||||
tab = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "Apps";
|
||||
description = "Homepage tab that contains this entry.";
|
||||
description = "Groups the entry in a Homepage tab.";
|
||||
};
|
||||
|
||||
section = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "Media";
|
||||
description = "Homepage section that contains this entry.";
|
||||
description = "Groups the entry in a Homepage section.";
|
||||
};
|
||||
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "Navidrome";
|
||||
description = "Homepage display name for this entry.";
|
||||
description = "Sets the display name in Homepage.";
|
||||
};
|
||||
|
||||
description = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "Music";
|
||||
description = "Homepage description for this entry.";
|
||||
description = "Sets the description in Homepage.";
|
||||
};
|
||||
|
||||
icon = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "navidrome.png";
|
||||
description = "Homepage icon for this entry.";
|
||||
description = "Sets the icon in Homepage.";
|
||||
};
|
||||
|
||||
href = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "https://music.alexion.dev";
|
||||
description = "Homepage link override for this entry.";
|
||||
description = "Overrides the generated Homepage link.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
domain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "files.alexion.dev";
|
||||
description = "Public domain for this route.";
|
||||
description = "Records the public domain for this route.";
|
||||
};
|
||||
|
||||
protocol = lib.mkOption {
|
||||
@@ -45,14 +45,14 @@
|
||||
"https"
|
||||
"udp"
|
||||
];
|
||||
description = "Public protocol for this route.";
|
||||
description = "Selects the public protocol for this route.";
|
||||
};
|
||||
|
||||
port = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.port;
|
||||
default = null;
|
||||
example = 3923;
|
||||
description = "HTTP backend port for an HTTP or HTTPS route.";
|
||||
description = "Sets the HTTP backend port for an HTTP or HTTPS route.";
|
||||
};
|
||||
|
||||
ports = lib.mkOption {
|
||||
@@ -62,7 +62,7 @@
|
||||
2456
|
||||
2457
|
||||
];
|
||||
description = "UDP ports for a UDP route.";
|
||||
description = "Sets the UDP ports for a UDP route.";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,21 +1,20 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
entryType = lib.types.submodule {
|
||||
options = {
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "nvim";
|
||||
description = "Command expanded by this shell shortcut.";
|
||||
};
|
||||
|
||||
abbreviation = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether fish realizes this shell shortcut as an abbreviation instead of an alias.";
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
type = lib.types.coercedTo lib.types.str (command: { inherit command; }) entryType;
|
||||
type = lib.types.coercedTo lib.types.str (command: { inherit command; }) (
|
||||
lib.types.submodule {
|
||||
options = {
|
||||
command = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
example = "nvim";
|
||||
description = "Sets the command expanded by this shortcut.";
|
||||
};
|
||||
|
||||
abbreviation = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Uses a Fish abbreviation instead of an alias.";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,14 +5,14 @@ let
|
||||
assertion = lib.mkOption {
|
||||
type = lib.types.functionTo lib.types.bool;
|
||||
description = ''
|
||||
Tests this registry's flattened collected entries.
|
||||
Tests the registry's flattened entries.
|
||||
'';
|
||||
};
|
||||
|
||||
message = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Describes the registry validation failure.
|
||||
Describes the validation failure.
|
||||
'';
|
||||
};
|
||||
};
|
||||
@@ -23,7 +23,7 @@ in
|
||||
type = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
description = ''
|
||||
Defines the NixOS option type for one registry entry.
|
||||
Defines the NixOS option type for a registry entry.
|
||||
'';
|
||||
};
|
||||
|
||||
@@ -31,7 +31,7 @@ in
|
||||
type = lib.types.listOf checkType;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Contains validation checks for this registry's flattened collected entries.
|
||||
Lists validation checks for the registry's flattened entries.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user