Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
installable-flake.hh
Go to the documentation of this file.
1#pragma once
3
5#include "lix/libexpr/eval.hh"
6
7namespace nix {
8
16struct ExtraPathInfoFlake : ExtraPathInfoValue
17{
21 struct Flake {
22 FlakeRef originalRef;
23 FlakeRef lockedRef;
24 };
25
26 Flake flake;
27
28 ExtraPathInfoFlake(Value && v, Flake && f)
29 : ExtraPathInfoValue(std::move(v)), flake(f)
30 { }
31};
32
33struct InstallableFlake : InstallableValue
34{
35 FlakeRef flakeRef;
36 Strings attrPaths;
37 Strings prefixes;
38 ExtendedOutputsSpec extendedOutputsSpec;
39 const flake::LockFlags & lockFlags;
40 mutable std::shared_ptr<flake::LockedFlake> _lockedFlake;
41
42 InstallableFlake(
45 FlakeRef && flakeRef,
46 std::string_view fragment,
47 ExtendedOutputsSpec extendedOutputsSpec,
48 Strings attrPaths,
49 Strings prefixes,
50 const flake::LockFlags & lockFlags);
51
52 std::string what() const override { return flakeRef.to_string() + "#" + *attrPaths.begin(); }
53
54 std::vector<std::string> getActualAttrPaths();
55
57
58 std::pair<Value *, PosIdx> toValue(EvalState & state) override;
59
64 std::vector<ref<eval_cache::AttrCursor>> getCursors(EvalState & state) override;
65
66 std::shared_ptr<flake::LockedFlake> getLockedFlake(EvalState & state) const;
67
68 FlakeRef nixpkgsFlakeRef(EvalState & state) const;
69};
70
79static inline FlakeRef defaultNixpkgsFlakeRef()
80{
81 return FlakeRef::fromAttrs({{"type","indirect"}, {"id", "nixpkgs"}});
82}
83
84ref<eval_cache::EvalCache> openEvalCache(
86 std::shared_ptr<flake::LockedFlake> lockedFlake);
87
88}
Definition eval.hh:685
Definition eval-cache.hh:25
Definition ref.hh:19
std::vector< DerivedPathWithInfo > DerivedPathsWithInfo
Definition installables.hh:93
Definition outputs-spec.hh:97
Definition installable-flake.hh:21
Definition installable-value.hh:39
Definition flakeref.hh:35
std::string what() const override
Definition installable-flake.hh:52
DerivedPathsWithInfo toDerivedPaths(EvalState &state) override
Definition installable-flake.cc:61
std::vector< ref< eval_cache::AttrCursor > > getCursors(EvalState &state) override
Definition installable-flake.cc:145
Definition command.hh:112
Definition flake.hh:113