summaryrefslogtreecommitdiff
path: root/src/cli.rs
diff options
context:
space:
mode:
authorseth <[email protected]>2024-09-08 23:39:48 -0400
committerseth <[email protected]>2024-09-13 17:03:00 -0400
commitcc183fccca73df619c78dd0ca2567ac547c56ad2 (patch)
treea06a87049cd90e877e626b8ff31e27a373df8f39 /src/cli.rs
feat: initial commit
Diffstat (limited to 'src/cli.rs')
-rw-r--r--src/cli.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
new file mode 100644
index 0000000..073162c
--- /dev/null
+++ b/src/cli.rs
@@ -0,0 +1,26 @@
+use clap::Parser;
+
+#[derive(Clone, Debug, 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
+ #[allow(clippy::doc_markdown)] // Why does "NixOS" trigger this???
+ #[arg(short, long, conflicts_with("installables"))]
+ pub configuration: Option<String>,
+
+ /// URL of the substituter to check
+ #[arg(short, long, default_value = "https://cache.nixos.org")]
+ pub binary_cache: String,
+
+ /// Flake reference of nixpkgs (or other package repository)
+ #[arg(short, long, default_value = "nixpkgs")]
+ pub flake: String,
+
+ /// Show a list of store paths not found in the substituter
+ #[arg(short, long)]
+ pub show_missing: bool,
+}