You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. { stdenv, perl, xz, pathsFromGraph
  2. , # The file name of the resulting tarball
  3. fileName ? "nixos-system-${stdenv.system}"
  4. , # The files and directories to be placed in the tarball.
  5. # This is a list of attribute sets {source, target} where `source'
  6. # is the file system object (regular file or directory) to be
  7. # grafted in the file system at path `target'.
  8. contents
  9. , # In addition to `contents', the closure of the store paths listed
  10. # in `packages' are also placed in the Nix store of the tarball. This is
  11. # a list of attribute sets {object, symlink} where `object' if a
  12. # store path whose closure will be copied, and `symlink' is a
  13. # symlink to `object' that will be added to the tarball.
  14. storeContents ? []
  15. }:
  16. stdenv.mkDerivation {
  17. name = "tarball";
  18. builder = ./make-system-tarball.sh;
  19. buildInputs = [perl xz];
  20. inherit fileName pathsFromGraph;
  21. # !!! should use XML.
  22. sources = map (x: x.source) contents;
  23. targets = map (x: x.target) contents;
  24. # !!! should use XML.
  25. objects = map (x: x.object) storeContents;
  26. symlinks = map (x: x.symlink) storeContents;
  27. # For obtaining the closure of `storeContents'.
  28. exportReferencesGraph =
  29. map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents;
  30. }