From 7b6ebf2785cfc9dd6fc2b101cbbb2152eb68d45c Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 17 Nov 2020 18:43:20 +0100 Subject: [PATCH] Revert "sway: validate configuration at build time" This reverts commit 99b75f99dfaaefc45ae2c9df5b5818149f26baa3. See https://github.com/nix-community/home-manager/issues/1613 and https://github.com/nix-community/home-manager/pull/1614 for associated discussions. --- .../services/window-managers/i3-sway/sway.nix | 17 +---------------- .../window-managers/sway/sway-default.conf | 2 +- .../window-managers/sway/sway-default.nix | 3 +-- .../sway/sway-followmouse-legacy.nix | 6 +++++- .../window-managers/sway/sway-followmouse.nix | 3 ++- .../window-managers/sway/sway-post-2003.nix | 3 +-- 6 files changed, 11 insertions(+), 23 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 2e85c0f73..14d82d267 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -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 diff --git a/tests/modules/services/window-managers/sway/sway-default.conf b/tests/modules/services/window-managers/sway/sway-default.conf index 5d3c5c609..da5b1f47e 100644 --- a/tests/modules/services/window-managers/sway/sway-default.conf +++ b/tests/modules/services/window-managers/sway/sway-default.conf @@ -92,7 +92,7 @@ bar { hidden_state hide position bottom status_command @i3status@/bin/i3status - swaybar_command @sway@/bin/swaybar + swaybar_command @sway/bin/swaybar workspace_buttons yes strip_workspace_numbers no tray_output primary diff --git a/tests/modules/services/window-managers/sway/sway-default.nix b/tests/modules/services/window-managers/sway/sway-default.nix index 7c7aabc48..0ccedbfda 100644 --- a/tests/modules/services/window-managers/sway/sway-default.nix +++ b/tests/modules/services/window-managers/sway/sway-default.nix @@ -10,8 +10,7 @@ in { config = { wayland.windowManager.sway = { enable = true; - package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; }; - + package = dummy-package // { outPath = "@sway"; }; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; }; diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix b/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix index 306202bad..9ed0ceaf0 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix @@ -10,7 +10,7 @@ in { config = { wayland.windowManager.sway = { enable = true; - package = pkgs.writeScriptBin "sway" ""; + package = dummy-package // { outPath = "@sway"; }; config = { focus.followMouse = false; @@ -26,6 +26,10 @@ in { outPath = "@rxvt-unicode-unwrapped@"; }; sway = dummy-package // { outPath = "@sway@"; }; + sway-unwrapped = dummy-package // { + outPath = "@sway-unwrapped@"; + version = "1"; + }; swaybg = dummy-package // { outPath = "@swaybg@"; }; xwayland = dummy-package // { outPath = "@xwayland@"; }; }) diff --git a/tests/modules/services/window-managers/sway/sway-followmouse.nix b/tests/modules/services/window-managers/sway/sway-followmouse.nix index 41c27510e..8d54eccf7 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse.nix +++ b/tests/modules/services/window-managers/sway/sway-followmouse.nix @@ -10,7 +10,7 @@ in { config = { wayland.windowManager.sway = { enable = true; - package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; }; + package = dummy-package // { outPath = "@sway"; }; config = { focus.followMouse = "always"; @@ -26,6 +26,7 @@ in { outPath = "@rxvt-unicode-unwrapped@"; }; sway = dummy-package // { outPath = "@sway@"; }; + sway-unwrapped = dummy-package // { version = "1"; }; swaybg = dummy-package // { outPath = "@swaybg@"; }; xwayland = dummy-package // { outPath = "@xwayland@"; }; }) diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.nix b/tests/modules/services/window-managers/sway/sway-post-2003.nix index 4006b6a8a..740e7e526 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.nix +++ b/tests/modules/services/window-managers/sway/sway-post-2003.nix @@ -12,8 +12,7 @@ in { wayland.windowManager.sway = { enable = true; - package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; }; - + package = dummy-package // { outPath = "@sway"; }; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; };