mirror of
https://github.com/alyraffauf/nixcfg.git
synced 2024-11-29 18:49:17 -05:00
34 lines
1 KiB
Nix
34 lines
1 KiB
Nix
{ pkgs, lib, config, ... }: {
|
|
|
|
options = {
|
|
programs.flatpakSupport.enable = lib.mkEnableOption "Enables flatpak support with GUI.";
|
|
};
|
|
|
|
config = lib.mkIf config.programs.flatpakSupport.enable {
|
|
# Needed for Flatpaks
|
|
xdg.portal.enable = true;
|
|
services.flatpak.enable = true;
|
|
fonts.fontDir.enable = true;
|
|
|
|
# Allow access to system fonts.
|
|
system.fsPackages = [ pkgs.bindfs ];
|
|
fileSystems = let
|
|
mkRoSymBind = path: {
|
|
device = path;
|
|
fsType = "fuse.bindfs";
|
|
options = [ "ro" "resolve-symlinks" "x-gvfs-hide" ];
|
|
};
|
|
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");
|
|
};
|
|
environment.systemPackages = with pkgs; [ gnome.gnome-software ];
|
|
};
|
|
}
|