From dcb2d428d774d9084e1939aaf61b7e69510e22ef Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Thu, 2 Mar 2023 16:00:19 +0300 Subject: [PATCH] machines: add wireguard vpn --- .agenix_config.nix | Bin 2867 -> 3835 bytes machines/asus-gl553vd/default.nix | 10 +++ machines/canigou/data.secret.nix | Bin 0 -> 53 bytes machines/canigou/default.nix | 2 + machines/canigou/services/wireguard.nix | 62 +++++++++++++++++++ machines/default.nix | 15 +---- machines/home/default.nix | 13 ++++ machines/magenta/data.secret.nix | Bin 0 -> 52 bytes machines/modules/nix.nix | 2 +- machines/modules/wireguard-client.nix | 68 +++++++++++++++++++++ notes/vpn.md | 13 ++++ secrets/wireguard-asus-gl553vd-private.age | Bin 0 -> 1607 bytes secrets/wireguard-canigou-private.age | Bin 0 -> 1379 bytes secrets/wireguard-home-private.age | Bin 0 -> 1524 bytes 14 files changed, 171 insertions(+), 14 deletions(-) create mode 100644 machines/canigou/data.secret.nix create mode 100644 machines/canigou/services/wireguard.nix create mode 100644 machines/magenta/data.secret.nix create mode 100644 machines/modules/wireguard-client.nix create mode 100644 notes/vpn.md create mode 100644 secrets/wireguard-asus-gl553vd-private.age create mode 100644 secrets/wireguard-canigou-private.age create mode 100644 secrets/wireguard-home-private.age diff --git a/.agenix_config.nix b/.agenix_config.nix index 057da6e31686b3e4b4b1bb08046e790d25f3d8c3..00829bef89ae537314b50e8921ef13743425e4bb 100644 GIT binary patch literal 3835 zcmV0OPGDsG4o zfz@_*>F1{pxrct2JQ0Pb5PQb%r3?yZEtwM=z;u{YjDMv=uYTaq39eKX2I!j48XuAK zTMMVt;q7!wey_1qS>-+v{Um%Lc=|*bC}%Bi*x*O^>axG{$71fnG3d2hs%-Mh{h$69 zVPhwO@5*)w9fttanW-`28!2;BGjd!BbgAY`Rb0ws0&Qa^m&T2Nuw7t38i-0oztC^s-k&Rn9M zSAY}#*UFXp6;?t=E|d-GzcPIf6v@NHx;Z)t7&l!}#@Jgi;v33P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 zT*3Dvp+n`i>Gy-?z%9#8k==xL(f`s^ ./private +wg pubkey < ./private > ./public +``` + +# References: + +- https://nixos.wiki/wiki/WireGuard diff --git a/secrets/wireguard-asus-gl553vd-private.age b/secrets/wireguard-asus-gl553vd-private.age new file mode 100644 index 0000000000000000000000000000000000000000..dcb8766edb83d67be44c9017fa5a2b6ef3fa6931 GIT binary patch literal 1607 zcmV-N2DteEM@dveQdv+`0O&jCkdDL3OgrB=-%E!5PSmrKJf4b#n{$VR7cB^$r^3SOqQVE#(E$4IZt#+O|j{6~)x7PTvEiJxXFlDZwOEJtGYNSt^7 z%660upSn4^+a;Way#bNY5kMn}CGC9Jd75J|lRFtEZ0~XgZaocA(xVMhNlXFS@yF-c zvGH>`!CB3M3Tz0C=TN!~@*qo`=7?5%?*p5zg1zHl^=vT?4FEK9-WOdoH8$X7bjE_p>Q7hTl#p7ms#{#@QmreaYFWWlS>5UBHC^4 zT_=NYH;pYwr^r~)MHh)1SMX4CQOm||(H*p|;o|c6v{n9Vcn7W?m^;$Bf*9CSCcMX& z6SR#~mG0Wr9A1DBI9)iA#Rc#H!rvf{!@hraV|`2d*apaBl2gM=n|H z6iUbz=(FK{5|rZOFzXcp?Rx$6B=XiSuw=5IkJ*N;x5x_X2+IQ;wytWv zL!Lv=DT9@KDS>`F|R4)-nip%E;$h@61UA*f5piQOMx0cdUk50_h(VZ$`#yWf0Hj?>}hZzm69B zSjP>YgFh39j$K%5DDI0^PWRB<&5{YPMWSI%F3q8mJoj)JhKeeytme^Fd?J@8mN5eC zqe*^mQtFC$G^lcgcRi9y9E=Nkco|h&d#g;i`Db^0#P7I;b6@g6X4vJuw_%gf9b5u7 z$czauaXu=78qm2*=G+xY;CDI?TUm=|N+tiaOPSY*mU+Ml#-7mB_mrT0Xwk#=*lF?V2+%=wep|ea)~`F*{{WyWHG}hP1V>J6 FpzI>^BrX5| literal 0 HcmV?d00001 diff --git a/secrets/wireguard-canigou-private.age b/secrets/wireguard-canigou-private.age new file mode 100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