mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
18 lines
350 B
Perl
18 lines
350 B
Perl
|
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;
|