mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +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:
parent
6dc68b1d16
commit
7b6ebf2785
6 changed files with 11 additions and 23 deletions
|
@ -290,21 +290,6 @@ let
|
||||||
'' else
|
'' else
|
||||||
"") + cfg.extraConfig);
|
"") + 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 {
|
defaultSwayPackage = pkgs.sway.override {
|
||||||
extraSessionCommands = cfg.extraSessionCommands;
|
extraSessionCommands = cfg.extraSessionCommands;
|
||||||
extraOptions = cfg.extraOptions;
|
extraOptions = cfg.extraOptions;
|
||||||
|
@ -409,7 +394,7 @@ in {
|
||||||
home.packages = optional (cfg.package != null) cfg.package
|
home.packages = optional (cfg.package != null) cfg.package
|
||||||
++ optional cfg.xwayland pkgs.xwayland;
|
++ optional cfg.xwayland pkgs.xwayland;
|
||||||
xdg.configFile."sway/config" = {
|
xdg.configFile."sway/config" = {
|
||||||
source = checkSwayConfig;
|
source = configFile;
|
||||||
onChange = ''
|
onChange = ''
|
||||||
swaySocket=''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep -x sway || ${pkgs.coreutils}/bin/true).sock
|
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
|
if [ -S $swaySocket ]; then
|
||||||
|
|
|
@ -92,7 +92,7 @@ bar {
|
||||||
hidden_state hide
|
hidden_state hide
|
||||||
position bottom
|
position bottom
|
||||||
status_command @i3status@/bin/i3status
|
status_command @i3status@/bin/i3status
|
||||||
swaybar_command @sway@/bin/swaybar
|
swaybar_command @sway/bin/swaybar
|
||||||
workspace_buttons yes
|
workspace_buttons yes
|
||||||
strip_workspace_numbers no
|
strip_workspace_numbers no
|
||||||
tray_output primary
|
tray_output primary
|
||||||
|
|
|
@ -10,8 +10,7 @@ in {
|
||||||
config = {
|
config = {
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
package = dummy-package // { outPath = "@sway"; };
|
||||||
|
|
||||||
# overriding findutils causes issues
|
# overriding findutils causes issues
|
||||||
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,7 +10,7 @@ in {
|
||||||
config = {
|
config = {
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.writeScriptBin "sway" "";
|
package = dummy-package // { outPath = "@sway"; };
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
focus.followMouse = false;
|
focus.followMouse = false;
|
||||||
|
@ -26,6 +26,10 @@ in {
|
||||||
outPath = "@rxvt-unicode-unwrapped@";
|
outPath = "@rxvt-unicode-unwrapped@";
|
||||||
};
|
};
|
||||||
sway = dummy-package // { outPath = "@sway@"; };
|
sway = dummy-package // { outPath = "@sway@"; };
|
||||||
|
sway-unwrapped = dummy-package // {
|
||||||
|
outPath = "@sway-unwrapped@";
|
||||||
|
version = "1";
|
||||||
|
};
|
||||||
swaybg = dummy-package // { outPath = "@swaybg@"; };
|
swaybg = dummy-package // { outPath = "@swaybg@"; };
|
||||||
xwayland = dummy-package // { outPath = "@xwayland@"; };
|
xwayland = dummy-package // { outPath = "@xwayland@"; };
|
||||||
})
|
})
|
||||||
|
|
|
@ -10,7 +10,7 @@ in {
|
||||||
config = {
|
config = {
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
package = dummy-package // { outPath = "@sway"; };
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
focus.followMouse = "always";
|
focus.followMouse = "always";
|
||||||
|
@ -26,6 +26,7 @@ in {
|
||||||
outPath = "@rxvt-unicode-unwrapped@";
|
outPath = "@rxvt-unicode-unwrapped@";
|
||||||
};
|
};
|
||||||
sway = dummy-package // { outPath = "@sway@"; };
|
sway = dummy-package // { outPath = "@sway@"; };
|
||||||
|
sway-unwrapped = dummy-package // { version = "1"; };
|
||||||
swaybg = dummy-package // { outPath = "@swaybg@"; };
|
swaybg = dummy-package // { outPath = "@swaybg@"; };
|
||||||
xwayland = dummy-package // { outPath = "@xwayland@"; };
|
xwayland = dummy-package // { outPath = "@xwayland@"; };
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,8 +12,7 @@ in {
|
||||||
|
|
||||||
wayland.windowManager.sway = {
|
wayland.windowManager.sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
package = dummy-package // { outPath = "@sway"; };
|
||||||
|
|
||||||
# overriding findutils causes issues
|
# overriding findutils causes issues
|
||||||
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue