From 4982dbdb5ae6d1d01935029afcb55389f3f85184 Mon Sep 17 00:00:00 2001 From: dadada Date: Mon, 31 Oct 2022 14:39:23 +0100 Subject: [PATCH] add config for sway --- home/home/default.nix | 3 +++ nixos/gorgon/configuration.nix | 1 + nixos/modules/default.nix | 1 + nixos/modules/sway.nix | 40 ++++++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) create mode 100644 nixos/modules/sway.nix diff --git a/home/home/default.nix b/home/home/default.nix index 44f5ca5..ada8352 100644 --- a/home/home/default.nix +++ b/home/home/default.nix @@ -31,6 +31,9 @@ in programs.gpg.settings.default-key = "99658A3EB5CD7C13"; + # Sway is configured in .#nixosModules.dadada.sway + home.file.".config/sway/config" = ../modules/sway/config; + dadada.home = lib.attrsets.genAttrs useFeatures (useFeatures: { enable = true; }) // { diff --git a/nixos/gorgon/configuration.nix b/nixos/gorgon/configuration.nix index 9c5fe21..438a2db 100644 --- a/nixos/gorgon/configuration.nix +++ b/nixos/gorgon/configuration.nix @@ -51,6 +51,7 @@ in }; vpnExtension = "3"; }; + sway.enable = true; }; boot.kernel.sysctl = { diff --git a/nixos/modules/default.nix b/nixos/modules/default.nix index 834470e..9b0bbc9 100644 --- a/nixos/modules/default.nix +++ b/nixos/modules/default.nix @@ -18,6 +18,7 @@ secrets = import ./secrets.nix; share = import ./share.nix; steam = import ./steam.nix; + sway = import ./sway.nix; update = import ./update.nix; vpnServer = import ./vpnServer.nix; weechat = import ./weechat.nix; diff --git a/nixos/modules/sway.nix b/nixos/modules/sway.nix new file mode 100644 index 0000000..190d13e --- /dev/null +++ b/nixos/modules/sway.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.dadada.sway; +in +{ + options = { + dadada.sway.enable = lib.mkEnableOption "Enable sway"; + }; + + config = lib.mkIf cfg.enable { + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + wrapperFeatures.base = true; + extraPackages = with pkgs; [ + qt5.qtwayland + swayidle + xwayland + mako + kanshi + kitty + i3status + bemenu + xss-lock + swaylock + brightnessctl + playerctl + ]; + extraSessionCommands = '' + export SDL_VIDEODRIVER=wayland + # needs qt5.qtwayland in systemPackages + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" + # Fix for some Java AWT applications (e.g. Android Studio), + # use this if they aren't displayed properly: + export _JAVA_AWT_WM_NONREPARENTING=1 + ''; + }; + }; +}