chore: clean up tree-wide

This commit is contained in:
Mohammad Rafiq 2025-07-02 06:02:47 +08:00
parent 45afd6bea5
commit b9ad8ac2ca
No known key found for this signature in database
50 changed files with 247 additions and 511 deletions

View file

@ -1,6 +1,13 @@
{ lib, ... }:
let
inherit (lib) singleton;
inherit (lib) mkOption singleton;
inherit (lib.types)
int
str
port
path
attrs
;
inherit (lib.strings) splitString;
inherit (builtins) length concatStringsSep tail;
in
@ -15,31 +22,31 @@ rec {
if len <= count then list else (shortenList count (tail list));
# Modules
mkAttrOption = lib.mkOption {
type = lib.types.attrs;
mkAttrOption = mkOption {
type = attrs;
default = { };
};
mkIntOption =
default:
lib.mkOption {
type = lib.types.int;
mkOption {
type = int;
inherit default;
};
mkStrOption = lib.mkOption {
type = lib.types.str;
mkStrOption = mkOption {
type = str;
default = "";
};
mkPortOption =
port:
lib.mkOption {
type = lib.types.port;
default = port;
default:
mkOption {
type = port;
inherit default;
};
mkPathOption =
path:
lib.mkOption {
type = lib.types.path;
default = path;
default:
mkOption {
type = path;
inherit default;
};
# Domains

View file

@ -38,6 +38,7 @@ in
name,
defaultPort,
persistDirs ? [ ],
#TODO: specify required secrets
extraOptions ? { },
extraConfig ? { },
}: