forked from ipetkov/crane
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This contains the parts of the Crane lib that don’t depend on `pkgs`. Fixes ipetkov#699.
- Loading branch information
Showing
17 changed files
with
97 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
{ pkgs ? import <nixpkgs> { } }: | ||
{ pkgs ? import <nixpkgs> { } | ||
, pureLib ? import ./pure-lib { inherit (pkgs) lib; } | ||
}: | ||
|
||
pkgs.callPackage ./lib { } | ||
pkgs.callPackage ./lib { inherit pureLib; } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ lib | ||
}: | ||
|
||
let | ||
minSupported = "24.05"; | ||
current = lib.concatStringsSep "." (lib.lists.sublist 0 2 (lib.splitVersion lib.version)); | ||
isUnsupported = lib.versionOlder current minSupported; | ||
msg = "crane requires at least nixpkgs-${minSupported}, supplied nixpkgs-${current}"; | ||
|
||
scopeFn = self: | ||
let | ||
internalCrateNameFromCargoToml = import ./internalCrateNameFromCargoToml.nix { inherit lib; }; | ||
internalCrateNameForCleanSource = import ./internalCrateNameForCleanSource.nix { | ||
inherit internalCrateNameFromCargoToml; | ||
}; | ||
|
||
filterCargoSources = import ./filterCargoSources.nix { inherit lib; }; | ||
registryFromDownloadUrl = import ./registryFromDownloadUrl.nix { inherit lib; }; | ||
crateRegistries = registryFromDownloadUrl { | ||
dl = "https://static.crates.io/crates"; | ||
indexUrl = "https://github.com/rust-lang/crates.io-index"; | ||
}; | ||
in | ||
{ | ||
inherit crateRegistries filterCargoSources registryFromDownloadUrl; | ||
|
||
appendCrateRegistries = input: self.overrideScope (_final: prev: { | ||
crateRegistries = prev.crateRegistries // (lib.foldl (a: b: a // b) { } input); | ||
}); | ||
|
||
cleanCargoSource = import ./cleanCargoSource.nix { | ||
inherit filterCargoSources internalCrateNameForCleanSource lib; | ||
}; | ||
cleanCargoToml = import ./cleanCargoToml.nix { }; | ||
|
||
crateNameFromCargoToml = import ./crateNameFromCargoToml.nix { | ||
inherit internalCrateNameFromCargoToml lib; | ||
}; | ||
|
||
findCargoFiles = import ./findCargoFiles.nix { inherit lib; }; | ||
|
||
path = import ./path.nix { | ||
inherit internalCrateNameForCleanSource lib; | ||
}; | ||
|
||
registryFromGitIndex = import ./registryFromGitIndex.nix { inherit registryFromDownloadUrl; }; | ||
registryFromSparse = import ./registryFromSparse.nix { inherit registryFromDownloadUrl lib; }; | ||
urlForCargoPackage = import ./urlForCargoPackage.nix { inherit crateRegistries lib; }; | ||
}; | ||
craneLib = lib.makeScope lib.callPackage scopeFn; | ||
in | ||
lib.warnIf isUnsupported msg craneLib |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.