From 5f91781b55cde7aba6d4c2165e43c9ebe3023590 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 21 Feb 2022 17:02:54 -0800 Subject: treewide: remove steam-run-native --- doc/builders/packages/steam.section.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/builders') diff --git a/doc/builders/packages/steam.section.md b/doc/builders/packages/steam.section.md index 0cfc1a2c245..3ce33c9b60e 100644 --- a/doc/builders/packages/steam.section.md +++ b/doc/builders/packages/steam.section.md @@ -56,7 +56,7 @@ Use `programs.steam.enable = true;` if you want to add steam to systemPackages a ## steam-run {#sec-steam-run} -The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run-native` package and run the game with +The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run` package and run the game with ``` steam-run ./foo -- cgit 1.4.1 From 3e7e6ab84a5a4facdbeea8941af9df471d66c839 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 25 Feb 2022 01:08:47 +0200 Subject: buildFHSUserEnv{Chroot,Bubblewrap}: link gsettings-schemas to the FHS location We shouldn't need to use wrapGAppsHook in expressions that use this builder. --- doc/builders/special/fhs-environments.section.md | 2 ++ .../build-fhs-userenv-bubblewrap/env.nix | 26 ++++++++++++++++++++++ pkgs/build-support/build-fhs-userenv/env.nix | 26 ++++++++++++++++++++++ 3 files changed, 54 insertions(+) (limited to 'doc/builders') diff --git a/doc/builders/special/fhs-environments.section.md b/doc/builders/special/fhs-environments.section.md index 43dc99b7c18..cacad261e28 100644 --- a/doc/builders/special/fhs-environments.section.md +++ b/doc/builders/special/fhs-environments.section.md @@ -45,3 +45,5 @@ One can create a simple environment using a `shell.nix` like that: ``` Running `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. + +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`. diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix index 0051961d9f1..c2f3ade6457 100644 --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix @@ -93,6 +93,32 @@ let paths = [ etcPkg ldconfig ] ++ basePkgs ++ targetPaths; extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall; ignoreCollisions = true; + postBuild = '' + if [[ -d $out/share/gsettings-schemas/ ]]; then + # Recreate the standard schemas directory if its a symlink to make it writable + if [[ -L $out/share/glib-2.0 ]]; then + ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old + rm -rf $out/share/glib-2.0 + fi + + mkdir -p $out/share/glib-2.0/schemas + + # symlink any schema files or overrides to the standard schema directory + if [[ -e $out/share/glib-2.0.old/schemas ]]; then + ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas + ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas + fi + + for d in $out/share/gsettings-schemas/*; do + # Force symlink, in case there are duplicates + ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas + ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas + done + + # and compile them + ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas + fi + ''; }; staticUsrProfileMulti = buildEnv { diff --git a/pkgs/build-support/build-fhs-userenv/env.nix b/pkgs/build-support/build-fhs-userenv/env.nix index 44c8adb06e1..bd3a2d5e12d 100644 --- a/pkgs/build-support/build-fhs-userenv/env.nix +++ b/pkgs/build-support/build-fhs-userenv/env.nix @@ -134,6 +134,32 @@ let paths = [ etcPkg ] ++ basePkgs ++ targetPaths; extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall; ignoreCollisions = true; + postBuild = '' + if [[ -d $out/share/gsettings-schemas/ ]]; then + # Recreate the standard schemas directory if its a symlink to make it writable + if [[ -L $out/share/glib-2.0 ]]; then + ln -s $(readlink $out/share/glib-2.0) $out/share/glib-2.0.old + rm -rf $out/share/glib-2.0 + fi + + mkdir -p $out/share/glib-2.0/schemas + + # symlink any schema files or overrides to the standard schema directory + if [[ -e $out/share/glib-2.0.old/schemas ]]; then + ln -fs $out/share/glib-2.0.old/schemas/*.xml $out/share/glib-2.0/schemas + ln -fs $out/share/glib-2.0.old/schemas/*.gsettings-schemas.override $out/share/glib-2.0/schemas + fi + + for d in $out/share/gsettings-schemas/*; do + # Force symlink, in case there are duplicates + ln -fs $d/glib-2.0/schemas/*.xml $out/share/glib-2.0/schemas + ln -fs $d/glib-2.0/schemas/*.gschema.override $out/share/glib-2.0/schemas + done + + # and compile them + ${pkgs.glib.dev}/bin/glib-compile-schemas $out/share/glib-2.0/schemas + fi + ''; }; staticUsrProfileMulti = buildEnv { -- cgit 1.4.1