# Wireguard configuration with a public ip as endpoint?

**URL:** <https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107>\
**Category:** Guix\
**Created:** [September 6, 2026, 1:59pm UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107 "2026-09-06T13:59:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![juipeltje](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juipeltje/32/1178_2.png) [@juipeltje](https://forum.systemcrafters.net/u/juipeltje)\
**Post date:** [September 6, 2026, 1:59pm UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107/1 "2026-09-06T13:59:18Z")

</div>

Made a post about this on reddit as well, but was curious if there was some more input to be found here. So i’m in the process of writing a guix config for my server and as i was going through the wireguard module, when it comes to the endpoint it gives an example of just passing it a string, but my endpoint is my public ip, and i obviously don’t want that to be part of my version control. So i was wondering if someone here has a similar setup and has a good solution for this? I was wondering if i could just use something like `local-file` perhaps and point it to a file outside of version control, or point it to a file in /etc similar to what is done with the `private-key` field in the documentation.

---

<div class="post-metadata">

**Author:** ![dgr](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/dgr/32/394_2.png) [@dgr](https://forum.systemcrafters.net/u/dgr)\
**Post date:** [September 7, 2026, 10:24am UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107/2 "2026-09-07T10:24:52Z")

</div>

Maybe a lookup of your public IP at runtime or system reconfigure time?  
But why not include machine specific values in your Guix config?  
If it’s because you public the config to a public repo, then you could put it in a include and put the included file into a .gitignore?

---

<div class="post-metadata">

**Author:** ![juipeltje](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juipeltje/32/1178_2.png) [@juipeltje](https://forum.systemcrafters.net/u/juipeltje)\
**Post date:** [September 7, 2026, 2:39pm UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107/3 "2026-09-07T14:39:17Z")

</div>

Yeah it’s because i store my config in a public repo. .gitignore could also be an option. I’m thinking of maybe managing it through `pass`, assuming that’ll work, since the documentation has an example of doing that for the `private-key` as well.

---

<div class="post-metadata">

**Author:** ![kepi](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/kepi/32/1083_2.png) [@kepi](https://forum.systemcrafters.net/u/kepi)\
**Post date:** [September 10, 2026, 12:40pm UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107/4 "2026-09-10T12:40:36Z")

</div>

I have same thing in my TODO and I’m currently weighting pros and cons between two ways:

1. gopass
2. SOPS

Gopass instead of pass simply because it can synchronize between my machines and I’m quite used to it. For me, main benefit of gopass is that I’m already using it. Cons are two - information’s are stored in different place than my code. And storing different data then passwords seems weird. But you can bend it this way without anyproblem, even attach other yaml formatted keys to “passwords”.

SOPS because it is nice to have all data relevant to your configuration commited alongside your changes. There is even [GitHub - fishinthecalculator/sops-guix: Secure secret provisioning with Guix and SOPS · GitHub](https://github.com/fishinthecalculator/sops-guix) to help you.

---

<div class="post-metadata">

**Author:** ![juipeltje](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.systemcrafters.net/juipeltje/32/1178_2.png) [@juipeltje](https://forum.systemcrafters.net/u/juipeltje)\
**Post date:** [September 21, 2026, 3:01pm UTC](https://forum.systemcrafters.net/t/wireguard-configuration-with-a-public-ip-as-endpoint/2107/5 "2026-09-21T15:01:47Z")

</div>

Just wanted to write an update here. So after brushing up on wireguard a little it seems like i have been an idiot this whole time and realized i don’t need to configure the endpoint on my server at all, only on the client side. However on my current system on the server side the endpoint for the peers was written automatically to the conf file, which is what got me confused. As for the private-key, i settled on just pointing it to a file in /etc/wireguard, like described in the documentation. Since i don’t have any other secrets to manage atm, something like sops-guix feels like overkill for me and adds unnecessary reliance on another channel (imo). It would still be nice to declaritively configure the endpoint on my client machines, but honestly i’m fine with settling with just adding it imperatively to networkmanager, or just creating a shepherd service that activates the interface with `wg-quick` or something like that. I tried setting the endpoint similar to how guix does it with the private-key by adding a `postUp` entry that sets the endpoint by reading it from a file, but the endpoint option does not accept a file to read from as an argument, unlike the private-key according to the `wg` man page, So it seems like what i wanted to do is not possible in that sense. But i consider the issue solved now.
