@@ -14,7 +14,6 @@ use nix_index::files::FileTree;
1414use nix_index:: hydra:: Fetcher ;
1515use nix_index:: listings:: { self , try_load_paths_cache} ;
1616use nix_index:: package:: StorePath ;
17- use nix_index:: CACHE_URL ;
1817use separator:: Separatable ;
1918
2019/// The main function of this module: creates a new nix-index database.
@@ -30,7 +29,7 @@ async fn update_index(args: &Args) -> Result<()> {
3029 } ;
3130
3231 eprintln ! ( "+ querying available packages" ) ;
33- let fetcher = Fetcher :: new ( CACHE_URL . to_string ( ) ) . map_err ( Error :: ParseProxy ) ?;
32+ let fetcher = Fetcher :: new ( args . substituter . to_string ( ) ) . map_err ( Error :: ParseProxy ) ?;
3433 let ( files, watch) = match cached {
3534 Some ( ( f, w) ) => ( Either :: Left ( f) , w) ,
3635 None => {
@@ -150,6 +149,10 @@ struct Args {
150149 #[ clap( short = 's' , long, value_name = "platform" ) ]
151150 system : Option < String > ,
152151
152+ /// The substituter (binary cache) URL to query
153+ #[ clap( long, default_value = "https://cache.nixos.org" ) ]
154+ substituter : String ,
155+
153156 /// Zstandard compression level
154157 #[ clap( short, long = "compression" , default_value = "22" ) ]
155158 compression_level : i32 ,
0 commit comments