fix: NixOS module: generate /etc/headplane/config.yaml from services.headplane.settings

This commit is contained in:
Igor Ramazanov 2025-03-11 20:13:02 +00:00
parent c526459cef
commit a9b0ca3464

View File

@ -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;