1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-29 21:50:58 +01:00
nix/src
Eelco Dolstra 81a4516397 InstallableFlake::toDerivedPaths(): Support paths and store paths
This makes 'nix build' work on paths (which will be copied to the
store) and store paths (returned as is). E.g. the following flake
output attributes can be built using 'nix build .#foo':

  foo = ./src;
  foo = self.outPath;
  foo = builtins.fetchTarball { ... };
  foo = (builtins.fetchTree { .. }).outPath;
  foo = builtins.fetchTree { .. } + "/README.md";
  foo = builtins.storePath /nix/store/...;

Note that this is potentially risky, e.g.

  foo = /.;

will cause Nix to try to copy the entire file system to the store.

What doesn't work yet:

  foo = self;
  foo = builtins.fetchTree { .. };

because we don't handle attrsets with an outPath attribute in it yet,
and

  foo = builtins.storePath /nix/store/.../README.md;

since result symlinks have to point to a store path currently (rather
than a file inside a store path).

Fixes #7417.
2022-12-15 23:09:16 +01:00
..
build-remote build-remote: Add brackets to error message 2022-11-04 10:49:44 -07:00
libcmd InstallableFlake::toDerivedPaths(): Support paths and store paths 2022-12-15 23:09:16 +01:00
libexpr Merge remote-tracking branch 'origin/master' into lazy-trees 2022-12-14 14:02:36 +01:00
libfetchers InstallableFlake::toDerivedPaths(): Support paths and store paths 2022-12-15 23:09:16 +01:00
libmain Merge pull request #7421 from edolstra/lazy-trees-trivial-changes 2022-12-12 13:52:56 +01:00
libstore Merge remote-tracking branch 'origin/master' into lazy-trees 2022-12-15 22:08:42 +01:00
libutil Merge remote-tracking branch 'origin/master' into lazy-trees 2022-12-14 14:02:36 +01:00
nix Merge toDerivations() into toDerivedPaths() 2022-12-15 22:21:05 +01:00
nix-build Merge remote-tracking branch 'origin/master' into lazy-trees 2022-09-28 14:13:44 +02:00
nix-channel Move download stuff into tarball.hh 2022-08-01 16:05:58 +02:00
nix-collect-garbage Add missing rethrows in conditional exception handlers 2022-06-10 10:52:41 -07:00
nix-copy-closure copyPaths: Pass store by reference 2021-07-22 09:59:51 +02:00
nix-env Merge remote-tracking branch 'origin/master' into lazy-trees 2022-12-05 13:05:18 +01:00
nix-instantiate Fix 'nix-instantiate --find-file' and add a test 2022-10-12 21:51:36 +02:00
nix-store Fix unused variable warning 2022-12-12 16:41:46 +01:00
resolve-system-dependencies Get rid of most .at calls (#6393) 2022-05-04 07:44:32 +02:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00