This commit is contained in:
Tomate 06 13 2026-02-01 19:25:55 +00:00 committed by GitHub
commit 009e49d5a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,6 +12,18 @@ self: {
${lib.optionalString cfg.systemd.enable systemdActivation}
${cfg.autostart_sh}
'';
validatedConfig = pkgs.runCommand "mango-config.conf" { } ''
cat > "$out" <<'EOF'
${cfg.settings}
EOF
output=$(${cfg.package}/bin/mango -c "$out" -p 2>&1 || true)
if echo "$output" | grep -Fq '[ERROR]:'; then
echo "$output"
exit 1
fi
'';
in {
options = {
wayland.windowManager.mango = with lib; {
@ -99,7 +111,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;