added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,34 @@
{lib}: let
inherit (lib) mkEnableOption mkOption;
inherit (lib.types) str int;
# mkModule takes a few arguments to generate a module for a service without
# repeating the same options over and over
# this is actually a horrendous abstractation
mkModule = {
name,
type ? "", # type being an empty string means it can be skipped, ommitted
host ? "127.0.0.1", # default to listening only on localhost
port ? 0, # don't set a port by default
extraOptions ? {}, # used to define additional modules
}: {
enable = mkEnableOption "${name} ${type} service";
settings =
{
host = mkOption {
type = str;
default = host;
description = "The host ${name} will listen on";
};
port = mkOption {
type = int;
default = port;
description = "The port ${name} will listen on";
};
}
// extraOptions;
};
in {
inherit mkModule;
}