summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorFabian Montero <fabian@posixlycorrect.com>2025-08-05 23:22:16 -0600
committerAlejandro Soto <alejandro@34project.org>2025-08-06 13:40:06 -0600
commit3e85a281ec997ddfac4601c15e6851e6dd31bfb6 (patch)
tree6da6234ee7f99b3ca838e99e8f44e65a300311c9 /modules
parent578b0c59aa75fedf7594d4ce95b2038cc53f53cd (diff)
add sway module
Diffstat (limited to '')
-rw-r--r--modules/default.nix4
-rw-r--r--modules/sway/default.nix13
-rw-r--r--modules/sway/options.nix3
-rw-r--r--modules/sway/sys.nix45
4 files changed, 64 insertions, 1 deletions
diff --git a/modules/default.nix b/modules/default.nix
index 70dec76..bd5d292 100644
--- a/modules/default.nix
+++ b/modules/default.nix
@@ -1,3 +1,5 @@
{
- imports = [];
+ imports = [
+ ./sway
+ ];
}
diff --git a/modules/sway/default.nix b/modules/sway/default.nix
new file mode 100644
index 0000000..9f49e7c
--- /dev/null
+++ b/modules/sway/default.nix
@@ -0,0 +1,13 @@
+{
+ config,
+ lib,
+ pkgs,
+ doctrine,
+ ...
+}:
+doctrine.lib.mkModule {
+ inherit config;
+ name = "sway";
+ sys = ./sys.nix;
+ options = ./options.nix;
+}
diff --git a/modules/sway/options.nix b/modules/sway/options.nix
new file mode 100644
index 0000000..e433039
--- /dev/null
+++ b/modules/sway/options.nix
@@ -0,0 +1,3 @@
+{...}: {
+ sys = {};
+}
diff --git a/modules/sway/sys.nix b/modules/sway/sys.nix
new file mode 100644
index 0000000..9c8b664
--- /dev/null
+++ b/modules/sway/sys.nix
@@ -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 = [];
+ };
+ };
+}