From b03389876131c34f40af7b9599f55f23df1cb8d5 Mon Sep 17 00:00:00 2001 From: Tomate0613 <69756782+Tomate0613@users.noreply.github.com> Date: Wed, 11 Feb 2026 16:55:57 +0100 Subject: [PATCH] validate config in home-manager --- nix/hm-modules.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nix/hm-modules.nix b/nix/hm-modules.nix index 85d57908..45db801f 100644 --- a/nix/hm-modules.nix +++ b/nix/hm-modules.nix @@ -12,6 +12,13 @@ self: { ${lib.optionalString cfg.systemd.enable systemdActivation} ${cfg.autostart_sh} ''; + validatedConfig = pkgs.runCommand "mango-config.conf" { } '' + cat > "$out" <<'EOF' + ${cfg.settings} + EOF + + ${cfg.package}/bin/mango -c "$out" -p || exit 1 + ''; in { options = { wayland.windowManager.mango = with lib; { @@ -99,7 +106,7 @@ in { home.packages = [cfg.package]; xdg.configFile = { "mango/config.conf" = lib.mkIf (cfg.settings != "") { - text = cfg.settings; + source = validatedConfig; }; "mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") { source = autostart_sh;