forked from lix-project/lix
26 lines
455 B
Perl
26 lines
455 B
Perl
package Nix::Config;
|
|
|
|
use MIME::Base64;
|
|
use Nix::Store;
|
|
|
|
$version = "@PACKAGE_VERSION@";
|
|
|
|
$binDir = Nix::Store::getBinDir;
|
|
$storeDir = Nix::Store::getStoreDir;
|
|
|
|
%config = ();
|
|
|
|
sub readConfig {
|
|
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;
|