mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
6afb255d97
these changes were generated with nixq 0.0.2, by running nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix two mentions of the mdDoc function remain in nixos/, both of which are inside of comments. Since lib.mdDoc is already defined as just id, this commit is a no-op as far as Nix (and the built manual) is concerned.
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{ config
|
|
, lib
|
|
, pkgs
|
|
, ...
|
|
}:
|
|
let
|
|
cfg = config.services.guacamole-client;
|
|
settingsFormat = pkgs.formats.javaProperties { };
|
|
in
|
|
{
|
|
options = {
|
|
services.guacamole-client = {
|
|
enable = lib.mkEnableOption "Apache Guacamole Client (Tomcat)";
|
|
package = lib.mkPackageOption pkgs "guacamole-client" { };
|
|
|
|
settings = lib.mkOption {
|
|
type = lib.types.submodule {
|
|
freeformType = settingsFormat.type;
|
|
};
|
|
default = {
|
|
guacd-hostname = "localhost";
|
|
guacd-port = 4822;
|
|
};
|
|
description = ''
|
|
Configuration written to `guacamole.properties`.
|
|
|
|
::: {.note}
|
|
The Guacamole web application uses one main configuration file called
|
|
`guacamole.properties`. This file is the common location for all
|
|
configuration properties read by Guacamole or any extension of
|
|
Guacamole, including authentication providers.
|
|
:::
|
|
'';
|
|
};
|
|
|
|
enableWebserver = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = ''
|
|
Enable the Guacamole web application in a Tomcat webserver.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
environment.etc."guacamole/guacamole.properties" = lib.mkIf
|
|
(cfg.settings != {})
|
|
{ source = (settingsFormat.generate "guacamole.properties" cfg.settings); };
|
|
|
|
services = lib.mkIf cfg.enableWebserver {
|
|
tomcat = {
|
|
enable = true;
|
|
webapps = [
|
|
cfg.package
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|