From a154e2ea1a53da4b6edfcd565db315dc5246032b Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 27 Jan 2018 10:17:42 +0100 Subject: [PATCH] readme: add basic rollback instructions --- README.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7c7d4b123..3e19c1c9a 100644 --- a/README.md +++ b/README.md @@ -25,8 +25,8 @@ distributions and NixOS versions. Also, the `home-manager` tool does not explicitly support rollbacks at the moment so if your home directory gets messed up you'll have to fix -it yourself (you can attempt to run the activation script for the -desired generation). +it yourself. See the [rollbacks](#rollbacks) section for instructions +on how to manually perform a rollback. Now when your expectations have been built up and you are eager to try all this out you can go ahead and read the rest of this text. @@ -186,6 +186,40 @@ examples run $ man home-configuration.nix ``` +Rollbacks +--------- + +While the `home-manager` tool does not explicitly support rollbacks at +the moment it is relatively easy to perform one manually. The steps to +do so are + +1. Run `home-manager generations` to determine which generation you + wish to rollback to: + + ```console + $ home-manager generations + 2018-01-04 11:56 : id 765 -> /nix/store/kahm1rxk77mnvd2l8pfvd4jkkffk5ijk-home-manager-generation + 2018-01-03 10:29 : id 764 -> /nix/store/2wsmsliqr5yynqkdyjzb1y57pr5q2lsj-home-manager-generation + 2018-01-01 12:21 : id 763 -> /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation + 2017-12-29 21:03 : id 762 -> /nix/store/6c0k1r03fxckql4vgqcn9ccb616ynb94-home-manager-generation + 2017-12-25 18:51 : id 761 -> /nix/store/czc5y6vi1rvnkfv83cs3rn84jarcgsgh-home-manager-generation + … + ``` + +2. Copy the Nix store path of the generation you chose, e.g., + + /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation + + for generation 763. + +3. Run the `activate` script inside the copied store path: + + ```console + $ /nix/store/mv960kl9chn2lal5q8lnqdp1ygxngcd1-home-manager-generation/activate + Starting home manager activation + … + ``` + Keeping your ~ safe from harm -----------------------------