diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2024-03-13 18:00:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-13 18:00:53 +0000 |
commit | f4c4bfc9fccaa79ce6a3eafe401daced8285945b (patch) | |
tree | e8af9a1ed52a9c314fa204d2c9d1783fbf50e499 /nixos/modules | |
parent | 4ee0840ba2ecc50458ab1677d108afcd691f4815 (diff) | |
parent | 5fa02d3366fdd16071df1dc47dd53208562eb14c (diff) | |
download | nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar.gz nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar.bz2 nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar.lz nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar.xz nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.tar.zst nixlib-f4c4bfc9fccaa79ce6a3eafe401daced8285945b.zip |
Merge master into staging-next
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/services/continuous-integration/hydra/default.nix | 34 | ||||
-rw-r--r-- | nixos/modules/system/boot/binfmt.nix | 1 |
2 files changed, 32 insertions, 3 deletions
diff --git a/nixos/modules/services/continuous-integration/hydra/default.nix b/nixos/modules/services/continuous-integration/hydra/default.nix index b1d44e67658b..10e1f0532c84 100644 --- a/nixos/modules/services/continuous-integration/hydra/default.nix +++ b/nixos/modules/services/continuous-integration/hydra/default.nix @@ -178,6 +178,24 @@ in description = lib.mdDoc "Whether to run the server in debug mode."; }; + maxServers = mkOption { + type = types.int; + default = 25; + description = lib.mdDoc "Maximum number of starman workers to spawn."; + }; + + minSpareServers = mkOption { + type = types.int; + default = 4; + description = lib.mdDoc "Minimum number of spare starman workers to keep."; + }; + + maxSpareServers = mkOption { + type = types.int; + default = 5; + description = lib.mdDoc "Maximum number of spare starman workers to keep."; + }; + extraConfig = mkOption { type = types.lines; description = lib.mdDoc "Extra lines for the Hydra configuration."; @@ -224,6 +242,16 @@ in ###### implementation config = mkIf cfg.enable { + assertions = [ + { + assertion = cfg.maxServers != 0 && cfg.maxSpareServers != 0 && cfg.minSpareServers != 0; + message = "services.hydra.{minSpareServers,maxSpareServers,minSpareServers} cannot be 0"; + } + { + assertion = cfg.minSpareServers < cfg.maxSpareServers; + message = "services.hydra.minSpareServers cannot be bigger than servives.hydra.maxSpareServers"; + } + ]; users.groups.hydra = { gid = config.ids.gids.hydra; @@ -258,7 +286,7 @@ in using_frontend_proxy = 1 base_uri = ${cfg.hydraURL} notification_sender = ${cfg.notificationSender} - max_servers = 25 + max_servers = ${toString cfg.maxServers} ${optionalString (cfg.logo != null) '' hydra_logo = ${cfg.logo} ''} @@ -359,8 +387,8 @@ in serviceConfig = { ExecStart = "@${hydra-package}/bin/hydra-server hydra-server -f -h '${cfg.listenHost}' " - + "-p ${toString cfg.port} --max_spare_servers 5 --max_servers 25 " - + "--max_requests 100 ${optionalString cfg.debugServer "-d"}"; + + "-p ${toString cfg.port} --min_spare_servers ${toString cfg.minSpareServers} --max_spare_servers ${toString cfg.maxSpareServers} " + + "--max_servers ${toString cfg.maxServers} --max_requests 100 ${optionalString cfg.debugServer "-d"}"; User = "hydra-www"; PermissionsStartOnly = true; Restart = "always"; diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix index 08e3dce70844..2242c9da62d0 100644 --- a/nixos/modules/system/boot/binfmt.nix +++ b/nixos/modules/system/boot/binfmt.nix @@ -331,6 +331,7 @@ in { "proc-sys-fs-binfmt_misc.mount" "systemd-binfmt.service" ]; + services.systemd-binfmt.after = [ "systemd-tmpfiles-setup.service" ]; services.systemd-binfmt.restartTriggers = [ (builtins.toJSON config.boot.binfmt.registrations) ]; }) ]; |