add config for sway

This commit is contained in:
Tim Schubert 2022-10-31 14:39:23 +01:00
parent 8f4ffd1d45
commit 4982dbdb5a
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
4 changed files with 45 additions and 0 deletions

View file

@ -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; })
// {

View file

@ -51,6 +51,7 @@ in
};
vpnExtension = "3";
};
sway.enable = true;
};
boot.kernel.sysctl = {

View file

@ -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;

40
nixos/modules/sway.nix Normal file
View file

@ -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
'';
};
};
}