mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
lib.fileset.gitTracked/gitTrackedWith: init
A configuration parameter for gitTrackedWith will be introduced in the next commit
This commit is contained in:
parent
91c993afb9
commit
2dfb1d36cf
4 changed files with 255 additions and 1 deletions
|
@ -825,4 +825,23 @@ rec {
|
|||
${baseNameOf root} =
|
||||
fromFile (baseNameOf root) rootType;
|
||||
};
|
||||
|
||||
# Mirrors the contents of a Nix store path relative to a local path as a file set.
|
||||
# Some notes:
|
||||
# - The store path is read at evaluation time.
|
||||
# - The store path must not include files that don't exist in the respective local path.
|
||||
#
|
||||
# Type: Path -> String -> FileSet
|
||||
_mirrorStorePath = localPath: storePath:
|
||||
let
|
||||
recurse = focusedStorePath:
|
||||
mapAttrs (name: type:
|
||||
if type == "directory" then
|
||||
recurse (focusedStorePath + "/${name}")
|
||||
else
|
||||
type
|
||||
) (builtins.readDir focusedStorePath);
|
||||
in
|
||||
_create localPath
|
||||
(recurse storePath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue