We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2a76ff4 commit d683e55Copy full SHA for d683e55
1 file changed
nix/hm-modules.nix
@@ -12,6 +12,18 @@ self: {
12
${lib.optionalString cfg.systemd.enable systemdActivation}
13
${cfg.autostart_sh}
14
'';
15
+ validatedConfig = pkgs.runCommand "mango-config.conf" { } ''
16
+ cat > "$out" <<'EOF'
17
+ ${cfg.settings}
18
+ EOF
19
+
20
+ output=$(${cfg.package}/bin/mango -c "$out" -p 2>&1 || true)
21
22
+ if echo "$output" | grep -Fq '[ERROR]:'; then
23
+ echo "$output"
24
+ exit 1
25
+ fi
26
+ '';
27
in {
28
options = {
29
wayland.windowManager.mango = with lib; {
@@ -99,7 +111,7 @@ in {
99
111
home.packages = [cfg.package];
100
112
xdg.configFile = {
101
113
"mango/config.conf" = lib.mkIf (cfg.settings != "") {
102
- text = cfg.settings;
114
+ source = validatedConfig;
103
115
};
104
116
"mango/autostart.sh" = lib.mkIf (cfg.autostart_sh != "") {
105
117
source = autostart_sh;
0 commit comments