Skip to content

Commit

Permalink
feat: add FlakeUpdate command (#50)
Browse files Browse the repository at this point in the history
Closes #47.

I basically just copied and pasted the `FlakeMetadata` implementation. I
imagine at some point the flake subcommands might be refactored into
their own namespace, but it seems appropriate to just submit the
simplest PR first.
  • Loading branch information
OliverEvans96 authored Aug 14, 2023
1 parent 114199c commit 5d7ce86
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions crates/runix/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ impl TypedCommand for FlakeMetadata {
type Output = crate::flake_metadata::FlakeMetadata;
}

/// `nix flake update` Command
#[derive(Debug, Default, Clone)]
pub struct FlakeUpdate {
pub eval: EvaluationArgs,
pub flake: FlakeArgs,
pub flake_ref: Option<FlakeRefArg>,
}

impl NixCliCommand for FlakeUpdate {
type Own = Option<FlakeRefArg>;

const EVAL_ARGS: Group<Self, EvaluationArgs> = Some(|d| d.eval.clone());
const FLAKE_ARGS: Group<Self, FlakeArgs> = Some(|d| d.flake.clone());
const OWN_ARGS: Group<Self, Self::Own> = Some(|d| d.flake_ref.clone());
const SUBCOMMAND: &'static [&'static str] = &["flake", "update"];
}

/// `nix develop` Command
#[derive(Debug, Default, Clone)]
pub struct Develop {
Expand Down

0 comments on commit 5d7ce86

Please sign in to comment.