1 { config, lib, pkgs, ... }:
6 globalCfg = config.services.scion;
7 cfg = config.services.scion.scion-router;
8 toml = pkgs.formats.toml { };
12 config_dir = "/etc/scion";
15 configFile = toml.generate "scion-router.toml" (recursiveUpdate defaultConfig cfg.settings);
18 options.services.scion.scion-router = {
19 enable = mkEnableOption "the scion-router service";
23 example = literalExpression ''
29 scion-router configuration. Refer to
30 <https://docs.scion.org/en/latest/manuals/common.html>
31 for details on supported values.
35 config = mkIf cfg.enable {
36 systemd.services.scion-router = {
37 description = "SCION Router";
38 after = [ "network-online.target" ];
39 wants = [ "network-online.target" ];
40 wantedBy = [ "multi-user.target" ];
43 ExecStart = "${globalCfg.package}/bin/scion-router --config ${configFile}";
44 Restart = "on-failure";
46 ${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-router";