aboutsummaryrefslogtreecommitdiff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-04-28 16:57:37 +0200
committerEelco Dolstra <edolstra@gmail.com>2023-04-28 17:03:04 +0200
commit17e6b85d05b3d32df244b1d4e89aa41fd8bdcae8 (patch)
tree2c508889b0a4e29671b71bd0474519eb513fac5f /src/libmain
parent89d3cc5a47a448f624ea4c9b43eeee00dcc88a21 (diff)
nix: Support the --repair flag
Diffstat (limited to 'src/libmain')
-rw-r--r--src/libmain/common-args.hh18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libmain/common-args.hh b/src/libmain/common-args.hh
index e7ed0d934..c35406c3b 100644
--- a/src/libmain/common-args.hh
+++ b/src/libmain/common-args.hh
@@ -2,6 +2,7 @@
///@file
#include "args.hh"
+#include "repair-flag.hh"
namespace nix {
@@ -49,4 +50,21 @@ struct MixJSON : virtual Args
}
};
+struct MixRepair : virtual Args
+{
+ RepairFlag repair = NoRepair;
+
+ MixRepair()
+ {
+ addFlag({
+ .longName = "repair",
+ .description =
+ "During evaluation, rewrite missing or corrupted files in the Nix store. "
+ "During building, rebuild missing or corrupted store paths.",
+ .category = miscCategory,
+ .handler = {&repair, Repair},
+ });
+ }
+};
+
}