mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
parent
964f698095
commit
99b75f99df
6 changed files with 23 additions and 11 deletions
|
@ -290,6 +290,21 @@ 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;
|
||||
|
@ -394,7 +409,7 @@ in {
|
|||
home.packages = optional (cfg.package != null) cfg.package
|
||||
++ optional cfg.xwayland pkgs.xwayland;
|
||||
xdg.configFile."sway/config" = {
|
||||
source = configFile;
|
||||
source = checkSwayConfig;
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -10,7 +10,8 @@ in {
|
|||
config = {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = dummy-package // { outPath = "@sway"; };
|
||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
||||
|
||||
# overriding findutils causes issues
|
||||
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@ in {
|
|||
config = {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = dummy-package // { outPath = "@sway"; };
|
||||
package = pkgs.writeScriptBin "sway" "";
|
||||
|
||||
config = {
|
||||
focus.followMouse = false;
|
||||
|
@ -26,10 +26,6 @@ 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@"; };
|
||||
})
|
||||
|
|
|
@ -10,7 +10,7 @@ in {
|
|||
config = {
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = dummy-package // { outPath = "@sway"; };
|
||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
||||
|
||||
config = {
|
||||
focus.followMouse = "always";
|
||||
|
@ -26,7 +26,6 @@ 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@"; };
|
||||
})
|
||||
|
|
|
@ -12,7 +12,8 @@ in {
|
|||
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
package = dummy-package // { outPath = "@sway"; };
|
||||
package = pkgs.writeScriptBin "sway" "" // { outPath = "@sway@"; };
|
||||
|
||||
# overriding findutils causes issues
|
||||
config.menu = "${pkgs.dmenu}/bin/dmenu_run";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue