Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
installable-flake.hh
Go to the documentation of this file.
1#pragma once
3
5
6namespace nix {
7
15struct ExtraPathInfoFlake : ExtraPathInfoValue
16{
20 struct Flake
21 {
22 FlakeRef originalRef;
23 FlakeRef lockedRef;
24 };
25
26 Flake flake;
27
28 ExtraPathInfoFlake(Value && v, Flake && f)
29 : ExtraPathInfoValue(std::move(v))
30 , flake(std::move(f))
31 {
32 }
33};
34
35struct InstallableFlake : InstallableValue
36{
37 FlakeRef flakeRef;
38 Strings attrPaths;
39 Strings prefixes;
40 ExtendedOutputsSpec extendedOutputsSpec;
41 const flake::LockFlags & lockFlags;
42 mutable std::shared_ptr<flake::LockedFlake> _lockedFlake;
43
44 InstallableFlake(
46 ref<EvalState> state,
47 FlakeRef && flakeRef,
48 std::string_view fragment,
49 ExtendedOutputsSpec extendedOutputsSpec,
50 Strings attrPaths,
51 Strings prefixes,
52 const flake::LockFlags & lockFlags);
53
54 std::string what() const override
55 {
56 return flakeRef.to_string() + "#" + *attrPaths.begin();
57 }
58
59 std::vector<std::string> getActualAttrPaths();
60
61 DerivedPathsWithInfo toDerivedPaths() override;
62
63 std::pair<Value *, PosIdx> toValue(EvalState & state, AutoCall autoCall) override;
64
69 std::vector<ref<eval_cache::AttrCursor>> getCursors(EvalState & state, AutoCall autoCall) override;
70
71 ref<flake::LockedFlake> getLockedFlake() const;
72
73 FlakeRef nixpkgsFlakeRef() const;
74};
75
84static inline FlakeRef defaultNixpkgsFlakeRef()
85{
86 return FlakeRef::fromAttrs({{"type", "indirect"}, {"id", "nixpkgs"}});
87}
88
89} // namespace nix
Definition eval.hh:420
Definition ref.hh:58
AutoCall
Definition installable-value.hh:78
std::vector< DerivedPathWithInfo > DerivedPathsWithInfo
Definition installables.hh:95
Definition outputs-spec.hh:110
Definition installable-flake.hh:21
Definition installable-value.hh:44
Definition flakeref.hh:44
std::string what() const override
Definition installable-flake.hh:54
std::vector< ref< eval_cache::AttrCursor > > getCursors(EvalState &state, AutoCall autoCall) override
Definition installable-flake.cc:149
Definition command.hh:148
Definition flake.hh:142