I tried to build GNOME 40 alpha dev environment, I override several packages such as gsettings-desktop-schemas (GDS). Unfortunately, some of the packages already contains old version of GDS, therefor, I want to override that as well.
gnome-settings-daemon.overrideAttrs(old: {
# gsettings-desktop-schemas is a new derivation
buildInputs = [ gsettings-desktop-schemas ] ++ old.buildInputs;
})
Doing something above, before directly passed to buildInputs, cause coercion error as the following.
at: (192:11) in file: /nix/store/2qqz0n22rcj2cwrn06213lqpb61ipqd6-nixpkgs-unstable-21.05pre269929.ff96a0fa563/nixpkgs-unstable/pkgs/stdenv/generic/make-derivation.nix
191| // (lib.optionalAttrs (!(attrs ? name) && attrs ? pname && attrs ? version)) {
192| name = "${attrs.pname}-${attrs.version}";
| ^
193| } // (lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform && !dontAddHostSuffix && (attrs ? name || (attrs ? pname && attrs ? version)))) {
cannot coerce a function to a string
What does actually happened? As I don’t see any function on the sight…
Note:
It is a different story when removing the overrideAttrs, it allows everything built but with PKG_CONFIG_PATH containing old reference and new reference. So, I don’t think my modified GSD is not resolved into a derivation (still a function hence a cause of error).
35| packages.abracadabra = pkgs.stdenv.mkDerivation {
36| name = "abracadabra";
| ^
37| src = self;
cannot coerce a function to a string
(use '--show-trace' to show detailed location information)
Curiously enough, this problem doesn’t arise until I add
I would argue that my problem is likely to be strongly related to the OP’s : the message does an excellent job of attracting attention away from the source of the error!