1 { config, lib, pkgs, ... }:
6 globalCfg = config.services.scion;
7 cfg = config.services.scion.scion-control;
8 toml = pkgs.formats.toml { };
9 connectionDir = if globalCfg.stateless then "/run" else "/var/lib";
13 config_dir = "/etc/scion";
14 reconnect_to_dispatcher = true;
17 connection = "${connectionDir}/scion-control/control.beacon.db";
20 connection = "${connectionDir}/scion-control/control.path.db";
23 connection = "${connectionDir}/scion-control/control.trust.db";
29 configFile = toml.generate "scion-control.toml" (recursiveUpdate defaultConfig cfg.settings);
32 options.services.scion.scion-control = {
33 enable = mkEnableOption "the scion-control service";
37 example = literalExpression ''
40 connection = "/run/scion-control/control.path.db";
48 scion-control configuration. Refer to
49 <https://docs.scion.org/en/latest/manuals/common.html>
50 for details on supported values.
54 config = mkIf cfg.enable {
55 systemd.services.scion-control = {
56 description = "SCION Control Service";
57 after = [ "network-online.target" "scion-dispatcher.service" ];
58 wants = [ "network-online.target" "scion-dispatcher.service" ];
59 wantedBy = [ "multi-user.target" ];
62 Group = if (config.services.scion.scion-dispatcher.enable == true) then "scion" else null;
63 ExecStart = "${globalCfg.package}/bin/scion-control --config ${configFile}";
65 Restart = "on-failure";
66 BindPaths = [ "/dev/shm:/run/shm" ];
67 ${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-control";