···45```
4647Running `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.
00
···45```
4647Running `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.
48+49+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`.
···93 paths = [ etcPkg ldconfig ] ++ basePkgs ++ targetPaths;
94 extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall;
95 ignoreCollisions = true;
96+ postBuild = ''
97+ if [[ -d $out/share/gsettings-schemas/ ]]; then
98+ # Recreate the standard schemas directory if its a symlink to make it writable
99+ if [[ -L $out/share/glib-2.0 ]]; then
100+ ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old
101+ rm -rf $out/share/glib-2.0
102+ fi
103+104+ mkdir -p $out/share/glib-2.0/schemas
105+106+ # symlink any schema files or overrides to the standard schema directory
107+ if [[ -e $out/share/glib-2.0.old/schemas ]]; then
108+ ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas
109+ ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas
110+ fi
111+112+ for d in $out/share/gsettings-schemas/*; do
113+ # Force symlink, in case there are duplicates
114+ ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas
115+ ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas
116+ done
117+118+ # and compile them
119+ ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
120+ fi
121+ '';
122 };
123124 staticUsrProfileMulti = buildEnv {
···134 paths = [ etcPkg ] ++ basePkgs ++ targetPaths;
135 extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall;
136 ignoreCollisions = true;
137+ postBuild = ''
138+ if [[ -d $out/share/gsettings-schemas/ ]]; then
139+ # Recreate the standard schemas directory if its a symlink to make it writable
140+ if [[ -L $out/share/glib-2.0 ]]; then
141+ ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old
142+ rm -rf $out/share/glib-2.0
143+ fi
144+145+ mkdir -p $out/share/glib-2.0/schemas
146+147+ # symlink any schema files or overrides to the standard schema directory
148+ if [[ -e $out/share/glib-2.0.old/schemas ]]; then
149+ ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas
150+ ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas
151+ fi
152+153+ for d in $out/share/gsettings-schemas/*; do
154+ # Force symlink, in case there are duplicates
155+ ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas
156+ ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas
157+ done
158+159+ # and compile them
160+ ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas
161+ fi
162+ '';
163 };
164165 staticUsrProfileMulti = buildEnv {