aboutsummaryrefslogtreecommitdiff
path: root/perl/lib
diff options
context:
space:
mode:
Diffstat (limited to 'perl/lib')
-rw-r--r--perl/lib/Nix/Config.pm.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/perl/lib/Nix/Config.pm.in b/perl/lib/Nix/Config.pm.in
index ed197821e..8c902ab6e 100644
--- a/perl/lib/Nix/Config.pm.in
+++ b/perl/lib/Nix/Config.pm.in
@@ -19,9 +19,17 @@ $useBindings = "@perlbindings@" eq "yes";
%config = ();
sub readConfig {
+ if (defined $ENV{'_NIX_OPTIONS'}) {
+ foreach my $s (split '\n', $ENV{'_NIX_OPTIONS'}) {
+ my ($n, $v) = split '=', $s, 2;
+ $config{$n} = $v;
+ }
+ return;
+ }
+
my $config = "$confDir/nix.conf";
return unless -f $config;
-
+
open CONFIG, "<$config" or die "cannot open `$config'";
while (<CONFIG>) {
/^\s*([\w|-]+)\s*=\s*(.*)$/ or next;