Nix 2.26.3
Nix, the purely functional package manager; unstable internal interfaces
 
Loading...
Searching...
No Matches
profiles.hh
Go to the documentation of this file.
1#pragma once
9
10#include "types.hh"
11#include "pathlocks.hh"
12
13#include <optional>
14#include <time.h>
15
16
17namespace nix {
18
19class StorePath;
20
21
28typedef uint64_t GenerationNumber;
29
63
67typedef std::list<Generation> Generations;
68
69
87std::pair<Generations, std::optional<GenerationNumber>> findGenerations(Path profile);
88
89class LocalFSStore;
90
102Path createGeneration(LocalFSStore & store, Path profile, StorePath outPath);
103
117void deleteGeneration(const Path & profile, GenerationNumber gen);
118
133void deleteGenerations(const Path & profile, const std::set<GenerationNumber> & gensToDelete, bool dryRun);
134
146void deleteGenerationsGreaterThan(const Path & profile, GenerationNumber max, bool dryRun);
147
156void deleteOldGenerations(const Path & profile, bool dryRun);
157
167void deleteGenerationsOlderThan(const Path & profile, time_t t, bool dryRun);
168
174time_t parseOlderThanTimeSpec(std::string_view timeSpec);
175
182void switchLink(Path link, Path target);
183
188void switchGeneration(
189 const Path & profile,
190 std::optional<GenerationNumber> dstGen,
191 bool dryRun);
192
197void lockProfile(PathLocks & lock, const Path & profile);
198
210std::string optimisticLockProfile(const Path & profile);
211
216Path profilesDir();
217
221Path rootProfilesDir();
222
226Path defaultChannelsDir();
227
231Path rootChannelsDir();
232
238Path getDefaultProfile();
239
240}
Definition local-fs-store.hh:46
Definition pathlocks.hh:25
Definition path.hh:27
ChunkedVector< std::string, 8192 > store
Definition lexer.l:1011
T t
Definition lexer.l:154
WriteLock lock()
Definition lexer.l:6739
std::list< Generation > Generations
Definition profiles.hh:67
uint64_t GenerationNumber
Definition profiles.hh:28
Definition profiles.hh:37
time_t creationTime
Definition profiles.hh:61
GenerationNumber number
Definition profiles.hh:42
Path path
Definition profiles.hh:54
std::string Path
Definition types.hh:22