mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
Integrate perl with the other meson builds
One big dev shell!
This commit is contained in:
parent
e0b4691754
commit
a83d95e26e
20 changed files with 52 additions and 27 deletions
25
src/perl/lib/Nix/Config.pm.in
Normal file
25
src/perl/lib/Nix/Config.pm.in
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue