From 4abefb081170c0670122723ada3faaf7a0f61b5c Mon Sep 17 00:00:00 2001 From: oddlama Date: Sat, 10 Jun 2023 02:00:08 +0200 Subject: [PATCH] fix: wireguard generator pipe issue --- flake.lock | 4 ++-- hosts/ward/promtail.nix | 6 ------ modules/wireguard.nix | 6 +++--- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 7638077..4110aee 100644 --- a/flake.lock +++ b/flake.lock @@ -347,8 +347,8 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685290091, - "narHash": "sha256-Shhg4EstYivzF10RuNDUKw3KGQOS5e7S7yHFnWuJQSI=", + "lastModified": 1686226982, + "narHash": "sha256-jsVFb4XxVdHvCA/OAuJA8tdPVf+jvm/eZLUZS4FoBGY=", "type": "git", "url": "file:///root/projects/nixpkgs-test" }, diff --git a/hosts/ward/promtail.nix b/hosts/ward/promtail.nix index 57996a0..2676039 100644 --- a/hosts/ward/promtail.nix +++ b/hosts/ward/promtail.nix @@ -16,12 +16,6 @@ in { group = "promtail"; }; - #age.secrets.loki-basic-auth-password = { - # generate = "alnum48"; - # mode = "440"; - # group = "promtail"; - #}; - services.promtail = { enable = true; configuration = { diff --git a/modules/wireguard.nix b/modules/wireguard.nix index 951fb84..08a2493 100644 --- a/modules/wireguard.nix +++ b/modules/wireguard.nix @@ -171,9 +171,9 @@ file, ... }: '' - ${pkgs.wireguard-tools}/bin/wg genkey \ - | tee /dev/stdout \ - | ${pkgs.wireguard-tools}/bin/wg pubkey > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")} + priv=$(${pkgs.wireguard-tools}/bin/wg genkey) + ${pkgs.wireguard-tools}/bin/wg pubkey <<< "$priv" > ${lib.escapeShellArg (lib.removeSuffix ".age" file + ".pub")} + echo "$priv" ''; }; };