From 6176d81faef49eb1b987b0d1468d755772b844a0 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 15 Aug 2024 13:43:40 +0200 Subject: [PATCH] feat: host octoprint on laptop --- config/services/octoprint.nix | 8 ++++++++ hosts/elisabeth/guests.nix | 4 ++-- hosts/patricknix/default.nix | 2 ++ secrets/wireguard/elisabeth/keys/patricknix.age | 16 ++++++++++++++++ secrets/wireguard/elisabeth/keys/patricknix.pub | 1 + .../elisabeth/psks/elisabeth+patricknix.age | Bin 0 -> 824 bytes 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 secrets/wireguard/elisabeth/keys/patricknix.age create mode 100644 secrets/wireguard/elisabeth/keys/patricknix.pub create mode 100644 secrets/wireguard/elisabeth/psks/elisabeth+patricknix.age diff --git a/config/services/octoprint.nix b/config/services/octoprint.nix index 20afa0f..366f7be 100644 --- a/config/services/octoprint.nix +++ b/config/services/octoprint.nix @@ -4,6 +4,14 @@ client.via = "elisabeth"; firewallRuleForNode.elisabeth.allowedTCPPorts = [ config.services.octoprint.port ]; }; + environment.persistence."/persist".directories = [ + { + directory = "/var/lib/octoprint/"; + user = "octoprint"; + group = "octoprint"; + mode = "750"; + } + ]; services.octoprint = { port = 3000; enable = true; diff --git a/hosts/elisabeth/guests.nix b/hosts/elisabeth/guests.nix index 48b851a..eedaa8c 100644 --- a/hosts/elisabeth/guests.nix +++ b/hosts/elisabeth/guests.nix @@ -36,8 +36,8 @@ let # TODO hard coded elisabeth nicht so schön ipOf = hostName: - if nodes ? ${hostName} then - nodes.${hostName}.config.wireguard.elisabeth.ipv4 + if hostName == "octoprint" then + nodes.patricknix.config.wireguard.elisabeth.ipv4 else nodes."elisabeth-${hostName}".config.wireguard.elisabeth.ipv4; in diff --git a/hosts/patricknix/default.nix b/hosts/patricknix/default.nix index 0aea02d..c21b84c 100644 --- a/hosts/patricknix/default.nix +++ b/hosts/patricknix/default.nix @@ -18,6 +18,8 @@ ../../config/hardware/prime-offload.nix ../../config/hardware/yubikey.nix + ../../config/services/octoprint.nix + ../../config/optional/dev.nix ../../config/optional/graphical.nix ../../config/optional/printing.nix diff --git a/secrets/wireguard/elisabeth/keys/patricknix.age b/secrets/wireguard/elisabeth/keys/patricknix.age new file mode 100644 index 0000000..e8197bb --- /dev/null +++ b/secrets/wireguard/elisabeth/keys/patricknix.age @@ -0,0 +1,16 @@ +age-encryption.org/v1 +-> X25519 kZNXioiEjSwPSSCQfLIUHJ/Po3Kjyzexkm9JOT02CUU +ZDtL78nQ9iM5br5keKL/HuuLO31giHa40m5YhoNkeN8 +-> piv-p256 ZFgiIw AgNxOYUDaV1QTaV+IyMF09gouj/UtJA+y8H9h/MrgVM1 +luS8js59wJ3cfsEloakGvoMmMWNkkq3Rc/AAvbxCA0I +-> piv-p256 XTQkUA A97+iI4FmLSEqnBpW7MJDFocMQBnv1yl5sNPLsZzapzP +CEmzOhcv6V6OGC3fpP8pUomlIRZxj05TQyYdDEtVwbI +-> piv-p256 ZFgiIw Az7qLW7ASn9x4PQt5yswl6BWULosp8j9D1sIlYe+E+XW +g80n2hOdx1m8pw8jeCFPHOH34bOApNVxapgiQj13USc +-> piv-p256 5vmPtQ Aj9Px4PctikcatMGBt7PTghHWLGtUXu0dbWUBROppbnX +5uYv5eEaZ6nfaId6JUaQSjbwTwZ+uyv7wSppAFZFnAM +-> )K-#NG;f-grease w] Do +Jlm3URc6Elpr7TIlK8e5K6Xu1Xy1f/mpG6XgdWgPRbNNOf0dXddDRuFT3g6lf6tK +FVmTXrLndZmPq33DD0WP6MwtBWmDCeh59/3DpjmvSxppM6Q +--- Pj8J65gm8i3w3GErpi1PXNdeQs/8cGkG2vetkgOifis +mBF GpRbe:8iG8Uyl +V`014+B& \ No newline at end of file diff --git a/secrets/wireguard/elisabeth/keys/patricknix.pub b/secrets/wireguard/elisabeth/keys/patricknix.pub new file mode 100644 index 0000000..89065f3 --- /dev/null +++ b/secrets/wireguard/elisabeth/keys/patricknix.pub @@ -0,0 +1 @@ +2l6LxDMuuo+vr3aAraMbaVrCMHbWNNIujpwjDD/UPWA= diff --git a/secrets/wireguard/elisabeth/psks/elisabeth+patricknix.age b/secrets/wireguard/elisabeth/psks/elisabeth+patricknix.age new file mode 100644 index 0000000000000000000000000000000000000000..e6569dfd4a754d7110c161e4b92bb4e8e3f26806 GIT binary patch literal 824 zcmY+_J|^SvNtJemS7HB2DB^BfEO27turTKP2}xiLof;z=_XV}m=`gHJHzssO zEDJ#pn_Ac?mT%A9$YYQt9}EFr_5&|(Rg1sGiKN9(v>vi7zO73aCC1ux2Pjt9HOo4v zS2{T%G0GpbwjH)+9*h-j*%`1UuxfS)X6y;@F#;J-u^1Ry@{cA-DO~o6kIjz0h=H@J2AsG5xh3Lh`DnarVU2^Wf!4`_*7D=D~U;a#dU>V#aI<ie+1haBt=c-|-!J ziFV@FLKF4O*qds$epso91B%$Uh- z95IJIo+xbUQO*_xOJ*?`2r`{cCwc_W*vU}Ou)vO