From a9b0ca34649d015eb9d50fda1b5e0e86392a0d47 Mon Sep 17 00:00:00 2001 From: Igor Ramazanov Date: Tue, 11 Mar 2025 20:13:02 +0000 Subject: [PATCH] fix: NixOS module: generate `/etc/headplane/config.yaml` from `services.headplane.settings` --- nix/module.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nix/module.nix b/nix/module.nix index 3cb635e..32ecd53 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -6,7 +6,6 @@ }: let inherit (lib) - mapAttrs mkEnableOption mkIf mkOption @@ -57,6 +56,11 @@ in { config = mkIf cfg.enable { environment.systemPackages = [cfg.package]; + environment.etc."headplane/config.yaml".source = let + format = pkgs.formats.yaml {}; + headplaneConfig = format.generate "headplane-config.yaml" cfg.settings; + in "${headplaneConfig}"; + systemd.services.headplane-agent = mkIf cfg.agent.enable { @@ -94,8 +98,6 @@ in { after = ["headscale.service"]; requires = ["headscale.service"]; - environment = mapAttrs (_: toString) cfg.settings; - serviceConfig = { User = config.services.headscale.user; Group = config.services.headscale.group;