Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix.conf: move write for 'fallback', always set it #102

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions magic-nix-cache/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ async fn main_cli() -> Result<()> {
.open(&nix_conf_path)
.with_context(|| "Creating nix.conf")?;

// always enable fallback, first
nix_conf
.write_all(b"fallback = true\n")
.with_context(|| "Setting fallback in nix.conf")?;

let store = Arc::new(NixStore::connect()?);

let narinfo_negative_cache = Arc::new(RwLock::new(HashSet::new()));
Expand Down
8 changes: 1 addition & 7 deletions magic-nix-cache/src/pbh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,7 @@ pub async fn setup_legacy_post_build_hook(

/* Update nix.conf. */
nix_conf
.write_all(
format!(
"fallback = true\npost-build-hook = {}\n",
post_build_hook_script.display()
)
.as_bytes(),
)
.write_all(format!("post-build-hook = {}\n", post_build_hook_script.display()).as_bytes())
.with_context(|| "Writing to nix.conf")?;

Ok(())
Expand Down
Loading