NixOS/modules/servers/base.nix

24 lines
596 B
Nix

{ lib, config, ... }:
let
mkServerOptions = name: subdomain: port: {
enable = lib.mkEnableOption "enable";
port = lib.mkOption {
type = lib.types.int;
default = port;
};
host = lib.mkOption {
type = lib.types.str;
default = "${subdomain}.${config.my.domain}";
};
url = lib.mkOption {
type = lib.types.str;
default = "https://${config.my.servers.${name}.host}";
};
local = lib.mkOption {
type = lib.types.str;
default = "http://${config.my.localhost}:${toString port}";
};
};
in { inherit mkServerOptions; }