From 3667246bf0d02fc416c06069dfef2f3e6c3ca3fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20K=C3=A4nner?= Date: Mon, 20 May 2024 20:37:11 +0200 Subject: [PATCH] 326 current 1970-01-01 01:00:00 23.11.20240518.e7cc617 6.6.30-rt30 * --- hosts/MaxNixosLaptop/configuration.nix | 1 + modules/nixos/sway.nix | 80 ++++++++++++-------------- 2 files changed, 38 insertions(+), 43 deletions(-) diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index 44612ae..7599fa9 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -18,6 +18,7 @@ greetd.enable = true; wifi.enable = true; wifi.tray = true; + sway.enable = true; hardware.opengl = { enable = true; diff --git a/modules/nixos/sway.nix b/modules/nixos/sway.nix index b445c73..0a361cd 100644 --- a/modules/nixos/sway.nix +++ b/modules/nixos/sway.nix @@ -3,50 +3,44 @@ config, pkgs, ... -}: { - environment.systemPackages = with pkgs; [ - dbus # make dbus-update-activation-environment available in the path - wayland - xdg-utils # for opening default programs when clicking links - glib # gsettings - dracula-theme # gtk theme - gnome3.adwaita-icon-theme # default gnome cursors - swaylock - swayidle - grim # screenshot functionality - slurp # screenshot functionality - wl-clipboard # wl-copy and wl-paste for copy/paste from stdin/stdout - mako # notification system developed by swaywm maintainer - wdisplays # tool to configure displays - libnotify - ]; - - # xdg-desktop-portal works by exposing a series of D-Bus interfaces - # known as portals under a well-known name - # (org.freedesktop.portal.Desktop) and object path - # (/org/freedesktop/portal/desktop). - # The portal interfaces include APIs for file access, opening URIs, - # printing and others. - services.dbus.enable = true; - xdg.portal = { - enable = true; - wlr.enable = true; - config.common.default = ["wlr" "gtk"]; - # gtk portal needed to make gtk apps happy - extraPortals = [pkgs.xdg-desktop-portal-gtk]; +}: let + cfg = config.sway; +in { + options = { + sway.enable = lib.mkEnableOption "sway"; }; - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; + config = lib.mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + dbus # make dbus-update-activation-environment available in the path + libnotify + ]; + + # xdg-desktop-portal works by exposing a series of D-Bus interfaces + # known as portals under a well-known name + # (org.freedesktop.portal.Desktop) and object path + # (/org/freedesktop/portal/desktop). + # The portal interfaces include APIs for file access, opening URIs, + # printing and others. + services.dbus.enable = true; + xdg.portal = { + enable = true; + wlr.enable = true; + config.common.default = ["wlr" "gtk"]; + # gtk portal needed to make gtk apps happy + extraPortals = [pkgs.xdg-desktop-portal-gtk]; + }; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; + + # make brightness keys work + users.users.max.extraGroups = ["video" "input"]; + programs.light.enable = true; + + # make swaylock work + security.pam.services.swaylock = {}; }; - - # make brightness keys work - users.users.max.extraGroups = ["video"]; - programs.light.enable = true; - - # make swaylock work - security.pam.services.swaylock = {}; - - users.extraUsers.max.extraGroups = ["input"]; }