Make combineWrappersInfo a nix function that returns a shell command

This commit is contained in:
Doron Behar 2021-08-14 12:09:46 +03:00
parent a6123b9251
commit a65ac77de0

View file

@ -333,17 +333,36 @@ so:
```nix ```nix
# Propagate GST plugins' path # Propagate GST plugins' path
postInstall = '' postInstall = makeWrapperAuto.combineWrappersInfo {
echo "${builtins.toJSON { envInfo = {
GST_PLUGIN_SYSTEM_PATH_1_0 = [ GST_PLUGIN_SYSTEM_PATH_1_0 = [
# @out@ should be expanded by `combineWrappersInfo` to what's in `$out`, see: # @out@ should be expanded by `combineWrappersInfo` to what's in `$out`, see:
# https://github.com/NixOS/nixpkgs/pull/85103#issuecomment-613071343 # https://github.com/NixOS/nixpkgs/pull/85103#issuecomment-613071343
"@out@/lib/gstreamer-1.0" "@out@/lib/gstreamer-1.0"
]; ];
}}" | combineWrappersInfo };
};
''; '';
``` ```
The above will put a shell command in `postInstall` that's generated by
`combineWrappersInfo` that will put the environment information into
`wrappers.json`.
It should be possible to tell `combineWrappersInfo` to use a symlink directory
instead of a big environment variable, by using for example:
Other nix attributes along `envInfo` such as:
```nix
envInfo = {
# ...
};
symlink = {
THIS_ENV_VAR = "to/this-directory/in-out";
};
```
`wrapQtAppsHook` and `wrapGAppsHook` should be replaced with `makeWrapperAuto` `wrapQtAppsHook` and `wrapGAppsHook` should be replaced with `makeWrapperAuto`
which enables removing frequent workarounds such as: which enables removing frequent workarounds such as: