From ac518ed16b15a950c61d6d12bfa8036b80901401 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Fri, 14 Nov 2025 16:28:28 +0800 Subject: [PATCH] nixos/niri: add nautilus to systemPackages --- nixos/modules/programs/wayland/niri.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/wayland/niri.nix b/nixos/modules/programs/wayland/niri.nix index 4092969a3e45..b571326acd9b 100644 --- a/nixos/modules/programs/wayland/niri.nix +++ b/nixos/modules/programs/wayland/niri.nix @@ -12,12 +12,22 @@ in enable = lib.mkEnableOption "Niri, a scrollable-tiling Wayland compositor"; package = lib.mkPackageOption pkgs "niri" { }; + + useNautilus = lib.mkEnableOption "Nautilus as file-chooser for xdg-desktop-portal-gnome" // { + default = true; + }; }; config = lib.mkIf cfg.enable ( lib.mkMerge [ { - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [ + cfg.package + ] + # Required for xdg-desktop-portal-gnome's FileChooser to work properly + ++ lib.optionals cfg.useNautilus [ + pkgs.nautilus + ]; services = { displayManager.sessionPackages = [ cfg.package ]; @@ -34,6 +44,10 @@ in configPackages = [ cfg.package ]; + config.niri = lib.mkIf (!cfg.useNautilus) { + "org.freedesktop.impl.portal.FileChooser" = lib.mkDefault "gtk"; + }; + # Recommended by upstream, required for screencast support # https://github.com/YaLTeR/niri/wiki/Important-Software#portals extraPortals = [ pkgs.xdg-desktop-portal-gnome ];