about summary refs log tree commit diff
path: root/src/libutil/config.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-04-20T12·58+0200
committerEelco Dolstra <edolstra@gmail.com>2017-04-20T12·58+0200
commitf05d5f89ff4ec52ed2f6d576b2b2323b5292f815 (patch)
tree86912765d3dbe77b0e810ad3169dc364015fa71a /src/libutil/config.hh
parent562585e901d9e5f2ef62be11c2e74badcacb1f50 (diff)
Read per-user settings from ~/.config/nix/nix.conf
Diffstat (limited to 'src/libutil/config.hh')
-rw-r--r--src/libutil/config.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh
index 6c8612f675..952bf04b8a 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 { };