From d89deddd5d806a0226fc110be8c28c062973866e Mon Sep 17 00:00:00 2001 From: WORLDofPEACE Date: Fri, 23 Oct 2020 20:18:19 -0400 Subject: [PATCH] nixos/flatpak: introduce guiPackages This adds basically an indirection to systemPackages to automatically install an interface for flatpak for their respective environments. e.g if I enable pantheon and flatpak you'll get appcenter, and on gnome you'll see gnome-software. https://github.com/NixOS/nixpkgs/issues/99648#issuecomment-706691174 --- nixos/modules/services/desktops/flatpak.nix | 14 +++++++++++++- .../services/x11/desktop-managers/gnome3.nix | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/desktops/flatpak.nix b/nixos/modules/services/desktops/flatpak.nix index 7da92cc9f264..d0f6b66328a4 100644 --- a/nixos/modules/services/desktops/flatpak.nix +++ b/nixos/modules/services/desktops/flatpak.nix @@ -15,6 +15,18 @@ in { options = { services.flatpak = { enable = mkEnableOption "flatpak"; + + guiPackages = mkOption { + internal = true; + type = types.listOf types.package; + default = []; + example = literalExample "[ pkgs.gnome3.gnome-software ]"; + description = '' + Packages that provide an interface for flatpak + (like gnome-software) that will be automatically available + to all users when flatpak is enabled. + ''; + }; }; }; @@ -28,7 +40,7 @@ in { } ]; - environment.systemPackages = [ pkgs.flatpak ]; + environment.systemPackages = [ pkgs.flatpak ] ++ cfg.guiPackages; services.dbus.packages = [ pkgs.flatpak ]; diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix index 85525ab6d7f6..cade13296b59 100644 --- a/nixos/modules/services/x11/desktop-managers/gnome3.nix +++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix @@ -207,6 +207,11 @@ in # If gnome3 is installed, build vim for gtk3 too. nixpkgs.config.vim.gui = "gtk3"; + + # Install gnome-software if flatpak is enabled + services.flatpak.guiPackages = [ + pkgs.gnome3.gnome-software + ]; }) (mkIf flashbackEnabled {