aboutsummaryrefslogtreecommitdiff
path: root/perl/lib/Nix/Config.pm.in
diff options
context:
space:
mode:
Diffstat (limited to 'perl/lib/Nix/Config.pm.in')
-rw-r--r--perl/lib/Nix/Config.pm.in23
1 files changed, 8 insertions, 15 deletions
diff --git a/perl/lib/Nix/Config.pm.in b/perl/lib/Nix/Config.pm.in
index f494e34a5..4bdee7fd8 100644
--- a/perl/lib/Nix/Config.pm.in
+++ b/perl/lib/Nix/Config.pm.in
@@ -20,22 +20,15 @@ $useBindings = 1;
%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;
- }
- } else {
- 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;
- $config{$1} = $2;
- }
- close CONFIG;
+ 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;
+ $config{$1} = $2;
}
+ close CONFIG;
}
return 1;