modules/hyprspace: set up routes

This commit is contained in:
Max Headroom 2023-01-21 22:45:00 +01:00
parent b2011b672f
commit e837adeca8

View file

@ -48,6 +48,11 @@ in {
${pkgs.replace-secret}/bin/replace-secret '@HYPRSPACEPRIVATEKEY@' "${privateKeyFile}" ${runConfig}
chmod 0400 ${runConfig}
'';
postStart = ''
sleep 1
'' + lib.concatStringsSep "\n" (lib.mapAttrsToList (net: v:
"${pkgs.iproute2}/bin/ip route add ${net} via ${v.ip} dev hyprspace metric 30000"
) routes);
environment = lib.optionalAttrs config.services.kubo.enable {
HYPRSPACE_IPFS_API = config.services.kubo.settings.Addresses.API;
};