1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-09 10:31:06 +01:00

Revert "sway: validate configuration at build time"

This reverts commit 99b75f99df. See

  https://github.com/nix-community/home-manager/issues/1613 and
  https://github.com/nix-community/home-manager/pull/1614

for associated discussions.
This commit is contained in:
Robert Helgesson 2020-11-17 18:43:20 +01:00
parent 6dc68b1d16
commit 7b6ebf2785
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
6 changed files with 11 additions and 23 deletions

View file

@ -290,21 +290,6 @@ let
'' else
"") + cfg.extraConfig);
# Validates the Sway configuration
checkSwayConfig =
pkgs.runCommandLocal "sway-config" { buildInputs = [ cfg.package ]; } ''
# We have to make sure the wrapper does not start a dbus session
export DBUS_SESSION_BUS_ADDRESS=1
# A zero exit code means Sway succesfully validated the configuration
sway --config ${configFile} --validate --debug || {
echo "Sway configuration validation failed"
echo "For a verbose log of the failure, run 'sway --config ${configFile} --validate --debug'"
exit 1
};
cp ${configFile} $out
'';
defaultSwayPackage = pkgs.sway.override {
extraSessionCommands = cfg.extraSessionCommands;
extraOptions = cfg.extraOptions;
@ -409,7 +394,7 @@ in {
home.packages = optional (cfg.package != null) cfg.package
++ optional cfg.xwayland pkgs.xwayland;
xdg.configFile."sway/config" = {
source = checkSwayConfig;
source = configFile;
onChange = ''
swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway || ${pkgs.coreutils}/bin/true).sock
if [ -S $swaySocket ]; then