use private registry for extra-math

This commit is contained in:
Charlotte 🦝 Delenk 2024-09-08 18:54:42 +02:00
parent badc11aac5
commit ace180dc6f
6 changed files with 33 additions and 16 deletions

2
.cargo/config.toml Normal file
View file

@ -0,0 +1,2 @@
[registries]
procyos = { index = "sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/" }

3
Cargo.lock generated
View file

@ -35,7 +35,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "extra-math" name = "extra-math"
version = "0.1.0" version = "0.1.0"
source = "git+https://git.chir.rs/ProcyOS/extra_math.git#38d6abf85718d053f45c6b77c88607f245be55e0" source = "sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/"
checksum = "fa1061c295d9aba46636f4a0b16372ea314fcd6c8dfaf447cc719a6a9dce63aa"
dependencies = [ dependencies = [
"libm", "libm",
"num-traits", "num-traits",

View file

@ -22,7 +22,7 @@ args @ {
workspaceSrc, workspaceSrc,
ignoreLockHash, ignoreLockHash,
}: let }: let
nixifiedLockHash = "a2b590ebe54f290db87e552bf935f4bb11098b9ba02841e8ed499aad10c57419"; nixifiedLockHash = "74300319bd44e956ec1895afc04c903cca3100257d7c627ba18911908b487b47";
workspaceSrc = workspaceSrc =
if args.workspaceSrc == null if args.workspaceSrc == null
then ./. then ./.
@ -113,15 +113,15 @@ in
}; };
}); });
"git+https://git.chir.rs/ProcyOS/extra_math.git".extra-math."0.1.0" = overridableMkRustCrate (profileName: rec { "sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/".extra-math."0.1.0" = overridableMkRustCrate (profileName: rec {
name = "extra-math"; name = "extra-math";
version = "0.1.0"; version = "0.1.0";
registry = "git+https://git.chir.rs/ProcyOS/extra_math.git"; registry = "sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/";
src = fetchCrateGit { src = fetchCrateAlternativeRegistry {
url = "https://git.chir.rs/ProcyOS/extra_math.git"; index = sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/;
name = "extra-math"; name = "extra-math";
version = "0.1.0"; version = "0.1.0";
rev = "38d6abf85718d053f45c6b77c88607f245be55e0"; sha256 = "fa1061c295d9aba46636f4a0b16372ea314fcd6c8dfaf447cc719a6a9dce63aa";
}; };
features = builtins.concatLists [ features = builtins.concatLists [
["default"] ["default"]
@ -351,7 +351,7 @@ in
]; ];
dependencies = { dependencies = {
bitvec = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bitvec."1.0.1" {inherit profileName;}).out; bitvec = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bitvec."1.0.1" {inherit profileName;}).out;
extra_math = (rustPackages."git+https://git.chir.rs/ProcyOS/extra_math.git".extra-math."0.1.0" {inherit profileName;}).out; extra_math = (rustPackages."sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/".extra-math."0.1.0" {inherit profileName;}).out;
libm = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".libm."0.2.8" {inherit profileName;}).out; libm = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".libm."0.2.8" {inherit profileName;}).out;
num_traits = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".num-traits."0.2.19" {inherit profileName;}).out; num_traits = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".num-traits."0.2.19" {inherit profileName;}).out;
${ ${

View file

@ -11,7 +11,7 @@ categories = ["development-tools::testing", "no-std", "no-std::no-alloc"]
[dependencies] [dependencies]
bitvec = { version = "1.0.1", default-features = false } bitvec = { version = "1.0.1", default-features = false }
extra-math = { git = "https://git.chir.rs/ProcyOS/extra_math.git", version = "0.1.0" } extra-math = { version = "0.1.0", registry = "procyos" }
libm = "0.2.8" libm = "0.2.8"
num-traits = { version = "0.2.19", default-features = false, features = [ num-traits = { version = "0.2.19", default-features = false, features = [
"libm", "libm",

View file

@ -14,16 +14,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1713199118, "lastModified": 1725812914,
"narHash": "sha256-MlLdAvk+zXCFUy280sY6LqtykqWXIkKVXo72J7a6HlU=", "narHash": "sha256-xYdN9kbpLScjJGll6IE7Cnnn1UhIMKUwGyrzKjQvPgI=",
"owner": "cargo2nix", "owner": "DarkKirb",
"repo": "cargo2nix", "repo": "cargo2nix",
"rev": "1efb03f2f794ad5eed17e807e858c4da001dbc3e", "rev": "7bb1ee00029ab2e7bd8ba03f5563cdbb998ab6f7",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "cargo2nix", "owner": "DarkKirb",
"ref": "main", "ref": "master",
"repo": "cargo2nix", "repo": "cargo2nix",
"type": "github" "type": "github"
} }

View file

@ -12,7 +12,7 @@
}; };
cargo2nix = { cargo2nix = {
url = github:cargo2nix/cargo2nix/main; url = github:DarkKirb/cargo2nix/master;
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
inputs.rust-overlay.follows = "rust-overlay"; inputs.rust-overlay.follows = "rust-overlay";
@ -36,6 +36,9 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;
}; };
registryDownloadPaths = {
"sparse+https://git.chir.rs/api/packages/ProcyOS/cargo/" = "https://git.chir.rs/api/packages/ProcyOS/cargo/api/v1/crates";
};
rustPkgs = pkgs.rustBuilder.makePackageSet { rustPkgs = pkgs.rustBuilder.makePackageSet {
packageFun = import ./Cargo.nix; packageFun = import ./Cargo.nix;
rustChannel = "nightly"; rustChannel = "nightly";
@ -45,6 +48,17 @@
"rand_testsuite/default" "rand_testsuite/default"
"rand_testsuite/full" "rand_testsuite/full"
]; ];
fetchCrateAlternativeRegistry = {
index,
name,
version,
sha256,
}:
pkgs.fetchurl {
name = "${name}-${version}.tar.gz";
url = "${registryDownloadPaths.${index}}/${name}/${version}/download";
inherit sha256;
};
}; };
in rec { in rec {
devShells.default = with pkgs; devShells.default = with pkgs;