Distrobox: Difference between revisions
Add instructions for fixing Distrobox's host font integration functionality under NixOS |
m Refer to the new Fixes for non-Nix applications page |
||
| (One intermediate revision by the same user not shown) | |||
| Line 29: | Line 29: | ||
== Tips and tricks == | == Tips and tricks == | ||
=== Using host fonts inside Distrobox containers === | === Using host fonts/icons/themes inside Distrobox containers === | ||
By default, Distrobox tries to bind mount the host's <code>/run/host/usr/share/fonts</code> directory inside the container as <code>/usr/local/share/fonts</code>[https://github.com/89luca89/distrobox/blob/d925c3f10315b72ec38a0405e57fe06c87edc754/distrobox-init#L997-L1000]. However, on NixOS, the directory is non-existent due to NixOS not following the [https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html FHS Standard]. | By default, Distrobox tries to bind mount the host's <code>/run/host/usr/share/{fonts, icons, themes}</code> directory inside the container as <code>/usr/local/share/{fonts, icons, themes}</code>[https://github.com/89luca89/distrobox/blob/d925c3f10315b72ec38a0405e57fe06c87edc754/distrobox-init#L997-L1000]. However, on NixOS, the directory is non-existent due to NixOS not following the [https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html FHS Standard]. | ||
If you have already installed fonts on your NixOS system and want them to be accessible inside Distrobox containers by default, | If you have already installed fonts/icons/themes on your NixOS system and want them to be accessible inside Distrobox containers by default, follow the instructions provided in this page: [[Fixes for non-Nix applications#Flatpak, Distrobox, Appimage and other non-Nix applications can't find system fonts/icons/themes]] . | ||
Note that although the aforementioned solution only bindmounts paths to <code>/usr/share/</code>, the container manager being used with Distrobox (<code>podman</code>, <code>docker</code>, <code>lilypod</code> etc) will automatically make the host's root filesystem (<code>/</code>) accessible inside the container as <code>/run/host/</code>, making the paths needed by Distrobox accessible as usual, thus the aforementioned fix is sufficient. | |||
=== Using different architecture === | === Using different architecture === | ||
The following example will run an Ubuntu container with a different architecture than the host, in this case arm64. | The following example will run an Ubuntu container with a different architecture than the host, in this case arm64. | ||