Skip to content

Out-links for remote stores on shared filesystems #7890

@mupdt

Description

@mupdt

Is your feature request related to a problem? Please describe.

We are using nix's remote store feature in the following setup:

  • Machine A and B share filesystems (via NFS).
  • Machine A is where users log in and do their work.
  • Machine B is where the nix-daemon runs (this is the only host that can write
    to the nix store on the shared filesystem).

Users on machine A will be using nix like this:

machine-a % nix build --store ssh-ng://machine-b --out-link result-foo ...

Right now the out link is not created at all (neither on the remote store or
locally).

Describe the solution you'd like

The out link should be created on the remote store if we're sure that the
filesystems are shared.

We are aware that we cannot assume remote stores have a local filesystem
available. Moreover, we cannot assume the remote store shares its filesystem
with the client. We therefore propose to add an option to remote stores that
gives a hint to nix that the remote store should be treated as "shared" and that
it should create out-links. Something along these lines:

machine-a % nix build --store ssh-ng://machine-b?shared-fs=true --out-link result-foo ...

Describe alternatives you've considered

Some alternatives we considered:

  • lift the concept of out-links all the way to the Store class. This means
    that all stores, not only LocalFSStore would have a way to create out links.

  • a wrapper around our nix tooling that creates out-links out of band (this has
    a race condition with the GC unfotunately).

cc: @thufschmitt @rickynils

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature request or proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions