Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
Loading...
Searching...
No Matches
profiles.hh
1#pragma once
7
10
11#include <time.h>
12
13
14namespace nix {
15
16class StorePath;
17
18
25typedef uint64_t GenerationNumber;
26
34{
39 GenerationNumber number;
52
59};
60
64typedef std::list<Generation> Generations;
65
66
84std::pair<Generations, std::optional<GenerationNumber>> findGenerations(Path profile);
85
86class LocalFSStore;
87
99kj::Promise<Result<Path>> createGeneration(LocalFSStore & store, Path profile, StorePath outPath);
100
114void deleteGeneration(const Path & profile, GenerationNumber gen);
115
130void deleteGenerations(
131 const Path & profile,
132 const std::set<GenerationNumber> & gensToDelete,
133 bool dryRun,
134 NeverAsync = {}
135);
136
148void deleteGenerationsGreaterThan(
149 const Path & profile, GenerationNumber max, bool dryRun, NeverAsync = {}
150);
151
160void deleteOldGenerations(const Path & profile, bool dryRun, NeverAsync = {});
161
171void deleteGenerationsOlderThan(const Path & profile, time_t t, bool dryRun, NeverAsync = {});
172
178time_t parseOlderThanTimeSpec(std::string_view timeSpec);
179
186void switchLink(Path link, Path target);
187
192void switchGeneration(
193 const Path & profile,
194 std::optional<GenerationNumber> dstGen,
195 bool dryRun,
196 NeverAsync = {});
197
202PathLock lockProfile(const Path & profile, NeverAsync = {});
203
215std::string optimisticLockProfile(const Path & profile);
216
221Path profilesDir();
222
226Path rootProfilesDir();
227
231Path defaultChannelsDir();
232
236Path rootChannelsDir();
237
243Path getDefaultProfile();
244
245}
Definition local-fs-store.hh:36
Definition pathlocks.hh:36
Definition path.hh:21
Definition profiles.hh:34
time_t creationTime
Definition profiles.hh:58
GenerationNumber number
Definition profiles.hh:39
Path path
Definition profiles.hh:51
Definition types.hh:172
std::string Path
Definition types.hh:28