about summary refs log blame commit diff
path: root/scripts/readconfig.pm.in
blob: aeb443aeed3a3ef03716ef88662392021051550b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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;