flatpak font workarounds
This commit is contained in:
5
modules/default.nix
Normal file
5
modules/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./workarounds
|
||||
];
|
||||
}
|
5
modules/workarounds/default.nix
Normal file
5
modules/workarounds/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
imports = [
|
||||
./flatpak.nix
|
||||
];
|
||||
}
|
44
modules/workarounds/flatpak.nix
Normal file
44
modules/workarounds/flatpak.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
# https://github.com/knightpp/nixos-cfg/blob/main/modules/workarounds/flatpak.nix
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
cfg = config.workarounds.flatpak;
|
||||
in {
|
||||
options = {
|
||||
workarounds.flatpak = {
|
||||
enable = lib.mkEnableOption "flatpak workaround";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
system.fsPackages = [pkgs.bindfs];
|
||||
fileSystems = let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
options = ["ro" "resolve-symlinks" "x-gvfs-hide"];
|
||||
};
|
||||
aggregated = pkgs.buildEnv {
|
||||
name = "system-fonts-and-icons";
|
||||
paths = builtins.attrValues {
|
||||
inherit (pkgs.libsForQt5) breeze-qt5;
|
||||
inherit
|
||||
(pkgs)
|
||||
noto-fonts
|
||||
noto-fonts-emoji
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-cjk-serif
|
||||
;
|
||||
};
|
||||
pathsToLink = ["/share/fonts" "/share/icons"];
|
||||
};
|
||||
in {
|
||||
# Create an FHS mount to support flatpak host icons/fonts
|
||||
"/usr/share/icons" = mkRoSymBind "${aggregated}/share/icons";
|
||||
"/usr/share/fonts" = mkRoSymBind "${aggregated}/share/fonts";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user