nixos/services.uhub: remove with lib;

This commit is contained in:
Felix Buehler 2024-08-30 00:46:52 +02:00
parent b04e01279b
commit 43e70943da

View file

@ -1,7 +1,4 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib;
let let
settingsFormat = { settingsFormat = {
type = with lib.types; attrsOf (oneOf [ bool int str ]); type = with lib.types; attrsOf (oneOf [ bool int str ]);
@ -13,21 +10,21 @@ let
in { in {
options = { options = {
services.uhub = mkOption { services.uhub = lib.mkOption {
default = { }; default = { };
description = "Uhub ADC hub instances"; description = "Uhub ADC hub instances";
type = types.attrsOf (types.submodule { type = lib.types.attrsOf (lib.types.submodule {
options = { options = {
enable = mkEnableOption "hub instance" // { default = true; }; enable = lib.mkEnableOption "hub instance" // { default = true; };
enableTLS = mkOption { enableTLS = lib.mkOption {
type = types.bool; type = lib.types.bool;
default = false; default = false;
description = "Whether to enable TLS support."; description = "Whether to enable TLS support.";
}; };
settings = mkOption { settings = lib.mkOption {
inherit (settingsFormat) type; inherit (settingsFormat) type;
description = '' description = ''
Configuration of uhub. Configuration of uhub.
@ -43,18 +40,18 @@ in {
}; };
}; };
plugins = mkOption { plugins = lib.mkOption {
description = "Uhub plugin configuration."; description = "Uhub plugin configuration.";
type = with types; type = with lib.types;
listOf (submodule { listOf (submodule {
options = { options = {
plugin = mkOption { plugin = lib.mkOption {
type = path; type = path;
example = literalExpression example = lib.literalExpression
"$${pkgs.uhub}/plugins/mod_auth_sqlite.so"; "$${pkgs.uhub}/plugins/mod_auth_sqlite.so";
description = "Path to plugin file."; description = "Path to plugin file.";
}; };
settings = mkOption { settings = lib.mkOption {
description = "Settings specific to this plugin."; description = "Settings specific to this plugin.";
type = with types; attrsOf str; type = with types; attrsOf str;
example = { file = "/etc/uhub/users.db"; }; example = { file = "/etc/uhub/users.db"; };