Skip to content

Instantly share code, notes, and snippets.

@nextl00p

nextl00p/mumble.nix Secret

Created Mar 11, 2021
Embed
What would you like to do?
self: super:
{
mumble = super.mumble.overrideAttrs (oldAttrs: {
#generic.MUMBLE_PREFIX = "$NIX_BUILD_TOP";
oldAttrs.generic = oldAttrs.generic // {shellHook = ''
export MUMBLE_PREFIX = $NIX_BUILD_TOP";
'';};
});
}
@aforemny

This comment has been minimized.

Copy link

@aforemny aforemny commented Mar 11, 2021

Wouldn't the following work?

{
  mumble = super.mumble.overrideAttrs (oldAttrs: {
    shellHook = ''
      export MUMBLE_PREFIX=$NIX_BUILD_TOP
    '';
  });
}
@Lassulus

This comment has been minimized.

Copy link

@Lassulus Lassulus commented Mar 11, 2021

if MUMBLE_PREFIX should be available during the build, maybe try this:

  mumble = pkgs.mumble.overrideAttrs (oldAttrs: {
    MUMBLE_PREFIX = "$NIX_BUILD_TOP";
  });
@nextl00p

This comment has been minimized.

Copy link
Owner Author

@nextl00p nextl00p commented Mar 11, 2021

I replaced pkgs with super in your answer, I don't get any evaluation error, but build still fails due to missing MUMBLE_PREFIX environment variable.

Looking at the mumble derivation I believe I need to set the attribute within generic.

@nextl00p

This comment has been minimized.

Copy link
Owner Author

@nextl00p nextl00p commented Mar 11, 2021

if MUMBLE_PREFIX should be available during the build, maybe try this:

  mumble = pkgs.mumble.overrideAttrs (oldAttrs: {
    MUMBLE_PREFIX = "$NIX_BUILD_TOP";
  });

thanks. this helped, but build on macos still fails further down... I am just getting started with nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment