add sway module

This commit is contained in:
Fabian Montero 2025-08-05 23:22:16 -06:00 committed by Alejandro Soto
parent 26619394f4
commit 8741b32021
No known key found for this signature in database
GPG key ID: A2C4C79764EE8F16
4 changed files with 64 additions and 1 deletions

View file

@ -1,3 +1,5 @@
{ {
imports = []; imports = [
./sway
];
} }

13
modules/sway/default.nix Normal file
View file

@ -0,0 +1,13 @@
{
config,
lib,
pkgs,
doctrine,
...
}:
doctrine.lib.mkModule {
inherit config;
name = "sway";
sys = ./sys.nix;
options = ./options.nix;
}

3
modules/sway/options.nix Normal file
View file

@ -0,0 +1,3 @@
{...}: {
sys = {};
}

45
modules/sway/sys.nix Normal file
View file

@ -0,0 +1,45 @@
{
pkgs,
lib,
...
}: {
services.libinput.enable = true;
hardware.graphics.enable = true;
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
xdgOpenUsePortal = true;
# warning: xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you
# should either set `xdg.portal.config` or `xdg.portal.configPackages`
# to specify which portal backend to use for the requested interface.
#
# https://github.com/flatpak/xdg-desktop-portal/blob/1.18.1/doc/portals.conf.rst.in
#
# If you simply want to keep the behaviour in < 1.17, which uses the first
# portal implementation found in lexicographical order, use the following:
#
# xdg.portal.config.common.default = "*";
config.common.default = "*";
};
environment = {
sessionVariables.NIXOS_OZONE_WL = "1";
systemPackages = with pkgs; [
qt5.qtwayland
qt6.qtwayland
];
};
programs = {
gtklock = {
enable = lib.mkDefault true;
config = {};
modules = [];
};
};
}