Commit Graph

9 Commits

Author SHA1 Message Date
Maximilian Bosch
8bc5104a6e
treewide: refactor .attrs.sh detection
When specifying the `builder` attribute in `stdenv.mkDerivation`, this
will be effectively transformed into

    builtins.derivation {
      builder = stdenv.shell;
      args = [ "-e" builder ];
    }

This also means that `default-builder.sh` is never sourced and as a
result it's not guaranteed that `$NIX_ATTRS_SH_FILE` is set to a correct
location[1].

Also, we need to source `.attrs.sh` to source `$stdenv`. So, the
following is done now:

* If `$NIX_ATTRS_SH_FILE` points to a correct location, then use it.
  Directly using `.attrs.sh` is problematic for `nix-shell(1)` usage
  (see previous commit for more context), so prefer the environment
  variable if possible.

* Otherwise, if `.attrs.sh` exists, then use it. See [1] for when this
  can happen.

* If neither applies, it can be assumed that `__structuredAttrs` is
  turned off and thus nothing needs to be done.

[1] It's possible that it doesn't exist at all - in case of Nix 2.3 or
    it can point to a wrong location on older Nix versions with a bug in
    `__structuredAttrs`.
2023-10-04 18:36:57 +02:00
Artturin
fe1c7a1945 treewide: remove usages of header and stopNest
they're obsolete
2023-01-16 00:08:12 +02:00
Artturin
c01f509e44 treewide: source .attrs in builders
if theres a source $stdenv then this is needed

for structuredAttrs
2022-12-08 21:09:02 +02:00
Victor Engmark
57b496ea98 misc: Replace tab indentation with spaces
I've tried to be consistent, using four or eight spaces to line up
with existing code.
2021-11-14 16:04:46 +13:00
Ivan Kozik
1866619acc Fix a few typos 2013-08-11 10:55:53 +00:00
Michael Raskin
29b28dc3bb Reduce fetchmtn verbosity
svn path=/nixpkgs/trunk/; revision=18300
2009-11-08 22:30:38 +00:00
Michael Raskin
24162c6b4a Fix fetchmtn
svn path=/nixpkgs/trunk/; revision=18298
2009-11-08 22:12:14 +00:00
Michael Raskin
cefe6deb04 Initialize DB in fetchmtn
svn path=/nixpkgs/trunk/; revision=16545
2009-08-03 06:04:28 +00:00
Michael Raskin
d79e32c9b9 Add fetchmtn
svn path=/nixpkgs/trunk/; revision=16204
2009-07-07 10:02:09 +00:00