···4545```
46464747Running `nix-shell` would then drop you into a shell with these libraries and binaries available. You can use this to run closed-source applications which expect FHS structure without hassles: simply change `runScript` to the application path, e.g. `./bin/start.sh` -- relative paths are supported.
4848+4949+Additionally, the FHS builder links all relocated gsettings-schemas (the glib setup-hook moves them to `share/gsettings-schemas/${name}/glib-2.0/schemas`) to their standard FHS location. This means you don't need to wrap binaries with `wrapGAppsHook`.
···9393 paths = [ etcPkg ldconfig ] ++ basePkgs ++ targetPaths;
9494 extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall;
9595 ignoreCollisions = true;
9696+ postBuild = ''
9797+ if [[ -d $out/share/gsettings-schemas/ ]]; then
9898+ # Recreate the standard schemas directory if its a symlink to make it writable
9999+ if [[ -L $out/share/glib-2.0 ]]; then
100100+ ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old
101101+ rm -rf $out/share/glib-2.0
102102+ fi
103103+104104+ mkdir -p $out/share/glib-2.0/schemas
105105+106106+ # symlink any schema files or overrides to the standard schema directory
107107+ if [[ -e $out/share/glib-2.0.old/schemas ]]; then
108108+ ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas
109109+ ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas
110110+ fi
111111+112112+ for d in $out/share/gsettings-schemas/*; do
113113+ # Force symlink, in case there are duplicates
114114+ ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas
115115+ ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas
116116+ done
117117+118118+ # and compile them
119119+ ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
120120+ fi
121121+ '';
96122 };
9712398124 staticUsrProfileMulti = buildEnv {
+26
pkgs/build-support/build-fhs-userenv/env.nix
···134134 paths = [ etcPkg ] ++ basePkgs ++ targetPaths;
135135 extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall;
136136 ignoreCollisions = true;
137137+ postBuild = ''
138138+ if [[ -d $out/share/gsettings-schemas/ ]]; then
139139+ # Recreate the standard schemas directory if its a symlink to make it writable
140140+ if [[ -L $out/share/glib-2.0 ]]; then
141141+ ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old
142142+ rm -rf $out/share/glib-2.0
143143+ fi
144144+145145+ mkdir -p $out/share/glib-2.0/schemas
146146+147147+ # symlink any schema files or overrides to the standard schema directory
148148+ if [[ -e $out/share/glib-2.0.old/schemas ]]; then
149149+ ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas
150150+ ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas
151151+ fi
152152+153153+ for d in $out/share/gsettings-schemas/*; do
154154+ # Force symlink, in case there are duplicates
155155+ ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas
156156+ ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas
157157+ done
158158+159159+ # and compile them
160160+ ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
161161+ fi
162162+ '';
137163 };
138164139165 staticUsrProfileMulti = buildEnv {