Development environment with nix-shell: Difference between revisions
imported>Ilmu m Added an example of how to load a local expression (not in pkgs namespace) |
imported>Makefu No edit summary |
||
Line 86: | Line 86: | ||
</syntaxHighlight> | </syntaxHighlight> | ||
in the nix-shell. | in the nix-shell. | ||
=== No GSettings schemas are installed on the system === | |||
When working with gtk, the <code>XDG_DATA_DIRS</code> must contain a path to the gtk schemas, if not an application may crash with the error above. | |||
For packages we use <code>wrapGAppsHook</code> in <code>nativeBuildInputs</code>, however in nix-shell this is not working as expected. | |||
To get your application to work in nix-shell you will need to add the following to your <code>mkShell</code> expression: | |||
<syntaxHightlight lang=nix> | |||
mkShell { | |||
... | |||
buildInputs = [ gtk3 ]; | |||
shellHook = '' | |||
XDG_DATA_DIRS=$GSETTINGS_SCHEMA_PATH | |||
''; | |||
} | |||
</syntaxHightlight> | |||
=== Icons not working === | |||
Similar to the Gsettings issue, icons can be added with XDG_DATA_DIRS: | |||
<pre> XDG_DATA_DIRS=...:${hicolor-icon-theme/share:${gnome3.adwaita-icon-theme}/share</pre> |