11 globalCfg = config.services.scion;
12 cfg = config.services.scion.scion-daemon;
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-daemon/sd.path.db";
25 connection = "${connectionDir}/scion-daemon/sd.trust.db";
31 configFile = toml.generate "scion-daemon.toml" (recursiveUpdate defaultConfig cfg.settings);
34 options.services.scion.scion-daemon = {
35 enable = mkEnableOption "the scion-daemon service";
39 example = literalExpression ''
42 connection = "/run/scion-daemon/sd.path.db";
50 scion-daemon configuration. Refer to
51 <https://docs.scion.org/en/latest/manuals/common.html>
52 for details on supported values.
56 config = mkIf cfg.enable {
57 systemd.services.scion-daemon = {
58 description = "SCION Daemon";
60 "network-online.target"
61 "scion-dispatcher.service"
64 "network-online.target"
65 "scion-dispatcher.service"
67 wantedBy = [ "multi-user.target" ];
70 ExecStart = "${globalCfg.package}/bin/scion-daemon --config ${configFile}";
71 Restart = "on-failure";
73 ${if globalCfg.stateless then "RuntimeDirectory" else "StateDirectory"} = "scion-daemon";