fix compatibility with Nix 2.32+ show-derivation output#346
fix compatibility with Nix 2.32+ show-derivation output#346rvem merged 1 commit intoserokell:masterfrom
Conversation
|
Well I can't merge anymore apparently, but please, @rvem ? @PhilTaken ? anybody |
Rutherther
left a comment
There was a problem hiding this comment.
Changes from this PR will break usage for people using nix store at different location than the default one.
| 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/") { |
There was a problem hiding this comment.
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.
| let deriver = if deriver_key.starts_with("/nix/store/") { | ||
| deriver_key.to_string() | ||
| } else { | ||
| format!("/nix/store/{}", deriver_key) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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)
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)
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)
Fixes #340