1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

sway: print hint when checking the config file fails (#7665)

This commit is contained in:
Edwin Mackenzie-Owen 2025-09-24 03:20:06 +02:00 committed by GitHub
parent 131f4e22c3
commit 676c0159ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -429,7 +429,12 @@ let
checkPhase = lib.optionalString cfg.checkConfig ''
export DBUS_SESSION_BUS_ADDRESS=/dev/null
export XDG_RUNTIME_DIR=$(mktemp -d)
${pkgs.xvfb-run}/bin/xvfb-run ${cfg.package}/bin/sway --config "$target" --validate --unsupported-gpu
${pkgs.xvfb-run}/bin/xvfb-run ${cfg.package}/bin/sway --config "$target" --validate --unsupported-gpu || {
echo "Checking the sway config file failed. Normally, this happens because there are errors in the config file."
echo "But the check can also fail if the sway config file has dependencies on configuration that is not available in the Nix build sandbox (e.g. custom keyboard layouts defined in the NixOS configuration; background images in the user's home directory)."
echo "In that case, it may be necessary to set 'wayland.windowManager.sway.checkConfig = false;'."
exit 1
}
'';
text = concatStringsSep "\n" (