From 63a33662ef1fd50d8a6a2063537be87ca35f43a6 Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Tue, 8 Jul 2025 15:03:40 -0400 Subject: [PATCH] Sway phase 1 --- home-manager/modules/programs/sway.nix | 24 ++++++++++++++++++++++++ nixos/machines/crash/machine.nix | 1 + nixos/machines/swarm/configuration.nix | 13 +++++++------ 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100644 home-manager/modules/programs/sway.nix diff --git a/home-manager/modules/programs/sway.nix b/home-manager/modules/programs/sway.nix new file mode 100644 index 0000000..e2a6452 --- /dev/null +++ b/home-manager/modules/programs/sway.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + inputs', + ... +}: { + home.packages = with pkgs; [ + inputs'.nixpkgs-unstable.legacyPackages.xwayland-satellite + ]; + wayland.windowManger.sway = { + enable = true; + package = null; + sway = { + xwayland = false; + config = { + modifer = "Mod4"; + startup = [ + {command = "env DISPLAY=:0 xwayland-satellite";} + ]; + }; + }; + }; +} diff --git a/nixos/machines/crash/machine.nix b/nixos/machines/crash/machine.nix index 940e90b..87948e2 100644 --- a/nixos/machines/crash/machine.nix +++ b/nixos/machines/crash/machine.nix @@ -39,6 +39,7 @@ # Our modules (import ../../modules/base.nix {inherit inputs;}) (import ../../modules/desktop.nix) + (import ../../modules/sway.nix) (import ./configuration.nix) (import ./hardware.nix) (import ../../modules/user.nix { diff --git a/nixos/machines/swarm/configuration.nix b/nixos/machines/swarm/configuration.nix index 6f6e409..e1403e7 100644 --- a/nixos/machines/swarm/configuration.nix +++ b/nixos/machines/swarm/configuration.nix @@ -4,6 +4,7 @@ { config, pkgs, + inputs', ... }: { imports = [ @@ -100,6 +101,12 @@ services.displayManager.sddm.enable = true; services.desktopManager.plasma6.enable = true; environment.sessionVariables.NIXOS_OZONE_WL = "1"; + # Enable swaywm + programs.sway = { + enable = true; + package = inputs'.swayfx.default; + wrapperFeatures.gtk = true; + }; # Setup bluetooth hardware.bluetooth.enable = true; @@ -169,12 +176,6 @@ virtualisation.podman = {enable = true;}; - # Enable sway - programs.sway = { - enable = true; - package = pkgs.swayfx; - }; - # We need to use a fork of iptsd for the LiftTimeout option # https://github.com/linux-surface/iptsd/issues/166#issuecomment-2391567615 nixpkgs.overlays = let