0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 06:00:33 +03:00

Merge master into staging-next

This commit is contained in:
github-actions[bot] 2023-06-23 18:01:07 +00:00 committed by GitHub
commit ea69de970d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 1290 additions and 132 deletions

View file

@ -18,6 +18,8 @@
- [sitespeed-io](https://sitespeed.io), a tool that can generate metrics (timings, diagnostics) for websites. Available as [services.sitespeed-io](#opt-services.sitespeed-io.enable).
- [Apache Guacamole](https://guacamole.apache.org/), a cross-platform, clientless remote desktop gateway. Available as [services.guacamole-server](#opt-services.guacamole-server.enable) and [services.guacamole-client](#opt-services.guacamole-client.enable) services.
## Backward Incompatibilities {#sec-release-23.11-incompatibilities}
- `writeTextFile` now requires `executable` to be boolean, values like `null` or `""` will now fail to evaluate.

View file

@ -55,11 +55,6 @@ let
description = "An evaluation of Nixpkgs; the top level attribute set of packages";
};
# Whether `pkgs` was constructed by this module - not if nixpkgs.pkgs or
# _module.args.pkgs is set. However, determining whether _module.args.pkgs
# is defined elsewhere does not seem feasible.
constructedByMe = !opt.pkgs.isDefined;
hasBuildPlatform = opt.buildPlatform.highestPrio < (mkOptionDefault {}).priority;
hasHostPlatform = opt.hostPlatform.isDefined;
hasPlatform = hasHostPlatform || hasBuildPlatform;
@ -337,10 +332,28 @@ in
config = {
_module.args = {
pkgs = finalPkgs.__splicedPackages;
pkgs =
# We explicitly set the default override priority, so that we do not need
# to evaluate finalPkgs in case an override is placed on `_module.args.pkgs`.
# After all, to determine a definition priority, we need to evaluate `._type`,
# which is somewhat costly for Nixpkgs. With an explicit priority, we only
# evaluate the wrapper to find out that the priority is lower, and then we
# don't need to evaluate `finalPkgs`.
lib.mkOverride lib.modules.defaultOverridePriority
finalPkgs.__splicedPackages;
};
assertions = [
assertions = let
# Whether `pkgs` was constructed by this module. This is false when any of
# nixpkgs.pkgs or _module.args.pkgs is set.
constructedByMe =
# We set it with default priority and it can not be merged, so if the
# pkgs module argument has that priority, it's from us.
(lib.modules.mergeAttrDefinitionsWithPrio options._module.args).pkgs.highestPrio
== lib.modules.defaultOverridePriority
# Although, if nixpkgs.pkgs is set, we did forward it, but we did not construct it.
&& !opt.pkgs.isDefined;
in [
(
let
nixosExpectedSystem =

View file

@ -1193,6 +1193,8 @@
./services/web-apps/gotosocial.nix
./services/web-apps/grocy.nix
./services/web-apps/pixelfed.nix
./services/web-apps/guacamole-client.nix
./services/web-apps/guacamole-server.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

@ -0,0 +1,83 @@
{ config
, lib
, pkgs
, ...
}:
let
cfg = config.services.guacamole-server;
in
{
options = {
services.guacamole-server = {
enable = lib.mkEnableOption (lib.mdDoc "Apache Guacamole Server (guacd)");
package = lib.mkPackageOptionMD pkgs "guacamole-server" { };
extraEnvironment = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = { };
example = lib.literalExpression ''
{
ENVIRONMENT = "production";
}
'';
description = lib.mdDoc "Environment variables to pass to guacd.";
};
host = lib.mkOption {
default = "127.0.0.1";
description = lib.mdDoc ''
The host name or IP address the server should listen to.
'';
type = lib.types.str;
};
port = lib.mkOption {
default = 4822;
description = lib.mdDoc ''
The port the guacd server should listen to.
'';
type = lib.types.port;
};
logbackXml = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
example = "/path/to/logback.xml";
description = lib.mdDoc ''
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 = lib.mdDoc ''
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" ];
after = [ "network.target" ];
environment = {
HOME = "/run/guacamole-server";
} // cfg.extraEnvironment;
serviceConfig = {
ExecStart = "${lib.getExe cfg.package} -f -b ${cfg.host} -l ${toString cfg.port}";
RuntimeDirectory = "guacamole-server";
DynamicUser = true;
PrivateTmp = "yes";
Restart = "on-failure";
};
};
};
}

View file

@ -314,6 +314,8 @@ in {
graylog = handleTest ./graylog.nix {};
grocy = handleTest ./grocy.nix {};
grub = handleTest ./grub.nix {};
guacamole-client = handleTest ./guacamole-client.nix {};
guacamole-server = handleTest ./guacamole-server.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

@ -0,0 +1,21 @@
import ./make-test-python.nix ({pkgs, lib, ...}:
{
name = "guacamole-server";
nodes = {
machine = {pkgs, ...}: {
services.guacamole-server = {
enable = true;
host = "0.0.0.0";
};
};
};
testScript = ''
start_all()
machine.wait_for_unit("guacamole-server.service")
machine.wait_for_open_port(4822)
'';
meta.maintainers = [ lib.maintainers.drupol ];
})