mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
nix profile history: Show profile date
This commit is contained in:
parent
4b738fc7a9
commit
b41968f15a
2 changed files with 8 additions and 6 deletions
|
@ -6,10 +6,10 @@ R""(
|
|||
|
||||
```console
|
||||
# nix profile history
|
||||
Version 508 -> 509:
|
||||
Version 508 (2020-04-10):
|
||||
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: ∅ -> 1.17.13
|
||||
|
||||
Version 509 -> 510:
|
||||
Version 509 (2020-05-16) <- 508:
|
||||
flake:nixpkgs#legacyPackages.x86_64-linux.awscli: 1.17.13 -> 1.18.211
|
||||
```
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <regex>
|
||||
#include <iomanip>
|
||||
|
||||
using namespace nix;
|
||||
|
||||
|
@ -528,10 +529,11 @@ struct CmdProfileHistory : virtual StoreCommand, EvalCommand, MixDefaultProfile
|
|||
if (!first) std::cout << "\n";
|
||||
first = false;
|
||||
|
||||
if (prevGen)
|
||||
std::cout << fmt("Version %d -> %d:\n", prevGen->first.number, gen.number);
|
||||
else
|
||||
std::cout << fmt("Version %d:\n", gen.number);
|
||||
std::cout << fmt("Version %s%d" ANSI_NORMAL " (%s)%s:\n",
|
||||
gen.number == curGen ? ANSI_GREEN : ANSI_BOLD,
|
||||
gen.number,
|
||||
std::put_time(std::gmtime(&gen.creationTime), "%Y-%m-%d"),
|
||||
prevGen ? fmt(" <- %d", prevGen->first.number) : "");
|
||||
|
||||
ProfileManifest::printDiff(
|
||||
prevGen ? prevGen->second : ProfileManifest(),
|
||||
|
|
Loading…
Reference in a new issue