From b39aae582afbbfb89c0a0b0e0b6b7b34773063d6 Mon Sep 17 00:00:00 2001 From: blahai Date: Fri, 25 Oct 2024 18:54:42 +0300 Subject: [PATCH] my poor attempt at fixing sops (still doesn't work) --- modules/nixos/services/cloudflared.nix | 10 +++++----- secrets/secrets.nix | 10 ++++++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/nixos/services/cloudflared.nix b/modules/nixos/services/cloudflared.nix index 457d5ac..03d99a9 100644 --- a/modules/nixos/services/cloudflared.nix +++ b/modules/nixos/services/cloudflared.nix @@ -1,8 +1,8 @@ -{ pkgs, inputs, ... }: -let - secrets = import ../../../secrets/secrets.nix; -in +{ lib, config, pkgs, inputs, ... }: { + imports = [ + ../../../secrets/secrets.nix + ]; users.users.cloudflared = { group = "cloudflared"; @@ -14,7 +14,7 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" "systemd-resolved.service" ]; serviceConfig = { - ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate run --token=${secrets.cloudflared.nyx.token}"; + ExecStart = "${pkgs.cloudflared}/bin/cloudflared tunnel --no-autoupdate run --token=${sops.secrets.cloudflared.nyx.token}"; Restart = "always"; User = "cloudflared"; Group = "cloudflared"; diff --git a/secrets/secrets.nix b/secrets/secrets.nix index 19c6c81..0e5e705 100644 --- a/secrets/secrets.nix +++ b/secrets/secrets.nix @@ -1,12 +1,14 @@ -{ pkgs, inputs, config, ... }: +{ inputs, lib, ... }: { - imports = [ - inputs.sops-nix.nixosModules.sops - ]; + imports = [ inputs.sops-nix.nixosModules.sops ]; sops = { defaultSopsFile = ./secrets.yaml; defaultSopsFormat = "yaml"; age.keyFile = "/home/pingu/.config/sops/age/keys.txt"; + + secrets = { + cloudflared.nyx.token = {}; + }; }; }