Skip to content

Commit

Permalink
Add TODO.md and example config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzleutgeb committed Sep 4, 2023
1 parent 3d56a1b commit 5348d70
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
70 changes: 70 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Module

For configuring wireguard, use `systemd.network.netdevs`, and not `networking.wireguard.interfaces`.

```nix
systemd.network.netdevs."rp0" = {
wireguardConfig = [
ListenPort = 51820;
PrivateKeyFile = "/etc/wireguard/secret.key";
];
wireguardPeers = [
{
wireguardPeerConfig = {
AllowedIPs = [
"10.0.0.1/32"
];
Endpoint = "server:51820";
PersistentKeepalive = 15;
PresharedKeyFile = "/etc/wireguard/psk.key";
PublicKey = "27s0OvaBBdHoJYkH9osZpjpgSOVNw+RaKfboT/Sfq0g=";
};
}
];
};
services.rosenpass = {
enable = true; # Default: false.
defaultDevice = "rp0"; # Must be a networking device, configured for WireGuard, see above.
manageDevice = true; # Should emit above netdev config. Default: true
# ---
# Following properties match <https://github.com/rosenpass/rosenpass/blob/d915e63445ac384740d60ae41821fa5a3831636a/src/config.rs#L89-L125>.
# For an example, see <https://github.com/rosenpass/rosenpass/blob/d915e63445ac384740d60ae41821fa5a3831636a/config-examples/peer-a-config.toml>.
# NOTE: Do not use `exchange_config`, it's a trap:
# <https://github.com/rosenpass/rosenpass/issues/86>.
# Part 1: "own" config.
verbosity = "Quiet" | "Verbose";
# TODO: If empty, generate automatically?
secretKeyFile = config.sops.secrets."rosenpass/pqsk".path;
# TODO: If empty, generate automatically from public key?
publicKey = "/etc/rosenpass/pqpk";
listen = "";
# Part 2: "peer" config.
peers = {
myotherpeername = {
publicKey = "HASH";
endpoint = ""; # Optional.
preSharedKey = ""; # Optional.
keyOutFile = ""; # Optional, and mutually exclusive with wireguard.
wireguard = { # Optional, and mutually exclusive with keyOutFile.
device = ""; # Should default to config.services.rosenpass.defaultDevice.
publicKey = "..."; # This is called "peer"...
extraParams = "";
};
};
};
};
```
26 changes: 26 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
public_key = "/tmp/key"
secret_key = "/tmp/key"
listen = ["[::]:10001"]
verbosity = "Quiet"


[[peers]]
public_key = "/tmp/key"
endpoint = "localhost:10002"
key_out = "/tmp/key"
tralala = "k"
[[peers.wireguard]]
device = "rp0"
peer = "some public key"
extra_params = ["foo"]


[[peers]]
public_key = "/tmp/key"
endpoint = "localhost:10002"
key_out = "/tmp/key"
tralala = "k"
[[peers.wireguard]]
device = "rp0"
peer = "some public key"
extra_params = ["foo"]

0 comments on commit 5348d70

Please sign in to comment.