Nix 2.26.3
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
4#include "common-eval-args.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(std::move(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(
44 ref<EvalState> state,
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>>
65 getCursors(EvalState & state) override;
66
67 std::shared_ptr<flake::LockedFlake> getLockedFlake() const;
68
69 FlakeRef nixpkgsFlakeRef() const;
70};
71
80static inline FlakeRef defaultNixpkgsFlakeRef()
81{
82 return FlakeRef::fromAttrs(fetchSettings, {{"type","indirect"}, {"id", "nixpkgs"}});
83}
84
85ref<eval_cache::EvalCache> openEvalCache(
86 EvalState & state,
87 std::shared_ptr<flake::LockedFlake> lockedFlake);
88
89}
Definition eval.hh:182
Definition ref.hh:15
std::vector< DerivedPathWithInfo > DerivedPathsWithInfo
Definition installables.hh:95
boost::format f(fs)
Definition outputs-spec.hh:96
Definition installable-flake.hh:21
Definition installable-value.hh:39
std::string what() const override
Definition installable-flake.hh:52
DerivedPathsWithInfo toDerivedPaths() override
Definition installable-flake.cc:76
std::vector< ref< eval_cache::AttrCursor > > getCursors(EvalState &state) override
Definition installable-flake.cc:161
Definition command.hh:136