From f05d5f89ff4ec52ed2f6d576b2b2323b5292f815 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 20 Apr 2017 14:58:16 +0200 Subject: Read per-user settings from ~/.config/nix/nix.conf --- src/libutil/config.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libutil/config.hh') diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 6c8612f675c7..952bf04b8a2d 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -51,9 +51,11 @@ public: void warnUnknownSettings(); - StringMap getSettings(); + StringMap getSettings(bool overridenOnly = false); void applyConfigFile(const Path & path, bool fatal = false); + + void resetOverriden(); }; class AbstractSetting @@ -68,6 +70,8 @@ public: int created = 123; + bool overriden = false; + protected: AbstractSetting( @@ -78,7 +82,7 @@ protected: virtual ~AbstractSetting() { // Check against a gcc miscompilation causing our constructor - // not to run. + // not to run (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80431). assert(created == 123); } @@ -88,6 +92,8 @@ protected: bool parseBool(const std::string & str); std::string printBool(bool b); + + bool isOverriden() { return overriden; } }; struct DefaultSettingTag { }; -- cgit 1.4.1