mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 02:08:29 +02:00
feat: add flatpack to install apps not supported well in NixOS
This commit is contained in:
25
modules/fhs-fonts.nix
Normal file
25
modules/fhs-fonts.nix
Normal file
@@ -0,0 +1,25 @@
|
||||
# copy from https://github.com/NixOS/nixpkgs/issues/119433#issuecomment-1326957279
|
||||
# mainly for flatpak
|
||||
# bindfs resolves all symlink, allowing all fonts to be accessed at /usr/share/fonts, without letting /nix into the sandbox.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
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.fonts;
|
||||
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");
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user