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 1/2] 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; From f3498691aad1cd09c0f2d39c86a79993fdded31f Mon Sep 17 00:00:00 2001 From: Tomate0613 <69756782+Tomate0613@users.noreply.github.com> Date: Wed, 25 Feb 2026 14:52:39 +0100 Subject: [PATCH 2/2] use pkgs.writeText --- nix/hm-modules.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/nix/hm-modules.nix b/nix/hm-modules.nix index 45db801f..68ed3b3d 100644 --- a/nix/hm-modules.nix +++ b/nix/hm-modules.nix @@ -13,9 +13,7 @@ self: { ${cfg.autostart_sh} ''; validatedConfig = pkgs.runCommand "mango-config.conf" { } '' - cat > "$out" <<'EOF' - ${cfg.settings} - EOF + cp ${pkgs.writeText "mango-config.conf" cfg.settings} "$out" ${cfg.package}/bin/mango -c "$out" -p || exit 1 '';