mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/guacamole: client option defined in server module
This commit is contained in:
parent
77349c05aa
commit
598f6dd4fc
2 changed files with 35 additions and 26 deletions
|
|
@ -41,13 +41,38 @@ in
|
|||
Enable the Guacamole web application in a Tomcat webserver.
|
||||
'';
|
||||
};
|
||||
|
||||
logbackXml = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = "/path/to/logback.xml";
|
||||
description = ''
|
||||
Configuration file that correspond to `logback.xml`.
|
||||
'';
|
||||
};
|
||||
|
||||
userMappingXml = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = "/path/to/user-mapping.xml";
|
||||
description = ''
|
||||
Configuration file that correspond to `user-mapping.xml`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Setup configuration files.
|
||||
environment.etc."guacamole/guacamole.properties" = lib.mkIf (cfg.settings != { }) {
|
||||
source = (settingsFormat.generate "guacamole.properties" cfg.settings);
|
||||
};
|
||||
environment.etc."guacamole/logback.xml" = lib.mkIf (cfg.logbackXml != null) {
|
||||
source = cfg.logbackXml;
|
||||
};
|
||||
environment.etc."guacamole/user-mapping.xml" = lib.mkIf (cfg.userMappingXml != null) {
|
||||
source = cfg.userMappingXml;
|
||||
};
|
||||
|
||||
services = lib.mkIf cfg.enableWebserver {
|
||||
tomcat = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,16 @@ let
|
|||
cfg = config.services.guacamole-server;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "guacamole-server" "logbackXml" ]
|
||||
[ "services" "guacamole-client" "logbackXml" ]
|
||||
)
|
||||
(lib.mkRenamedOptionModule
|
||||
[ "services" "guacamole-server" "userMappingXml" ]
|
||||
[ "services" "guacamole-client" "userMappingXml" ]
|
||||
)
|
||||
];
|
||||
options = {
|
||||
services.guacamole-server = {
|
||||
enable = lib.mkEnableOption "Apache Guacamole Server (guacd)";
|
||||
|
|
@ -39,36 +49,10 @@ in
|
|||
'';
|
||||
type = lib.types.port;
|
||||
};
|
||||
|
||||
logbackXml = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = "/path/to/logback.xml";
|
||||
description = ''
|
||||
Configuration file that correspond to `logback.xml`.
|
||||
'';
|
||||
};
|
||||
|
||||
userMappingXml = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = "/path/to/user-mapping.xml";
|
||||
description = ''
|
||||
Configuration file that correspond to `user-mapping.xml`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# Setup configuration files.
|
||||
environment.etc."guacamole/logback.xml" = lib.mkIf (cfg.logbackXml != null) {
|
||||
source = cfg.logbackXml;
|
||||
};
|
||||
environment.etc."guacamole/user-mapping.xml" = lib.mkIf (cfg.userMappingXml != null) {
|
||||
source = cfg.userMappingXml;
|
||||
};
|
||||
|
||||
systemd.services.guacamole-server = {
|
||||
description = "Apache Guacamole server (guacd)";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue