nixos/guacamole-client: init

This commit is contained in:
Pol Dellaiera 2023-06-16 19:11:59 +02:00
parent a68567c35d
commit a950888024
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA
4 changed files with 67 additions and 0 deletions

View File

@ -1193,6 +1193,7 @@
./services/web-apps/gotosocial.nix
./services/web-apps/grocy.nix
./services/web-apps/pixelfed.nix
./services/web-apps/guacamole-client.nix
./services/web-apps/healthchecks.nix
./services/web-apps/hedgedoc.nix
./services/web-apps/hledger-web.nix

View File

@ -0,0 +1,60 @@
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.services.guacamole-client;
settingsFormat = pkgs.formats.javaProperties { };
in
{
options = {
services.guacamole-client = {
enable = lib.mkEnableOption (lib.mdDoc "Apache Guacamole Client (Tomcat)");
package = lib.mkPackageOptionMD pkgs "guacamole-client" { };
settings = lib.mkOption {
type = lib.types.submodule {
freeformType = settingsFormat.type;
};
default = {
guacd-hostname = "localhost";
guacd-port = 4822;
};
description = lib.mdDoc ''
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 = lib.mdDoc ''
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
];
};
};
};
}

View File

@ -314,6 +314,7 @@ in {
graylog = handleTest ./graylog.nix {};
grocy = handleTest ./grocy.nix {};
grub = handleTest ./grub.nix {};
guacamole-client = handleTest ./guacamole-client.nix {};
gvisor = handleTest ./gvisor.nix {};
hadoop = import ./hadoop { inherit handleTestOn; package=pkgs.hadoop; };
hadoop_3_2 = import ./hadoop { inherit handleTestOn; package=pkgs.hadoop_3_2; };

View File

@ -1,6 +1,7 @@
{ lib
, stdenvNoCC
, fetchurl
, nixosTests
}:
stdenvNoCC.mkDerivation (finalAttrs: {
@ -24,6 +25,10 @@ stdenvNoCC.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.tests = {
inherit (nixosTests) guacamole-client;
};
meta = {
description = "Clientless remote desktop gateway";
homepage = "https://guacamole.apache.org/";