summaryrefslogtreecommitdiff
path: root/os/kay/modules/wireguard.nix
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2025-06-10 15:55:54 +0530
committersinanmohd <sinan@sinanmohd.com>2025-06-10 22:55:04 +0530
commita41037ef644dbacb3d577933fb3d93c210439b38 (patch)
treea262750bcb1357785ad8cb68b232a5ca242ee671 /os/kay/modules/wireguard.nix
parentcfccbd1e4026d568e23a47c060ae3ae042cceb4c (diff)
chore(repo): reformat with nixfmt-rfc-style
Diffstat (limited to 'os/kay/modules/wireguard.nix')
-rw-r--r--os/kay/modules/wireguard.nix33
1 files changed, 22 insertions, 11 deletions
diff --git a/os/kay/modules/wireguard.nix b/os/kay/modules/wireguard.nix
index 21cec06..ae42930 100644
--- a/os/kay/modules/wireguard.nix
+++ b/os/kay/modules/wireguard.nix
@@ -1,4 +1,10 @@
-{ config, pkgs, lib, ... }: let
+{
+ config,
+ pkgs,
+ lib,
+ ...
+}:
+let
wgInterface = "wg";
wanInterface = "ppp0";
subnet = "10.0.1.0";
@@ -10,13 +16,17 @@
Address = 10.0.1.1/24
MTU = 1412
ListenPort = 51820
- PostUp = ${lib.getExe (pkgs.writeShellApplication {
- name = "wg_set_key";
- runtimeInputs = with pkgs; [ wireguard-tools ];
- text = ''
- wg set ${wgInterface} private-key <(cat ${config.sops.secrets."misc/wireguard".path})
- '';
- })}
+ PostUp = ${
+ lib.getExe (
+ pkgs.writeShellApplication {
+ name = "wg_set_key";
+ runtimeInputs = with pkgs; [ wireguard-tools ];
+ text = ''
+ wg set ${wgInterface} private-key <(cat ${config.sops.secrets."misc/wireguard".path})
+ '';
+ }
+ )
+ }
[Peer]
# friendly_name = cez
@@ -43,8 +53,9 @@
PublicKey = U6+PzFuM6lKVx0TnDWuWJMsP6Tj8o1a9zjRcD7gV53o=
AllowedIPs = 10.0.1.6/32
'';
-in {
- sops.secrets."misc/wireguard" = {};
+in
+{
+ sops.secrets."misc/wireguard" = { };
networking = {
nat = {
@@ -59,7 +70,7 @@ in {
services.dnsmasq.settings = {
no-dhcp-interface = wgInterface;
- interface = [ wgInterface ];
+ interface = [ wgInterface ];
};
services.prometheus.exporters.wireguard = {