refactor(nixos): use mkWebApp module to simplify web app definitions

This commit is contained in:
Mohammad Rafiq 2025-06-16 14:55:00 +08:00
parent 2292baecf6
commit a5d8bfcdd5
No known key found for this signature in database
8 changed files with 81 additions and 91 deletions

View file

@ -15,6 +15,10 @@ rec {
if len <= count then list else (shortenList count (tail list));
# Modules
mkAttrOption = lib.mkOption {
type = lib.types.attrs;
default = { };
};
mkStrOption = lib.mkOption {
type = lib.types.str;
default = "";

View file

@ -7,7 +7,12 @@ let
singleton
mkIf
;
inherit (lib.pantheon) mkRootDomain mkPortOption mkStrOption;
inherit (lib.pantheon)
mkAttrOption
mkRootDomain
mkPortOption
mkStrOption
;
networkingConfig =
{
config,
@ -45,6 +50,7 @@ in
port = mkPortOption defaultPort;
domain = mkStrOption;
openFirewall = mkEnableOption "";
extraCfg = mkAttrOption;
} // extraOptions;
config = mkIf cfg.enable (mkMerge [