11 globalCfg = config.services.scion;
12 cfg = config.services.scion.scion-router;
13 toml = pkgs.formats.toml { };
17 config_dir = "/etc/scion";
20 configFile = toml.generate "scion-router.toml" (recursiveUpdate defaultConfig cfg.settings);
23 options.services.scion.scion-router = {
24 enable = mkEnableOption "the scion-router service";
28 example = literalExpression ''
34 scion-router configuration. Refer to
35 <https://docs.scion.org/en/latest/manuals/common.html>
36 for details on supported values.
40 config = mkIf cfg.enable {
41 systemd.services.scion-router = {
42 description = "SCION Router";
43 after = [ "network-online.target" ];
44 wants = [ "network-online.target" ];
45 wantedBy = [ "multi-user.target" ];
48 ExecStart = "${globalCfg.package}/bin/scion-router --config ${configFile}";
49 Restart = "on-failure";
51 ${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-router";