11 globalCfg = config.services.scion;
12 cfg = config.services.scion.scion-control;
13 toml = pkgs.formats.toml { };
14 connectionDir = if globalCfg.stateless then "/run" else "/var/lib";
18 config_dir = "/etc/scion";
19 reconnect_to_dispatcher = true;
22 connection = "${connectionDir}/scion-control/control.beacon.db";
25 connection = "${connectionDir}/scion-control/control.path.db";
28 connection = "${connectionDir}/scion-control/control.trust.db";
34 configFile = toml.generate "scion-control.toml" (recursiveUpdate defaultConfig cfg.settings);
37 options.services.scion.scion-control = {
38 enable = mkEnableOption "the scion-control service";
42 example = literalExpression ''
45 connection = "/run/scion-control/control.path.db";
53 scion-control configuration. Refer to
54 <https://docs.scion.org/en/latest/manuals/common.html>
55 for details on supported values.
59 config = mkIf cfg.enable {
60 systemd.services.scion-control = {
61 description = "SCION Control Service";
63 "network-online.target"
64 "scion-dispatcher.service"
67 "network-online.target"
68 "scion-dispatcher.service"
70 wantedBy = [ "multi-user.target" ];
73 Group = if (config.services.scion.scion-dispatcher.enable == true) then "scion" else null;
74 ExecStart = "${globalCfg.package}/bin/scion-control --config ${configFile}";
76 Restart = "on-failure";
77 BindPaths = [ "/dev/shm:/run/shm" ];
78 ${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-control";