Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
79 lines
2.2 KiB
Nix
79 lines
2.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
globalCfg = config.services.scion;
|
|
cfg = config.services.scion.scion-dispatcher;
|
|
toml = pkgs.formats.toml { };
|
|
defaultConfig = {
|
|
dispatcher = {
|
|
id = "dispatcher";
|
|
local_udp_forwarding = true;
|
|
};
|
|
log.console = {
|
|
level = "info";
|
|
};
|
|
};
|
|
configFile = toml.generate "scion-dispatcher.toml" (recursiveUpdate defaultConfig cfg.settings);
|
|
in
|
|
{
|
|
options.services.scion.scion-dispatcher = {
|
|
enable = mkEnableOption "the scion-dispatcher service";
|
|
settings = mkOption {
|
|
default = { };
|
|
type = toml.type;
|
|
example = literalExpression ''
|
|
{
|
|
dispatcher = {
|
|
id = "dispatcher";
|
|
socket_file_mode = "0770";
|
|
application_socket = "/dev/shm/dispatcher/default.sock";
|
|
};
|
|
log.console = {
|
|
level = "info";
|
|
};
|
|
}
|
|
'';
|
|
description = ''
|
|
scion-dispatcher configuration. Refer to
|
|
<https://docs.scion.org/en/latest/manuals/common.html>
|
|
for details on supported values.
|
|
'';
|
|
};
|
|
};
|
|
config = mkIf cfg.enable {
|
|
# Needed for group ownership of the dispatcher socket
|
|
users.groups.scion = { };
|
|
|
|
# scion programs hardcode path to dispatcher in /run/shm, and is not
|
|
# configurable at runtime upstream plans to obsolete the dispatcher in
|
|
# favor of an SCMP daemon, at which point this can be removed.
|
|
system.activationScripts.scion-dispatcher = ''
|
|
ln -sf /dev/shm /run/shm
|
|
'';
|
|
|
|
systemd.services.scion-dispatcher = {
|
|
description = "SCION Dispatcher";
|
|
after = [ "network-online.target" ];
|
|
wants = [ "network-online.target" ];
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
Type = "simple";
|
|
Group = "scion";
|
|
DynamicUser = true;
|
|
BindPaths = [ "/dev/shm:/run/shm" ];
|
|
ExecStartPre = "${pkgs.coreutils}/bin/rm -rf /run/shm/dispatcher";
|
|
ExecStart = "${globalCfg.package}/bin/scion-dispatcher --config ${configFile}";
|
|
Restart = "on-failure";
|
|
${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-dispatcher";
|
|
};
|
|
};
|
|
};
|
|
}
|