Skip to content

fix compatibility with Nix 2.32+ show-derivation output#346

Merged
rvem merged 1 commit intoserokell:masterfrom
XYenon:fix/nix-2-32
Nov 4, 2025
Merged

fix compatibility with Nix 2.32+ show-derivation output#346
rvem merged 1 commit intoserokell:masterfrom
XYenon:fix/nix-2-32

Conversation

@XYenon
Copy link
Copy Markdown
Contributor

@XYenon XYenon commented Oct 19, 2025

Fixes #340

Copy link
Copy Markdown

@x10an14 x10an14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@notgne2
Copy link
Copy Markdown
Contributor

notgne2 commented Nov 3, 2025

Well I can't merge anymore apparently, but please, @rvem ? @PhilTaken ? anybody

@rvem rvem merged commit 9c870f6 into serokell:master Nov 4, 2025
9 of 10 checks passed
@XYenon XYenon deleted the fix/nix-2-32 branch November 5, 2025 01:50
Copy link
Copy Markdown

@Rutherther Rutherther left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes from this PR will break usage for people using nix store at different location than the default one.

Comment thread src/push.rs
let new_deriver = &if data.supports_flakes || data.deploy_data.merged_settings.remote_build.unwrap_or(false) {
// Nix 2.32+ returns relative paths (without /nix/store/ prefix) in show-derivation output
// Normalize to always use full store paths
let deriver = if deriver_key.starts_with("/nix/store/") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a check for just '/' would be better. That way people using nix store at different locations will also be able to use this.

Comment thread src/push.rs
let deriver = if deriver_key.starts_with("/nix/store/") {
deriver_key.to_string()
} else {
format!("/nix/store/{}", deriver_key)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't allow locations for nix store other than /nix/store. One solution would be to look at $NIX_STORE_DIR env var for location of the store and prepend that, only defaulting to /nix/store. Another would be to utilize the output of nix eval --expr builtins.storeDir.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, the command is definitely better, because this can also be configured in nix.conf - https://nix.dev/manual/nix/2.32/command-ref/conf-file.html#conf-store

dguibert added a commit to dguibert/deploy-rs that referenced this pull request Nov 27, 2025
 serokell#346 fixes compatibility with Nix 2.32+ but as stated in [1] it doesn't allow
 locations for nix store other than /nix/store.

This patch calls nix eval to retreive the storeDir not relying one the hard-coded value.

[1] serokell#346 (comment)
dguibert added a commit to dguibert/deploy-rs that referenced this pull request Nov 27, 2025
 serokell#346 fixes compatibility with Nix 2.32+ but as stated in [1] it doesn't allow
 locations for nix store other than /nix/store.

This patch calls nix eval to retreive the storeDir not relying one the hard-coded value.

[1] serokell#346 (comment)
neunenak pushed a commit to neunenak/deploy-rs that referenced this pull request Feb 2, 2026
 serokell#346 fixes compatibility with Nix 2.32+ but as stated in [1] it doesn't allow
 locations for nix store other than /nix/store.

This patch calls nix eval to retreive the storeDir not relying one the hard-coded value.

[1] serokell#346 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot deploy with Nix 2.32(pre)

5 participants