summary refs log tree commit diff
path: root/nixos/modules/programs
diff options
context:
space:
mode:
authorrewine <lhongxu@outlook.com>2023-07-16 23:11:54 +0800
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-07-27 00:04:03 -0300
commitd9f707f79563673576f31c0195f5b85a5ce92067 (patch)
tree31a8897ae7fd8208ef63a68345ee401088c20391 /nixos/modules/programs
parent8974e68bef967c8a8fa11c758e904bc7642aa48a (diff)
downloadnixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar.gz
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar.bz2
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar.lz
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar.xz
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.tar.zst
nixpkgs-d9f707f79563673576f31c0195f5b85a5ce92067.zip
nixos/wayfire: init
Diffstat (limited to 'nixos/modules/programs')
-rw-r--r--nixos/modules/programs/wayland/wayfire.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/programs/wayland/wayfire.nix b/nixos/modules/programs/wayland/wayfire.nix
new file mode 100644
index 00000000000..d0b280e3940
--- /dev/null
+++ b/nixos/modules/programs/wayland/wayfire.nix
@@ -0,0 +1,48 @@
+{ config, lib, pkgs, ...}:
+let
+  cfg = config.programs.wayfire;
+in
+{
+  meta.maintainers = with lib.maintainers; [ rewine ];
+
+  options.programs.wayfire = {
+    enable = lib.mkEnableOption (lib.mdDoc "Wayfire, a wayland compositor based on wlroots.");
+
+    package = lib.mkPackageOptionMD pkgs "wayfire" { };
+
+    plugins = lib.mkOption {
+      type = lib.types.listOf lib.types.package;
+      default = with pkgs.wayfirePlugins; [ wcm wf-shell ];
+      defaultText = lib.literalExpression "with pkgs.wayfirePlugins; [ wcm wf-shell ]";
+      example = lib.literalExpression ''
+        with pkgs.wayfirePlugins; [
+          wcm
+          wf-shell
+          wayfire-plugins-extra
+        ];
+      '';
+      description = lib.mdDoc ''
+        Additional plugins to use with the wayfire window manager.
+      '';
+    };
+  };
+
+  config = let
+    finalPackage = pkgs.wayfire-with-plugins.override {
+      wayfire = cfg.package;
+      plugins = cfg.plugins;
+    };
+  in
+  lib.mkIf cfg.enable {
+    environment.systemPackages = [
+      finalPackage
+    ];
+
+    services.xserver.displayManager.sessionPackages = [ finalPackage ];
+
+    xdg.portal = {
+      enable = lib.mkDefault true;
+      wlr.enable = lib.mkDefault true;
+    };
+  };
+}