mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-02-10 04:27:57 -05:00
Merge d683e551b4 into 2a76ff4153
This commit is contained in:
commit
009e49d5a0
1 changed files with 13 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue