Tinc: Difference between revisions
imported>Chuangzhu Update expression to configure interface address |
imported>Chuangzhu Fix systemd unit |
||
Line 68: | Line 68: | ||
<syntaxHighlight lang=nix># for heinz | <syntaxHighlight lang=nix># for heinz | ||
networking.interfaces."tinc. | networking.interfaces."tinc.${networkName}".ipv4.addresses = [ { address = 10.1.1.25; prefixLength = 24; } ]; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
Line 74: | Line 74: | ||
The following snippet '''seems''' to fix that (until perhaps a more proper fix is upstreamed?): | The following snippet '''seems''' to fix that (until perhaps a more proper fix is upstreamed?): | ||
<syntaxHighlight lang=nix> | <syntaxHighlight lang=nix> | ||
systemd.services."network-addresses-tinc.${networkName}". | # Start the unit for adding addresses if Tinc is started | ||
systemd.services."network- | systemd.services."tinc.${networkName}".wants = [ "network-addresses-tinc.${networkName}.service" ]; | ||
# Stop the unit for adding addresses if Tinc is stopped or restarted | |||
systemd.services."network-addresses-tinc.${networkName}".partOf = [ "tinc.${networkName}.service" ]; | |||
# Start the unit for adding addresses after the Tinc device is added | |||
systemd.services."network-addresses-tinc.${networkName}".after = [ "sys-subsystem-net-devices-tinc.${networkName}.device" ]; | |||
</syntaxHighlight> | </syntaxHighlight> | ||
=== tinc-up/tinc-down === | === tinc-up/tinc-down === |