diff --git a/nixosModules/services/flatpak/default.nix b/nixosModules/services/flatpak/default.nix index f46e517e..9bfaacb2 100644 --- a/nixosModules/services/flatpak/default.nix +++ b/nixosModules/services/flatpak/default.nix @@ -13,18 +13,44 @@ fsType = "fuse.bindfs"; options = ["ro" "resolve-symlinks" "x-gvfs-hide"]; }; + + aggregatedIcons = pkgs.buildEnv { + name = "system-icons"; + paths = + (with pkgs; [ + gnome.adwaita-icon-theme + gnome.gnome-themes-extra + ]) + ++ lib.optional (config.stylix.enable) config.stylix.cursor.package; + + pathsToLink = ["/share/icons"]; + }; + aggregatedFonts = pkgs.buildEnv { name = "system-fonts"; paths = config.fonts.packages; pathsToLink = ["/share/fonts"]; }; in { - # Create an FHS mount to support flatpak host icons/fonts - "/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons"); - "/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts"); + "/usr/share/icons" = mkRoSymBind "${aggregatedIcons}/share/icons"; + "/usr/local/share/fonts" = mkRoSymBind "${aggregatedFonts}/share/fonts"; + }; + + fonts = { + fontDir.enable = true; + packages = + (with pkgs; [ + noto-fonts + noto-fonts-emoji + noto-fonts-cjk + ]) + ++ lib.optionals (config.stylix.enable) [ + config.stylix.fonts.sansSerif.package + config.stylix.fonts.monospace.package + config.stylix.fonts.serif.package + ]; }; - fonts.fontDir.enable = true; services.flatpak.enable = true; system.fsPackages = [pkgs.bindfs]; xdg.portal.enable = true;