aboutsummaryrefslogtreecommitdiff
path: root/modules/quassel/quassel.nix
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2023-10-06 18:27:27 +0200
committerMax Audron <audron@cocaine.farm>2023-10-06 18:27:27 +0200
commitae075c83a3d616dd87713c44df7e4501f276e8be (patch)
treea4b7a956bae8bfe7461d29b04662597e03c2a183 /modules/quassel/quassel.nix
parentfix wireguard postShutdown errors (diff)
eanble ldap and ssl for quassel
Diffstat (limited to 'modules/quassel/quassel.nix')
-rw-r--r--modules/quassel/quassel.nix30
1 files changed, 16 insertions, 14 deletions
diff --git a/modules/quassel/quassel.nix b/modules/quassel/quassel.nix
index 6d259d0..13f6ba9 100644
--- a/modules/quassel/quassel.nix
+++ b/modules/quassel/quassel.nix
@@ -42,15 +42,6 @@ in
'';
};
- configFromEnvironment = mkOption {
- default = false;
- type = types.bool;
- description = ''
- Configure quassels authenticator and database settings using environment variables,
- Instead of imperatively setting it up using the setup wizard during first connection to the quassel core.
- '';
- };
-
settings = mkOption {
description = literalExpression ''
Configuration for quassel daemon.
@@ -84,6 +75,15 @@ in
'';
};
+ configFromEnvironment = mkOption {
+ default = false;
+ type = types.bool;
+ description = ''
+ Configure quassels authenticator and database settings using environment variables,
+ Instead of imperatively setting it up using the setup wizard during first connection to the quassel core.
+ '';
+ };
+
ident = mkOption {
description = literalExpression ''
Configuration for quassels internal ident daemon.
@@ -303,7 +303,7 @@ in
type = types.submodule {
options = {
authenticator = mkOption {
- type = types.enum [ "Database" "Ldap" ];
+ type = types.enum [ "Database" "LDAP" ];
default = "Database";
description = ''
Specify the backend used to authenticate users to quassel. Either "Database" to
@@ -452,7 +452,7 @@ in
"--metrics-listen=${concatStringsSep "," cfg.settings.metrics.listen}"
"--metrics-port=${toString cfg.settings.metrics.port}"
]
- ++ optional cfg.configFromEnvironment "--config-from-environment"
+ ++ optional cfg.settings.configFromEnvironment "--config-from-environment"
# SSL
++ optional cfg.settings.ssl.required "--require-ssl"
@@ -460,9 +460,11 @@ in
++ optional (cfg.settings.ssl.keyFile != null) "--ssl-key=${cfg.settings.ssl.keyFile}"
));
+ ExecReload="${pkgs.coreutils}/bin/kill -HUP $MAINPID";
+
EnvironmentFile = mkIf
(cfg.environmentFile != null) [ cfg.environmentFile ];
- Environment = mkIf cfg.configFromEnvironment ([
+ Environment = mkIf cfg.settings.configFromEnvironment ([
"AUTH_AUTHENTICATOR=${cfg.settings.auth.authenticator}"
"DB_BACKEND=${cfg.settings.db.backend}"
] ++ (optional (cfg.settings.db.backend == "PostgreSQL") [
@@ -471,14 +473,14 @@ in
"DB_PGSQL_USERNAME=${cfg.settings.db.pgsql.username}"
"DB_PGSQL_PORT=${toString cfg.settings.db.pgsql.port}"
] ++ optional (cfg.settings.db.pgsql.password != null) "DB_PGSQL_PASSWORD=${cfg.settings.db.pgsql.password}"
- ) ++ (optional (cfg.settings.auth.authenticator == "Ldap") [
+ ) ++ (optional (cfg.settings.auth.authenticator == "LDAP") [
"AUTH_LDAP_BASE_DN=${cfg.settings.auth.ldap.baseDN}"
"AUTH_LDAP_BIND_DN=${cfg.settings.auth.ldap.bindDN}"
"AUTH_LDAP_FILTER=${cfg.settings.auth.ldap.filter}"
"AUTH_LDAP_HOSTNAME=${cfg.settings.auth.ldap.hostname}"
"AUTH_LDAP_PORT=${toString cfg.settings.auth.ldap.port}"
"AUTH_LDAP_UID_ATTRIBUTE=${cfg.settings.auth.ldap.uidAttribute}"
- ] /* ++ optional (cfg.settings.auth.ldap.bindPassword != null) "AUTH_LDAP_BIND_PASSWORD=${cfg.settings.auth.ldap.bindPassword}" */
+ ] ++ optional (cfg.settings.auth.ldap.bindPassword != null) "AUTH_LDAP_BIND_PASSWORD=${cfg.settings.auth.ldap.bindPassword}"
));
User = user;
};