about summary refs log tree commit diff
path: root/scripts/NixConfig.pm.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-12-05T17·50+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-12-05T17·50+0000
commit365f3028ddfb5487f35ebbb9adc42ddf9459113d (patch)
tree211e4ba436ffa2f2badb458386864968837e3aff /scripts/NixConfig.pm.in
parentf42a505ab71ba421797ac511e1221ccbefef8ab9 (diff)
* Use CamelCase for the Perl modules.
Diffstat (limited to 'scripts/NixConfig.pm.in')
-rw-r--r--scripts/NixConfig.pm.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/NixConfig.pm.in b/scripts/NixConfig.pm.in
new file mode 100644
index 000000000000..aeb443aeed3a
--- /dev/null
+++ b/scripts/NixConfig.pm.in
@@ -0,0 +1,17 @@
+use strict;
+
+sub readConfig {
+    my %config;
+    my $config = "@sysconfdir@/nix/nix.conf";
+    return unless -f $config;
+    
+    open CONFIG, "<$config" or die "cannot open `$config'";
+    while (<CONFIG>) {
+        /^\s*([\w|-]+)\s*=\s*(.*)$/ or next;
+        $config{$1} = $2;
+        print "|$1| -> |$2|\n";
+    }
+    close CONFIG;
+}
+
+return 1;