Commit Graph

11 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
sternenseemann
d026bfba04 fetchcvs: fix ssh wrapper failing due to missing /usr/bin/env
/usr/bin/env seems to be no longer be present in the sandbox. This means
that fetchcvs would fail with a “not found error” whenever CVS_RSH was
necessary.

We fix this by simply setting the current $SHELL as shebang.
Alternatively also setting it to /bin/sh statically would be possible.
2021-02-08 19:18:17 +01:00
Matthew Bauer
31ef995e37 bsd: init netbsd & openbsd userland
Adds a couple of useful NetBSD and OpenBSD derivations. Some of these
will be integrated into Nixpkgs later.

Noncomprehensive list:

- netbsd.getent
- netbsd.getconf
- netbsd.fts
- openbsd.mg
- netbsd.compat (can replace libbsd)
2018-04-24 14:16:35 -05:00
Matthew Bauer
0dc26d0e7e cvs: support ssh access
hacky wrapper handles ssh issues in nix builders
2018-04-24 14:16:29 -05:00
Eelco Dolstra
c556a6ea46 * "ensureDir" -> "mkdir -p". "ensureDir" is a rather pointless
function, so obsolete it.

svn path=/nixpkgs/branches/stdenv-updates/; revision=31644
2012-01-18 20:16:00 +00:00
Eelco Dolstra
66738cc356 * fetchcvs: cleanup, use nix-store --add-fixed like fetchurl/svn.
Argument "url" renamed to "cvsRoot" (it's not a URL).

svn path=/nixpkgs/trunk/; revision=10889
2008-02-28 22:36:37 +00:00
Marc Weber
1627b94ee7 implemented proposal by niksnut.
Now you have to use either date= or tag= when specifying cvs revision

svn path=/nixpkgs/trunk/; revision=9661
2007-11-13 01:26:54 +00:00
Marc Weber
7a9d92486f Synergy added and fetchcvs modified (see mailinglist post)
svn path=/nixpkgs/trunk/; revision=9624
2007-11-11 08:16:23 +00:00
Roy van den Broek
9ece10787e Added fetchcvs.
svn path=/nixpkgs/trunk/; revision=5295
2006-05-11 12:36:16 +00:00