diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-09-14 19:05:28 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-09-14 19:32:33 +0200 |
commit | 817562e6946fa44c253beb76a36d85b55fd9c14d (patch) | |
tree | 9259231b8a4eebd81344a8f323d8737ef2c7f0f9 /src/libstore/profiles.hh | |
parent | 1fbaf367292a8eb57a120f74daacabccce622f2f (diff) |
Add "nix profile rollback" command
Diffstat (limited to 'src/libstore/profiles.hh')
-rw-r--r-- | src/libstore/profiles.hh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstore/profiles.hh b/src/libstore/profiles.hh index be55a65d4..d100c970c 100644 --- a/src/libstore/profiles.hh +++ b/src/libstore/profiles.hh @@ -11,7 +11,7 @@ namespace nix { class StorePath; -typedef unsigned int GenerationNumber; +typedef uint64_t GenerationNumber; struct Generation { @@ -46,6 +46,13 @@ void deleteGenerationsOlderThan(const Path & profile, const string & timeSpec, b void switchLink(Path link, Path target); +/* Roll back a profile to the specified generation, or to the most + recent one older than the current. */ +void switchGeneration( + const Path & profile, + std::optional<GenerationNumber> dstGen, + bool dryRun); + /* Ensure exclusive access to a profile. Any command that modifies the profile first acquires this lock. */ void lockProfile(PathLocks & lock, const Path & profile); |