Nix 2.93.3
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
11#include <string>
12#include <set>
13
14namespace nix
15{
16
18{
19 FlakeRef originalRef;
20 // FIXME: record original attrpath.
21 FlakeRef lockedRef;
22 std::string attrPath;
23 ExtendedOutputsSpec outputs;
24
25 bool operator<(const ProfileElementSource & other) const;
26
27 std::string to_string() const;
28};
29
30constexpr int DEFAULT_PRIORITY = 5;
31
33{
34 StorePathSet storePaths;
35 std::optional<ProfileElementSource> source;
36 bool active = true;
37 NixInt::Inner priority = DEFAULT_PRIORITY;
38
39 std::string identifier() const;
40
45 std::set<std::string> toInstallables(Store & store);
46
47 std::string versions() const;
48
49 bool operator<(const ProfileElement & other) const;
50
51 void updateStorePaths(ref<Store> evalStore, ref<Store> store, const BuiltPaths & builtPaths);
52};
53
54struct ProfileManifest
55{
56 std::map<std::string, ProfileElement> elements;
57
58 ProfileManifest() { }
59
60 ProfileManifest(EvalState & state, const Path & profile);
61
62 JSON toJSON(Store & store) const;
63
64 kj::Promise<Result<StorePath>> build(ref<Store> store);
65
66 void addElement(std::string_view nameCandidate, ProfileElement element);
67 void addElement(ProfileElement element);
68
69 static void printDiff(const ProfileManifest & prev, const ProfileManifest & cur, std::string_view indent);
70};
71
72DrvInfos queryInstalled(EvalState & state, const Path & userEnv);
73std::string showVersions(const std::set<std::string> & versions);
74
75}
Definition eval.hh:685
Definition store-api.hh:195
Definition ref.hh:19
Definition outputs-spec.hh:97
Definition flakeref.hh:35
Definition cmd-profiles.hh:18
Definition cmd-profiles.hh:33
std::set< std::string > toInstallables(Store &store)
Definition cmd-profiles.cc:63
std::string Path
Definition types.hh:28