Verify the nix store before starting a build run.
This commit is contained in:
@@ -12,6 +12,7 @@ use crate::git_util::git_force_into_state;
|
||||
use crate::git_util::git_init_at_rev;
|
||||
use crate::nix_util::FlakeLock;
|
||||
use crate::nix_util::nix_flake_update;
|
||||
use crate::nix_util::nix_store_verify_repair_check_contents;
|
||||
use crate::nix_util::nixos_build_target;
|
||||
use crate::nix_util::parse_flake_lock;
|
||||
|
||||
@@ -33,6 +34,8 @@ pub(crate) async fn run_build(args: BuildArgs) -> Result<()> {
|
||||
|
||||
let db_handle = DbHandle::new(Some(database_path)).await?;
|
||||
|
||||
verify_nix_store().await?;
|
||||
|
||||
for target_name in args.target {
|
||||
let target_config = {
|
||||
let target_config = config.get_target_config(&target_name)?;
|
||||
@@ -85,6 +88,12 @@ async fn prepare_flake_repo(config_root: &Config, target_config: &TargetConfig)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn verify_nix_store() -> Result<()> {
|
||||
nix_store_verify_repair_check_contents().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn run_nix_update(config_root: &Config, target_config: &TargetConfig) -> Result<()> {
|
||||
let flake_directory = target_config.get_flake_directory(config_root)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user