Skip to content

Commit

Permalink
Add nh home switch -b ...
Browse files Browse the repository at this point in the history
Closes #87
  • Loading branch information
viperML committed Apr 19, 2024
1 parent c9cb034 commit 23587ea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/home.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ impl HomeRebuildArgs {
}
}

if let Some(ext) = &self.backup_extension {
info!("Using {} as the backup extension", ext);
env::set_var("HOME_MANAGER_BACKUP_EXT", ext);
}

commands::CommandBuilder::default()
.args([&format!("{}/activate", out_link_str)])
.message("Activating configuration")
Expand Down
4 changes: 4 additions & 0 deletions src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ pub struct HomeRebuildArgs {
/// Extra arguments passed to nix build
#[arg(last = true)]
pub extra_args: Vec<String>,

/// Move existing files by backing up with the extension
#[arg(long, short = 'b')]
pub backup_extension: Option<String>,
}

#[derive(Debug, Parser)]
Expand Down

0 comments on commit 23587ea

Please sign in to comment.