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

storePath as a settable property of derivation #5067

Open
veprbl opened this issue Jul 29, 2021 · 5 comments
Open

storePath as a settable property of derivation #5067

veprbl opened this issue Jul 29, 2021 · 5 comments

Comments

@veprbl
Copy link
Member

veprbl commented Jul 29, 2021

Is your feature request related to a problem? Please describe.
I would like to store semi-large pieces of data in the Nix store. In a typical HPC environment there would be different filesystems for storing lots of small files (NFS/AFS with limited quota) and for storing large files (GPFS/Ceph with block size 256KiB or more).

Describe the solution you'd like
Would be nice to be able to define derivations that produce an output into a custom store path:

derivation {
  name = "data";
  # ...
  storePath = /mnt/disk;
}

This is already partially working in a sense that an existing Nix installation can be run with different values of NIX_STORE_DIR and the same value of NIX_STATE_DIR.

Describe alternatives you've considered
The alternative is to store symlinks in the store

stdenv.mkDerivation {
  # ...
  installPhase = ''
    out_data="/mnt/disk/$(basename $out)"
    mv data "$out_data"
    ln -s "$out_data" "$out"
  '';
}

Lacks most of the benefits: proper garbage collection, sandboxing support, etc.

Possible overlap with #5025

@Ericson2314
Copy link
Member

I am also reminded of how different remote builders can have different "features" to ensure that certain derivations go just to then.

I think that + a union store that does a bind mount is the right way to do this.

@stale
Copy link

stale bot commented Apr 17, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Apr 17, 2022
@veprbl
Copy link
Member Author

veprbl commented Apr 17, 2022

Still wanted

@stale stale bot removed the stale label Apr 17, 2022
@stale stale bot added the stale label Oct 30, 2022
@stale stale bot removed the stale label Dec 5, 2022
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/super-colliding-nix-stores/28462/11

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/install-some-nix-packages-to-other-location-than-nix-store/30770/12

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

No branches or pull requests

4 participants