diff options
| author | seth <[email protected]> | 2024-09-13 19:31:06 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-09-13 23:31:06 +0000 |
| commit | 91dbf60e1ee45403faaa38aca48cd362a1889095 (patch) | |
| tree | 3eb410cc57b84d1c2e6d741a6551b815cc6bf86f /src | |
| parent | cc183fccca73df619c78dd0ca2567ac547c56ad2 (diff) | |
fix: check all nixpkgs installables when none are given (#3)
* fix: actually check all nixpkgs installables when none are given
* build(nix): fix darwin
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.rs | 1 | ||||
| -rw-r--r-- | src/command.rs | 21 |
2 files changed, 9 insertions, 13 deletions
@@ -4,7 +4,6 @@ use clap::Parser; #[command(version, about, long_about = None)] pub struct Cli { /// A list of Nix installables to look for. If not given, all paths in nixpkgs are checked - #[arg(required_unless_present("configuration"))] pub installables: Option<Vec<String>>, /// Flake reference pointing to a NixOS or nix-darwin configuration diff --git a/src/command.rs b/src/command.rs index ef3461e..8e8a312 100644 --- a/src/command.rs +++ b/src/command.rs @@ -16,11 +16,14 @@ impl Run for crate::Cli { #[instrument(skip(self))] async fn run(&self) -> Result<()> { let store_paths = if let Some(installables) = self.installables.clone() { - installables_paths(installables).await? + resolve_installables(installables).await? } else if let Some(configuration) = &self.configuration { - configuration_paths(configuration)? + println!("❓ Indexing requisites of configuration closure"); + nix::configuration_closure_paths(configuration)? } else { - nix::all_flake_installables(&self.flake)? + println!("❓ Indexing all installables of flake `{}`", self.flake); + let installables = nix::all_flake_installables(&self.flake)?; + resolve_installables(installables).await? }; check_store_paths(&self.binary_cache, &store_paths, self.show_missing).await?; @@ -30,9 +33,9 @@ impl Run for crate::Cli { } #[instrument(skip(installables))] -async fn installables_paths(installables: Vec<String>) -> Result<Vec<String>> { +async fn resolve_installables(installables: Vec<String>) -> Result<Vec<String>> { println!( - "🔃 Attempting to evaluating {} installable(s)", + "🔃 Attempting to evaluate {} installable(s)", installables.len() ); @@ -53,14 +56,8 @@ async fn installables_paths(installables: Vec<String>) -> Result<Vec<String>> { .await?; println!("✅ Evaluated {} installable(s)!", out_paths.len()); - Ok(out_paths) -} -#[instrument(skip(configuration_ref))] -fn configuration_paths(configuration_ref: &str) -> Result<Vec<String>> { - println!("❓ Indexing requisites of configuration closure"); - let closure_paths = nix::configuration_closure_paths(configuration_ref)?; - Ok(closure_paths) + Ok(out_paths) } #[allow(clippy::cast_precision_loss)] |
