Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
nix::StoreReference Struct Reference

#include <store-reference.hh>

Classes

struct  Auto
 
struct  Specified
 

Public Types

using Params = std::map<std::string, std::string>
 
typedef std::variant< Auto, SpecifiedVariant
 

Public Member Functions

bool operator== (const StoreReference &rhs) const =default
 
std::string render () const
 

Static Public Member Functions

static StoreReference parse (const std::string &uri, const Params &extraParams=Params{})
 

Public Attributes

Variant variant
 
Params params
 

Detailed Description

A parsed Store URI (URI is a slight misnomer...), parsed but not yet resolved to a specific instance and query parms validated.

Supported values are:

  • local: The Nix store in /nix/store and database in /nix/var/nix/db, accessed directly.
  • daemon: The Nix store accessed via a Unix domain socket connection to nix-daemon.
  • unix://<path>: The Nix store accessed via a Unix domain socket connection to nix-daemon, with the socket located at <path>.
  • auto or `: Equivalent tolocalordaemon` depending on whether the user has write access to the local Nix store/database.
  • file://<path>: A binary cache stored in <path>.
  • https://<path>: A binary cache accessed via HTTP.
  • s3://<path>: A writable binary cache stored on Amazon's Simple Storage Service.
  • ssh://[user@]<host>: A remote Nix store accessed by running nix-store --serve via SSH.

You can pass parameters to the store type by appending ?key=value&key=value&... to the URI.

Member Function Documentation

◆ parse()

StoreReference nix::StoreReference::parse ( const std::string & uri,
const Params & extraParams = Params{} )
static

Parse a URI into a store reference.

◆ render()

std::string nix::StoreReference::render ( ) const

Render the whole store reference as a URI, including parameters.


The documentation for this struct was generated from the following files: