Numerous test failures when using a non-standard store directory #1194

Open
opened 2026-04-26 04:04:03 +00:00 by rkjnsn · 4 comments

Describe the bug

When building Lix in a non-standard store directory (e.g., $HOME/.local/share/nix) the checkPhase fails with numerous errors. These appear to be caused by the tests hard-conding STORE_DIR to "/nix/store/" rather than using the current store directory (or even the value passed to Meson).

Steps To Reproduce

NIX_STORE_DIR=/Users/rkjnsn/.local/share/nix NIX_STATE_DIR=/Users/rkjnsn/.local/state/nix NIX_LOG_DIR=/Users/rkjnsn/.local/state/nix/log NIX_CONF_DIR=/Users/rkjnsn/.config/nix nix-build --expr '
  let pkgs = import <nixpkgs> {}; in pkgs.lixPackageSets.git.lix.override {
    storeDir = "/Users/rkjnsn/.local/share/nix";
    stateDir = "/Users/rkjnsn/.local/state/nix";
    confDir = "/Users/rkjnsn/.config/nix";
  }'

Many tests fail and the build aborts.

Expected behavior

Lix successfully builds and tests pass.

nix --version output

nix (Lix, like Nix) 2.96.0-dev
System type: aarch64-darwin
Additional system types: x86_64-darwin
Features: gc, signed-caches
System configuration file: /Users/rkjnsn/.config/nix/nix/nix.conf
User configuration files: /Users/rkjnsn/.config/nix/nix.conf:/etc/xdg/nix/nix.conf
Store directory: /Users/rkjnsn/.local/share/nix
State directory: /Users/rkjnsn/.local/state/nix/nix
Data directory: /Users/rkjnsn/.local/share/nix/lqs918y010llv39gbb9kkyxisqfsrmkh-lix-2.96.0-pre-20260317_96db7c79cf2a/share

## Describe the bug When building Lix in a non-standard store directory (e.g., `$HOME/.local/share/nix`) the checkPhase fails with numerous errors. These appear to be caused by the tests hard-conding STORE_DIR to "/nix/store/" rather than using the current store directory (or even the value passed to Meson). ## Steps To Reproduce ``` NIX_STORE_DIR=/Users/rkjnsn/.local/share/nix NIX_STATE_DIR=/Users/rkjnsn/.local/state/nix NIX_LOG_DIR=/Users/rkjnsn/.local/state/nix/log NIX_CONF_DIR=/Users/rkjnsn/.config/nix nix-build --expr ' let pkgs = import <nixpkgs> {}; in pkgs.lixPackageSets.git.lix.override { storeDir = "/Users/rkjnsn/.local/share/nix"; stateDir = "/Users/rkjnsn/.local/state/nix"; confDir = "/Users/rkjnsn/.config/nix"; }' ``` Many tests fail and the build aborts. ## Expected behavior Lix successfully builds and tests pass. ## `nix --version` output nix (Lix, like Nix) 2.96.0-dev System type: aarch64-darwin Additional system types: x86_64-darwin Features: gc, signed-caches System configuration file: /Users/rkjnsn/.config/nix/nix/nix.conf User configuration files: /Users/rkjnsn/.config/nix/nix.conf:/etc/xdg/nix/nix.conf Store directory: /Users/rkjnsn/.local/share/nix State directory: /Users/rkjnsn/.local/state/nix/nix Data directory: /Users/rkjnsn/.local/share/nix/lqs918y010llv39gbb9kkyxisqfsrmkh-lix-2.96.0-pre-20260317_96db7c79cf2a/share
Owner

Could you share more information about why you would like to use a different physical store path? This has some drastic consequences and is super unsupported in practice (we do accept patches to improve the situation obviously).

Could you share more information about why you would like to use a different physical store path? This has some drastic consequences and is super unsupported in practice (we do accept patches to improve the situation obviously).
Author

Getting admin access on this machine is somewhat painful, so I wanted to give it a go in my home directory. So far, having to disable the checkPhase on Lix is the only related issue I've encountered.

Getting admin access on this machine is somewhat painful, so I wanted to give it a go in my home directory. So far, having to disable the checkPhase on Lix is the only related issue I've encountered.
Owner

@rkjnsn Interesting! I'm curious: do you have unprivileged user namespaces, if so, have you considered running the vanilla Nix but use a bind mounts inside of an unprivileged user namespace for the /nix/store that lives in your HOME directory? There's a couple of tools that can do that for you more or less automatically.

@rkjnsn Interesting! I'm curious: do you have unprivileged user namespaces, if so, have you considered running the vanilla Nix but use a bind mounts inside of an unprivileged user namespace for the `/nix/store` that lives in your HOME directory? There's a couple of tools that can do that for you more or less automatically.
Author

That's a Linux feature, right? This is a macOS system, and I didn't see anything similar when I was researching. I also wasn't sure how it would interact with, e.g., using Home Manager.

That's a Linux feature, right? This is a macOS system, and I didn't see anything similar when I was researching. I also wasn't sure how it would interact with, e.g., using Home Manager.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/lix#1194
No description provided.