You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flatpak can't access system fonts and icons #119433
Describe the bug
Flatpak mounts /usr/share/icons and /usr/share/fonts to /run/host/share/icons and /run/host/fonts respectively. However, this doesn't work on NixOS since all fonts/icons are in their own directories in /nix/store. While the lack of icon theme in flatpak apps is not so a big problem, the lack of system fonts leads to inability to read text written in some languages. The font for Latin characters is Deja Vu is that case that is too bold and has bad readability (at least for me). I'm suffering from this issue for a long time and thought that at some point someone raise this or this will be fixed at some time by someone, but I can't take it anymore :(
To Reproduce
Steps to reproduce the behavior:
Install any app from flatpak
Realize that it uses Deja Vu font and can't display various language families (e.g. CJK), can't display graphical symbols, etc.
Realize that it can't use system icons even if it tries
Expected behavior
Flatpak is patched so that it can read fonts and icons. Or some option that enables centralized storage of fonts/icons and Flatpak uses it.
# a list of nixpkgs attributes affected by the problemattribute: flatpak# a list of nixos modules affected by the problemmodule: services.flatpak
Reacted by James Ravn, zendo, André Vitor de Lima Matos, Hilmar Gústafsson, Arash Sal Moslehian, Kalle Lindqvist, Michael Thomas, Nirvin M, Archit Gupta, linuxissuper and 17 more
I recently switched from the nixpkgs spotify to spotify in flatpak and I didn't notice this issue until today, but it's a pretty severe issue. Here's an example of a Japanese artist's page when there is no access to system fonts for CJK fallback:
My poor, temporary solution was to copy NotoSansCJK.ttc (a 118 MiB file...) to ~/.local/share/fonts, which flatpak apps get automatic access to. Using a symlink doesn't work, since it links outside of what flatpak is allowed access to.
A proper solution might involve collecting a list of all the store paths for system fonts, and building a big list of bubblewrap --ro-binds that gets passed to flatpak, which could be done in the flatpak NixOS module. For example:
Looks like I found a solution for myself that won't double occupied space... I copied the fontconfig module and modified it in a way so that it copies contents of all the font packages to one package and doesn't reference these original packages, so they're removed right after nix-collect-gabage. I also created a bind mount to avoid flatpak rebuild for myself. ilya-fedin/nur-repository@e5bba93
I think I will do something like this for icons as well.
My solution: fonts.fontDir.enable = true; ln -s /run/current-system/sw/share/X11/fonts ~/.local/share/fonts flatpak install flatseal
then enable the All system files option for your application in flatseal.
Reacted by Elia Argentieri, Arash Sal Moslehian, GrabbenD and voyage200🍬
Reacted by Tasmo, Guanran Wang, Miklós Tóth, Thibaut Smith, May Noi, valeth, Tom, dp0sk, Luke Carrier, éclairevoyant and 3 more
My solution: fonts.fontDir.enable = true;ln -s /run/current-system/sw/share/X11/fonts ~/.local/share/fontsflatpak install flatseal then enable the All system files option for your application in flatseal.
That's not really a great solution since it pretty much eliminates the security benefits of running proprietary apps inside flatpak containers
Reacted by phrogg, May Noi, Tom, Luke Carrier, éclairevoyant, Dan and Cheese-Slice-1
My solution: fonts.fontDir.enable = true;ln -s /run/current-system/sw/share/X11/fonts ~/.local/share/fontsflatpak install flatseal then enable the All system files option for your application in flatseal.
I highly advise against doing that since that would defeat the purpose of using flatpak,
A safer way of dealing with this issue is to download (or copy) the fonts you want your apps to use into either ~/.fonts or ~/.local/share/fonts and giving flatpak apps access to the location u choose via flatseal
the same can be done with the cursor, again just download the theme u use, place it into ~/.icons or ~/.local/share/icons and giving the apps access to that
in both cases you can either to that on a per-app basis or just add access to those folders in the global section
Using cp -R -L /run/current-system/sw/share/X11/fonts ~/.local/share/fonts to copy all fonts to the user's home directory can temporarily solve the font problem. Of course, this is not a long-term solution.
Or just add those in Flatseal. Or edit the ~/.local/share/flatpak/overrides/global file manually. That should be slightly safer.
Doing this causes a lot of applications to break. Some apps such as Pika Backup and Clapper won't launch at all. For example, NewsFlash complains about the following:
/usr/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/zdv5zz22wnanyz634h9x8g7mh5hk82m3-libproxy-0.4.17/lib/libproxy.so.1)
Failed to load module: /nix/store/b8fczjp513jvmp1y0y24rrl5ak5yz7sb-glib-networking-2.72.2/lib/gio/modules/libgiolibproxy.so
It seems the only reliable solution is copying the fonts / icons to my $HOME. Which really sucks.
Just in case it can be of use to anyone, I made a workaround for this issue using bindfs:
{config,pkgs, ... }:
{system.fsPackages=[pkgs.bindfs];fileSystems=letmkRoSymBind=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");};}
The main trick here is that bindfs resolves all symlink, allowing them to be accessed without letting /nix into the sandbox.
This seems to trigger an infinite recursion with the mountpoint valid path check and boot.zfs.enabled (...which I never set, and I also don't use ZFS) when there's a filesystem whose name (apparently) begins with a letter or with /v (...very specific, yeah). I include some more detailed info below.
(Not sure if this is an issue with NixOS or with the shared code (or something I messed up)... I could open a separate issue if it's the former.)
Edit: I'm failing to make a properly shareable minimal example, sorry for that - so it's more likely that it's my fault than otherwise. But, in case anyone else stumbles upon this, setting the filesystem name to a known working name - such as /root-var instead of /var - while changing the mountPoint attribute to the actual mount point seems to fix it.
Full stack trace
warning: Git tree '/mnt/etc/nixos' is dirty
evaluating flake...
error:
… while checking flake output 'nixosConfigurations'
at /nix/store/2y86pqz62s6v3yjb6qi0hvsxvbx7i3i1-source/flake.nix:29:7:
28| # export NixOS configs from there
29| nixosConfigurations =
| ^
30| import ./outputs/nixos-conf.nix { inherit inputs system; };
… while checking the NixOS configuration 'nixosConfigurations.pgnixospc'
at /nix/store/2y86pqz62s6v3yjb6qi0hvsxvbx7i3i1-source/outputs/nixos-conf.nix:20:3:
19| # Pg NixOS PC
20| pgnixospc = mkHost "pgnixospc" ../hosts/pgnixospc {
| ^
21| users."pgbiel" = {
… while evaluating call site
at «none»:0: (source not available)
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:812:24:
811| let f = attrPath:
812| zipAttrsWith (n: values:
| ^
813| let here = attrPath ++ [n]; in
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `system.build.toplevel':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/system/activation/top-level.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:599:44:
598| defnsByName' = byName "config" (module: value:
599| [{ inherit (module) file; inherit value; }]
| ^
600| ) configs;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/system/activation/top-level.nix:131:12:
130| # Replace runtime dependencies
131| system = foldr ({ oldDependency, newDependency }: drv:
| ^
132| pkgs.replaceDependency { inherit oldDependency newDependency drv; }
… while calling 'foldr'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:53:20:
52| */
53| foldr = op: nul: list:
| ^
54| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:60:8:
59| else op (elemAt list n) (fold' (n + 1));
60| in fold' 0;
| ^
61|
… while calling 'fold''
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:56:15:
55| len = length list;
56| fold' = n:
| ^
57| if n == len
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `assertions':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/tasks/filesystems/zfs.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'condition'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
… while evaluating the attribute 'condition'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `boot.zfs.enabled':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:784:14:
783| # Avoid sorting if we don't have to.
784| if any (def: def.value._type or "" == "order") defs''.values
| ^
785| then sortProperties defs''.values
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:784:19:
783| # Avoid sorting if we don't have to.
784| if any (def: def.value._type or "" == "order") defs''.values
| ^
785| then sortProperties defs''.values
… while evaluating the attribute 'value._type'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:885:73:
884| highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
885| strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
| ^
886| in {
… while evaluating the attribute 'value.content'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:966:14:
965| { _type = "override";
966| inherit priority content;
| ^
967| };
… while evaluating the attribute 'default'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/tasks/filesystems/zfs.nix:217:9:
216| type = types.bool;
217| default = inInitrd || inSystem;
| ^
218| defaultText = literalMD "`true` if ZFS filesystem support is enabled";
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `boot.initrd.supportedFilesystems':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/system/boot/stage-1.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:852:11:
851| if def.condition then
852| dischargeProperties def.content
| ^
853| else
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'content'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
… while evaluating call site
at «none»:0: (source not available)
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:812:24:
811| let f = attrPath:
812| zipAttrsWith (n: values:
| ^
813| let here = attrPath ++ [n]; in
… while evaluating call site
at «none»:0: (source not available)
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/types.nix:563:29:
562| merge = loc: defs:
563| zipAttrsWith (name: defs:
| ^
564| let merged = mergeDefinitions (loc ++ [name]) elemType defs;
… while evaluating the attribute 'optionalValue.value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:806:5:
805|
806| optionalValue =
| ^
807| if isDefined then { value = mergedValue; }
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/tasks/filesystems.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/types.nix:569:58:
568| # Push down position info.
569| (map (def: mapAttrs (n: v: { inherit (def) file; value = v; }) def.value) defs);
| ^
570| emptyValue = { value = {}; };
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:88:39:
87| then value
88| else { ${elemAt attrPath n} = atDepth (n + 1); };
| ^
89| in atDepth 0;
… while calling 'atDepth'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:85:17:
84| len = length attrPath;
85| atDepth = n:
| ^
86| if n == len
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:599:44:
598| defnsByName' = byName "config" (module: value:
599| [{ inherit (module) file; inherit value; }]
| ^
600| ) configs;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/tasks/filesystems.nix:14:18:
13|
14| fileSystems' = toposort fsBefore (attrValues config.fileSystems);
| ^
15|
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:470:18:
469| dfsthis = listDfs true before list;
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
| ^
471| in
… while calling 'toposort'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:467:22:
466| */
467| toposort = before: list:
| ^
468| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:469:17:
468| let
469| dfsthis = listDfs true before list;
| ^
470| toporest = toposort before (dfsthis.visited ++ dfsthis.rest);
… while calling 'listDfs'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:428:35:
427| */
428| listDfs = stopOnCycles: before: list:
| ^
429| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:443:8:
442| (tail b.right ++ b.wrong);
443| in dfs' (head list) [] (tail list);
| ^
444|
… while calling 'dfs''
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:430:27:
429| let
430| dfs' = us: visited: rest:
| ^
431| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:433:15:
432| c = filter (x: before x us) visited;
433| b = partition (x: before x us) rest;
| ^
434| in if stopOnCycles && (length c > 0)
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:433:26:
432| c = filter (x: before x us) visited;
433| b = partition (x: before x us) rest;
| ^
434| in if stopOnCycles && (length c > 0)
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/lists.nix:433:29:
432| c = filter (x: before x us) visited;
433| b = partition (x: before x us) rest;
| ^
434| in if stopOnCycles && (length c > 0)
… while calling 'fsBefore'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/lib/utils.nix:17:17:
16| # Check whenever `b` depends on `a` as a fileSystem
17| fsBefore = a: b:
| ^
18| let
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/lib/utils.nix:38:8:
37|
38| in hasPrefix a'.mountPoint b'.device
| ^
39| || hasPrefix a'.mountPoint b'.mountPoint
… while calling 'hasPrefix'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/strings.nix:258:5:
257| # Input string
258| str:
| ^
259| # Before 23.05, paths would be copied to the store before converting them
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/strings.nix:261:5:
260| # to strings and comparing. This was surprising and confusing.
261| warnIf
| ^
262| (isPath pref)
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/trivial.nix:357:50:
356| */
357| warnIf = cond: msg: if cond then warn msg else x: x;
| ^
358|
… while evaluating the attribute 'device'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/lib/utils.nix:30:37:
29| normalisePath = path: "${path}${optionalString (!(hasSuffix "/" path)) "/"}";
30| normalise = mount: mount // { device = normalisePath (toString mount.device);
| ^
31| mountPoint = normalisePath mount.mountPoint;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/lib/utils.nix:30:46:
29| normalisePath = path: "${path}${optionalString (!(hasSuffix "/" path)) "/"}";
30| normalise = mount: mount // { device = normalisePath (toString mount.device);
| ^
31| mountPoint = normalisePath mount.mountPoint;
… while calling 'normalisePath'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/lib/utils.nix:29:23:
28| # though, this is not a problem: "/aaa/" is not a prefix of "/aaaa/".
29| normalisePath = path: "${path}${optionalString (!(hasSuffix "/" path)) "/"}";
| ^
30| normalise = mount: mount // { device = normalisePath (toString mount.device);
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `fileSystems."/usr/share/icons".device':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/2y86pqz62s6v3yjb6qi0hvsxvbx7i3i1-source/system/x11/fonts/fhs-workaround.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:599:44:
598| defnsByName' = byName "config" (module: value:
599| [{ inherit (module) file; inherit value; }]
| ^
600| ) configs;
… while evaluating the attribute 'passAsFile' of the derivation 'system-path'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/pkgs/stdenv/generic/make-derivation.nix:303:7:
302| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
303| name =
| ^
304| let
… while evaluating the attribute 'passAsFile'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/pkgs/build-support/buildenv/default.nix:77:5:
76| # XXX: The size is somewhat arbitrary
77| passAsFile = if builtins.stringLength pkgs >= 128*1024 then [ "pkgs" ] else [ ];
| ^
78| }
… while evaluating call site
at «none»:0: (source not available)
… while calling 'g'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:595:19:
594| g =
595| name: value:
| ^
596| if isAttrs value && cond value
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/attrsets.nix:598:20:
597| then recurse (path ++ [name]) value
598| else f (path ++ [name]) value;
| ^
599| in mapAttrs g;
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:248:72:
247| # For definitions that have an associated option
248| declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
| ^
249|
… while evaluating the attribute 'value'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:759:9:
758| in warnDeprecation opt //
759| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
760| inherit (res.defsFinal') highestPrio;
… while evaluating the option `environment.systemPackages':
… while evaluating the attribute 'mergedValue'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:794:5:
793| # Type-check the remaining definitions, and merge them. Or throw if no definitions.
794| mergedValue =
| ^
795| if isDefined then
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:788:9:
787| in {
788| values = defs''';
| ^
789| inherit (defs'') highestPrio;
… while evaluating the attribute 'values'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:887:7:
886| in {
887| values = concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
| ^
888| inherit highestPrio;
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:17:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while calling anonymous lambda
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:774:28:
773| # Process mkMerge and mkIf properties.
774| defs' = concatMap (m:
| ^
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
… while evaluating definitions from `/nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/nixos/modules/tasks/filesystems/zfs.nix':
… while evaluating call site
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:775:137:
774| defs' = concatMap (m:
775| map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
| ^
776| ) defs;
… while calling 'dischargeProperties'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:846:25:
845| */
846| dischargeProperties = def:
| ^
847| if def._type or "" == "merge" then
… while evaluating the attribute 'condition'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
… while evaluating the attribute 'condition'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
… while evaluating the attribute 'condition'
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
error: infinite recursion encountered
at /nix/store/pbh1jb88mn0sy1rw0azn9jml172pxjpq-source/lib/modules.nix:951:14:
950| { _type = "if";
951| inherit condition content;
| ^
952| };
# Workaround for fonts and icons in weird locations{pkgs,config,lib, ... }:
let# just make our config path shortercfg=config.pgopts.x11.fonts;in{options.pgopts.x11.fonts.fhs-workaround.enable=lib.mkEnableOption"Enable workaround for FHS locations for fonts (and icons).";config=lib.mkIf(cfg.enable&&cfg.fhs-workaround.enable){# bindfs is basically mount --bindsystem.fsPackages=[pkgs.bindfs];fileSystems=letmkRoSymBind=path: {device=path;fsType="fuse.bindfs";# resolve-symlinks => no more fonts as symlinksoptions=["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");};};}
Hardware config
Commenting out the line with /var makes the error stop. (Conversely, the error still happens when all lines but the /var one are commented out.)
Replacing it with e.g. fileSystems."/var" = {}; or fileSystems."/var/log" = {}; or fileSystems."/v" = root-subvolume "var"; or fileSystems."var" = {}; or fileSystems."root-var" = root-subvolume "var" // { mountPoint = "/var"; }; does not fix the error. Removing /v or adding a slash before the r (or other letters) in root in the name fixes it.
# PC hardware config (AMD CPU & AMD GPU){config,lib,pkgs,modulesPath, ... }:
lethome-subvolume=name:
{device="/dev/disk/by-label/NIXHOME";fsType="btrfs";options=["compress-force=zstd""discard=async""subvol=${name}"];depends=["/home"];};root-subvolume=name:
{device="/dev/disk/by-label/NIXROOT";fsType="btrfs";options=["compress-force=zstd""discard=async""noatime""subvol=${name}"];};in{imports=[(modulesPath+"/installer/scan/not-detected.nix")];boot.initrd.availableKernelModules=["xhci_pci""ahci""nvme""usb_storage""usbhid""sd_mod"];boot.initrd.kernelModules=["dm-snapshot"];boot.kernelModules=["kvm-amd"];boot.extraModulePackages=[];# Root subvolumesfileSystems."/"=root-subvolume"root";fileSystems."/nix"=root-subvolume"nix";fileSystems."/var"=root-subvolume"var";# <--- "bad" linefileSystems."/.snapshots"=root-subvolume".snapshots";# Home subvolumesfileSystems."/home"=home-subvolume"homeroot"//{depends=[];# not decrypted by grub => specify here# (we use keyfile to not require double passphrase)encrypted={enable=true;label="crypthome";blkDev="/dev/disk/by-partlabel/NIXENCHOME";# keyFile already specified by configuration.nix};};# for the filesystems below, 'crypthome' will already be decrypted,# so no need to specify 'encrypted' againfileSystems."/home/pgbiel"=home-subvolume"pgbiel";fileSystems."/home/pgbiel/Downloads"=home-subvolume"pgbiel/Downloads";fileSystems."/home/pgbiel/.cache"=home-subvolume"pgbiel/.cache";fileSystems."/home/pgbiel/.snapshots"=home-subvolume"pgbiel/.snapshots";# ESP / EFI boot partitionfileSystems."/boot/efi"={device="/dev/disk/by-label/NIXBOOT";fsType="vfat";};# Old SUSE /home partition (data storage)fileSystems."/mnt/susehome"={device="/dev/disk/by-label/SUSEHOME";fsType="btrfs";options=["compress-force=zstd:3"];encrypted={enable=true;label="cryptsusehome";blkDev="/dev/disk/by-partlabel/SUSEENCHOME";# keyFile already specified by configuration.nix};};# decrypt / partition before bootboot.initrd.luks.devices."cryptroot"={device="/dev/disk/by-partlabel/NIXENCROOT";# this is a LVM partition we're decryptingpreLVM=true;# allow TRIM support, if the SSD supports itallowDiscards=true;# keyFile is already specified by configuration.nix};swapDevices=[{device="/dev/disk/by-label/NIXSWAP";}];# Enables DHCP on each ethernet and wireless interface. In case of scripted networking# (the default) this is the recommended approach. When using systemd-networkd it's# still possible to use this option, but it's recommended to use it in conjunction# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.networking.useDHCP=lib.mkDefaulttrue;# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;nixpkgs.hostPlatform=lib.mkDefault"x86_64-linux";hardware.cpu.amd.updateMicrocode=lib.mkDefaultconfig.hardware.enableRedistributableFirmware;}
@PgBiel I'm also experiencing this same issue; from what I see, this happens when the icons bind mountpoint tries to reference config.system.path, which fail to evaluate due to it trying to sort the config.fileSystems (couldn't debug why /v prefix makes it fail though). For me, it's hard to implement the workaround of renaming the key and adding mountPoint property, as most of my /v filesystems are /var folders mounted by impermanence's directories option, which doesn't give an option to rename key and add the mount point.
Another very ugly, impure approach is to replace config.system.path + "/share/icons" with /run/current-system/sw/share/icons; notice this doesn't update upon new system activation, so one needs to remount icons manually if willing to reload that mountpoint, but it removes the config.system.path evaluation and fix the infinite recursion.
this happens when the icons bind mountpoint tries to reference config.system.path, which fail to evaluate due to it trying to sort the config.fileSystems
If config.system.path doesn't work, then try building a custom env instead, like this:
Unfortunately not, you can use it to change the path bind mounted by flatpak but it won't work on NixOS because an aggregated folder is a set of symlinks and regular bind mounting won't resolve them automatically
this happens when the icons bind mountpoint tries to reference config.system.path, which fail to evaluate due to it trying to sort the config.fileSystems
If config.system.path doesn't work, then try building a custom env instead, like this:
This is the best I could come up with as someone hitting the infinite recursion issue. I have replaced the config.fonts.fonts with config.fonts.packages since that is the new default coming in NixOS 23.11 (and currently in NixOS Unstable). I have also hardcoded the packages with icons that Firefox needs in Flatpak (the cursor from GNOME and one for KDE, which I don't use). Additionally, I have updated the bind mount path to /usr/local/share/fonts, since, for some reason, Firefox was not finding them at /usr/share/fonts. Interestingly, if I try to do the same with the icons folder, it doesn't work.
This works for the Firefox Flatpak, but the VSCodium Flatpak does not use the cursor icons for some reason.
Anyway, hope this helps someone. Really looking forward to seeing if someone can crack the case on that infinite recursion error, to remove this package hardcoding workaround from this Flatpak workaround!
{system.fsPackages=[pkgs.bindfs];fileSystems=letmkRoSymBind=path: {device=path;fsType="fuse.bindfs";options=["ro""resolve-symlinks""x-gvfs-hide"];};aggregatedIcons=pkgs.buildEnv{name="system-icons";paths=withpkgs;[#libsForQt5.breeze-qt5 # for plasmagnome.gnome-themes-extra];pathsToLink=["/share/icons"];};aggregatedFonts=pkgs.buildEnv{name="system-fonts";paths=config.fonts.packages;pathsToLink=["/share/fonts"];};in{"/usr/share/icons"=mkRoSymBind"${aggregatedIcons}/share/icons";"/usr/local/share/fonts"=mkRoSymBind"${aggregatedFonts}/share/fonts";};fonts={fontDir.enable=true;packages=withpkgs;[noto-fontsnoto-fonts-emojinoto-fonts-cjk];};}
Reacted by Elia Argentieri, Suraj, Andre and Joseph
Activity
jtojnar commentedon Apr 14, 2021
Relevant source code:
https://github.com/flatpak/flatpak/blob/3ebf371fc281da37c2814bfd7f9d899156eff660/common/flatpak-run.c#L1903-L1911
The directory can be overridden using a configure flag:
https://github.com/flatpak/flatpak/blob/19b11ade739d0e27cfaf0a72090773a6ca196055/configure.ac#L144
ilya-fedin commentedon Apr 15, 2021
This probably won't help without some option to copy all the fonts to one directory...
There's fonts.fontDir.enable, but it links fonts, so flatpak apps can't access them :(
solson commentedon May 12, 2021
I recently switched from the nixpkgs spotify to spotify in flatpak and I didn't notice this issue until today, but it's a pretty severe issue. Here's an example of a Japanese artist's page when there is no access to system fonts for CJK fallback:
solson commentedon May 12, 2021
My poor, temporary solution was to copy
NotoSansCJK.ttc(a 118 MiB file...) to~/.local/share/fonts, which flatpak apps get automatic access to. Using a symlink doesn't work, since it links outside of what flatpak is allowed access to.A proper solution might involve collecting a list of all the store paths for system fonts, and building a big list of bubblewrap
--ro-binds that gets passed to flatpak, which could be done in the flatpak NixOS module. For example:ilya-fedin commentedon May 12, 2021
I hope that will be solved once, since I don't really want to copy all installed fonts to home :(
ilya-fedin commentedon Jul 15, 2021
Looks like I found a solution for myself that won't double occupied space... I copied the fontconfig module and modified it in a way so that it copies contents of all the font packages to one package and doesn't reference these original packages, so they're removed right after nix-collect-gabage. I also created a bind mount to avoid flatpak rebuild for myself.
ilya-fedin/nur-repository@e5bba93
I think I will do something like this for icons as well.
ilya-fedin commentedon Jul 15, 2021
So it is: ilya-fedin/nur-repository@2aa0966
Unlike the font one, it duplicates the icons, but I have only 300 MB of them (unlike fonts), so that's acceptable for me.
zendo commentedon Dec 5, 2021
My solution:
fonts.fontDir.enable = true;ln -s /run/current-system/sw/share/X11/fonts ~/.local/share/fontsflatpak install flatsealthen enable the
All system filesoption for your application in flatseal.HadetTheUndying commentedon Jun 5, 2022
That's not really a great solution since it pretty much eliminates the security benefits of running proprietary apps inside flatpak containers
Lucy-Nya commentedon Jun 10, 2022
I highly advise against doing that since that would defeat the purpose of using flatpak,
A safer way of dealing with this issue is to download (or copy) the fonts you want your apps to use into either ~/.fonts or ~/.local/share/fonts and giving flatpak apps access to the location u choose via flatseal
the same can be done with the cursor, again just download the theme u use, place it into ~/.icons or ~/.local/share/icons and giving the apps access to that
in both cases you can either to that on a per-app basis or just add access to those folders in the global section
jtojnar commentedon Jun 10, 2022
If you have home manager, you could try something like the following (untested):
Or just add those in Flatseal. Or edit the
~/.local/share/flatpak/overrides/globalfile manually. That should be slightly safer.OfficialBoyfriend commentedon Sep 7, 2022
Using
cp -R -L /run/current-system/sw/share/X11/fonts ~/.local/share/fontsto copy all fonts to the user's home directory can temporarily solve the font problem. Of course, this is not a long-term solution.qcloutier commentedon Sep 22, 2022
Doing this causes a lot of applications to break. Some apps such as Pika Backup and Clapper won't launch at all. For example, NewsFlash complains about the following:
It seems the only reliable solution is copying the fonts / icons to my
$HOME. Which really sucks.ilya-fedin commentedon Sep 22, 2022
I still use my own modules
https://github.com/ilya-fedin/nur-repository/tree/master/modules/flatpak-fonts
https://github.com/ilya-fedin/nur-repository/tree/master/modules/flatpak-icons
11 remaining items
PgBiel commentedon Aug 27, 2023
This seems to trigger an infinite recursion with the mountpoint valid path check and
boot.zfs.enabled(...which I never set, and I also don't use ZFS) when there's a filesystem whose name (apparently) begins with a letter or with/v(...very specific, yeah). I include some more detailed info below.(Not sure if this is an issue with NixOS or with the shared code (or something I messed up)... I could open a separate issue if it's the former.)
Edit: I'm failing to make a properly shareable minimal example, sorry for that - so it's more likely that it's my fault than otherwise. But, in case anyone else stumbles upon this, setting the filesystem name to a known working name - such as
/root-varinstead of/var- while changing themountPointattribute to the actual mount point seems to fix it.Full stack trace
system/x11/fonts/fhs-workaround.nix(withpgopts.x11.fonts.fhs-workaround.enable = true;elsewhere)Verbatim copy of the suggested code:
Hardware config
Commenting out the line with
/varmakes the error stop. (Conversely, the error still happens when all lines but the/varone are commented out.)Replacing it with e.g.
fileSystems."/var" = {};orfileSystems."/var/log" = {};orfileSystems."/v" = root-subvolume "var";orfileSystems."var" = {};orfileSystems."root-var" = root-subvolume "var" // { mountPoint = "/var"; };does not fix the error. Removing/vor adding a slash before ther(or other letters) inrootin the name fixes it.Guanran928 commentedon Aug 27, 2023
Hmm, today I got the same error while rebuilding my system, thought the issue was on my side since I changed a lot of stuff in my config.
ilya-fedin commentedon Aug 27, 2023
That's not a good idea. Those configs are incompatible between fontconfig versions.
andrevmatos commentedon Sep 1, 2023
@PgBiel I'm also experiencing this same issue; from what I see, this happens when the
iconsbind mountpoint tries to referenceconfig.system.path, which fail to evaluate due to it trying to sort theconfig.fileSystems(couldn't debug why/vprefix makes it fail though). For me, it's hard to implement the workaround of renaming the key and addingmountPointproperty, as most of my/vfilesystems are/varfolders mounted byimpermanence'sdirectoriesoption, which doesn't give an option to rename key and add the mount point.Another very ugly, impure approach is to replace
config.system.path + "/share/icons"with/run/current-system/sw/share/icons; notice this doesn't update upon new system activation, so one needs to remount icons manually if willing to reload that mountpoint, but it removes theconfig.system.pathevaluation and fix the infinite recursion.alaviss commentedon Sep 10, 2023
If
config.system.pathdoesn't work, then try building a custom env instead, like this:Then refer to it instead.
Guanran928 commentedon Sep 10, 2023
After a quick search, I found this.
I am not a developer, can anyone tell me can this option be used?
alaviss commentedon Sep 10, 2023
Unfortunately not, you can use it to change the path bind mounted by flatpak but it won't work on NixOS because an aggregated folder is a set of symlinks and regular bind mounting won't resolve them automatically
jacobranson commentedon Oct 18, 2023
This also does not work, at least from what I can see. Infinite recursion error remains.
jacobranson commentedon Oct 18, 2023
This is the best I could come up with as someone hitting the infinite recursion issue. I have replaced the
config.fonts.fontswithconfig.fonts.packagessince that is the new default coming in NixOS 23.11 (and currently in NixOS Unstable). I have also hardcoded the packages with icons that Firefox needs in Flatpak (the cursor from GNOME and one for KDE, which I don't use). Additionally, I have updated the bind mount path to/usr/local/share/fonts, since, for some reason, Firefox was not finding them at/usr/share/fonts. Interestingly, if I try to do the same with the icons folder, it doesn't work.This works for the Firefox Flatpak, but the VSCodium Flatpak does not use the cursor icons for some reason.
Anyway, hope this helps someone. Really looking forward to seeing if someone can crack the case on that infinite recursion error, to remove this package hardcoding workaround from this Flatpak workaround!
FliegendeWurst commentedon Nov 12, 2023
PR with fix: #262462 (posting here to notify issue subscribers)
AndreiSva commentedon Nov 24, 2023
I've been having this issue with flatpak element. the cursor is the default wayland cursor instead of the gnome one.
bohanubis commentedon Dec 26, 2023
hopefully this gets fixed soon
bohanubis commentedon Mar 10, 2024
since soon isn't coming anytime soon it seems here's my temporary fix
(this doesn't support fonts since I have no idea how to do so)
nixos-discourse commentedon Jul 31, 2024
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/system-cursor-theme-and-scaling-not-being-followed-by-some-apps-system-packages-flatpak/49917/4