config/profiles/desktop/flatpak.nix

33 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2023-03-12 05:14:28 +01:00
{ config, pkgs, ... }:
{
services.flatpak.enable = true;
2023-06-19 02:45:50 +02:00
# TODO: integrate into gnome-software
# TODO: somehow run this, like i do in home-manager
# flatpak remote-add --if-not-exists --user flathub https://dl.flathub.org/repo/flathub.flatpakrepo
2023-03-12 05:14:28 +01:00
# fix missing fonts in flatpak, without resorting to copying fonts to a dedicated folder
# via https://github.com/NixOS/nixpkgs/issues/119433#issuecomment-1326957279
system.fsPackages = [ pkgs.bindfs ];
fileSystems = let
mkRoSymBind = path: {
device = path;
fsType = "fuse.bindfs";
# resolve-symlinks enable not mounting /nix into the flatpacks
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
};
aggregatedFonts = pkgs.buildEnv {
name = "system-fonts";
2024-02-18 22:14:40 +01:00
paths = config.fonts.packages;
2023-03-12 05:14:28 +01:00
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");
};
}