Nix  2.93.0-dev
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
cmd-profiles.hh
Go to the documentation of this file.
1#pragma once
3
5#include "lix/libexpr/eval.hh"
9#include "lix/libutil/json-fwd.hh"
10#include "lix/libutil/url.hh"
12
13#include <string>
14#include <set>
15
16namespace nix
17{
18
20{
21 FlakeRef originalRef;
22 // FIXME: record original attrpath.
23 FlakeRef lockedRef;
24 std::string attrPath;
25 ExtendedOutputsSpec outputs;
26
27 bool operator<(const ProfileElementSource & other) const;
28
29 std::string to_string() const;
30};
31
32constexpr int DEFAULT_PRIORITY = 5;
33
35{
36 StorePathSet storePaths;
37 std::optional<ProfileElementSource> source;
38 bool active = true;
39 NixInt::Inner priority = DEFAULT_PRIORITY;
40
41 std::string identifier() const;
42
47 std::set<std::string> toInstallables(Store & store);
48
49 std::string versions() const;
50
51 bool operator<(const ProfileElement & other) const;
52
53 void updateStorePaths(ref<Store> evalStore, ref<Store> store, const BuiltPaths & builtPaths);
54};
55
57{
58 std::map<std::string, ProfileElement> elements;
59
60 ProfileManifest() { }
61
62 ProfileManifest(EvalState & state, const Path & profile);
63
64 JSON toJSON(Store & store) const;
65
66 kj::Promise<Result<StorePath>> build(ref<Store> store);
67
68 void addElement(std::string_view nameCandidate, ProfileElement element);
69 void addElement(ProfileElement element);
70
71 static void printDiff(const ProfileManifest & prev, const ProfileManifest & cur, std::string_view indent);
72};
73
74DrvInfos queryInstalled(EvalState & state, const Path & userEnv);
75std::string showVersions(const std::set<std::string> & versions);
76
77}
Definition eval.hh:673
Definition store-api.hh:195
Definition ref.hh:17
Definition outputs-spec.hh:97
Definition flakeref.hh:38
Definition cmd-profiles.hh:20
Definition cmd-profiles.hh:35
std::set< std::string > toInstallables(Store &store)
Definition cmd-profiles.cc:63
Definition cmd-profiles.hh:57
std::string Path
Definition types.hh:28
, for some hueristic-ish URL parsing.