mirror of
https://github.com/nix-community/naersk
synced 2024-11-22 19:53:05 +00:00
Remove useless functions
This commit is contained in:
parent
b3b328b088
commit
dc21c17d58
1 changed files with 0 additions and 36 deletions
36
lib.nix
36
lib.nix
|
@ -56,42 +56,6 @@ rec
|
|||
mkMetadataKey = name: version:
|
||||
"checksum ${name} ${version} (registry+https://github.com/rust-lang/crates.io-index)";
|
||||
|
||||
# A cargo lock that only includes the transitive dependencies of the
|
||||
# package (and the package itself). This package is Nix-generated and thus
|
||||
# only the transitive dependencies contribute to the package's derivation.
|
||||
cargolockFor = cargolock: name: version:
|
||||
let
|
||||
tdeps = transitiveDeps cargolock name version;
|
||||
tdepPrefix = dep: "checksum ${dep.name} ${dep.version}";
|
||||
isTransitiveDep = p: lib.any
|
||||
(d: d.package.name == p.name && d.package.version == p.version)
|
||||
tdeps;
|
||||
isTransitiveDepChecksumKey = k:
|
||||
lib.any (tdep: lib.hasPrefix (tdepPrefix tdep.package) k) tdeps;
|
||||
in
|
||||
cargolock // {
|
||||
package = lib.filter (
|
||||
p:
|
||||
(p.name == name && p.version == version) || (isTransitiveDep p)
|
||||
) cargolock.package;
|
||||
|
||||
metadata = lib.filterAttrs (k: _: isTransitiveDepChecksumKey k)
|
||||
cargolock.metadata;
|
||||
};
|
||||
|
||||
# A stripped down Cargo.toml, similar to cargolockFor
|
||||
cargotomlFor = name: version:
|
||||
{
|
||||
package =
|
||||
{
|
||||
name = "dummy";
|
||||
version = "0.1.0";
|
||||
edition = "2018";
|
||||
};
|
||||
dependencies =
|
||||
{ ${name} = version; };
|
||||
};
|
||||
|
||||
# A very minimal 'src' which makes cargo happy nonetheless
|
||||
dummySrc =
|
||||
{ cargoconfig # string
|
||||
|
|
Loading…
Reference in a new issue