Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::flake::NonEmptyInputAttrPath Class Reference

#include <lockfile.hh>

Public Member Functions

const InputAttrPath & get () const
 operator const InputAttrPath & () const
const FlakeId & inputName () const
InputAttrPath parent () const
auto operator<=> (const NonEmptyInputAttrPath &other) const =default

Static Public Member Functions

static std::optional< NonEmptyInputAttrPath > parse (std::string_view s)
static std::optional< NonEmptyInputAttrPath > make (InputAttrPath path)
static NonEmptyInputAttrPath append (const InputAttrPath &prefix, const FlakeId &element)

Detailed Description

A non-empty input attribute path.

Input attribute paths identify inputs in a flake. An empty path would refer to the flake itself rather than an input, which contradicts the purpose of operations like override or update.

Member Function Documentation

◆ append()

NonEmptyInputAttrPath nix::flake::NonEmptyInputAttrPath::append ( const InputAttrPath & prefix,
const FlakeId & element )
inlinestatic

Append an element to a path, creating a non-empty path. This is always safe because adding an element guarantees non-emptiness.

◆ inputName()

const FlakeId & nix::flake::NonEmptyInputAttrPath::inputName ( ) const
inline

Get the final component of the path (the input name). For a path like "a/b/c", returns "c".

◆ make()

std::optional< NonEmptyInputAttrPath > nix::flake::NonEmptyInputAttrPath::make ( InputAttrPath path)
static

Construct from an already-parsed path. Returns std::nullopt if the path is empty.

◆ parent()

InputAttrPath nix::flake::NonEmptyInputAttrPath::parent ( ) const
inline

Get the parent path (all components except the last). For a path like "a/b/c", returns "a/b".

◆ parse()

std::optional< NonEmptyInputAttrPath > nix::flake::NonEmptyInputAttrPath::parse ( std::string_view s)
static

Parse and validate a non-empty input attribute path. Returns std::nullopt if the path is empty.


The documentation for this class was generated from the following files:
  • libflake/include/nix/flake/lockfile.hh
  • libflake/lockfile.cc