unix-odbc-drivers module: update for new unixODBCDrivers
This commit is contained in:
parent
1a3f7d553d
commit
5a40332d70
@ -5,14 +5,21 @@ with lib;
|
|||||||
# unixODBC drivers (this solution is not perfect.. Because the user has to
|
# unixODBC drivers (this solution is not perfect.. Because the user has to
|
||||||
# ask the admin to add a driver.. but it's simple and works
|
# ask the admin to add a driver.. but it's simple and works
|
||||||
|
|
||||||
{
|
let
|
||||||
|
iniDescription = pkg: ''
|
||||||
|
[${pkg.fancyName}]
|
||||||
|
Description = ${pkg.meta.description}
|
||||||
|
Driver = ${pkg}/${pkg.driver}
|
||||||
|
'';
|
||||||
|
|
||||||
|
in {
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
environment.unixODBCDrivers = mkOption {
|
environment.unixODBCDrivers = mkOption {
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
default = [];
|
default = [];
|
||||||
example = literalExample "with pkgs.unixODBCDrivers; [ mysql psql psqlng ]";
|
example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]";
|
||||||
description = ''
|
description = ''
|
||||||
Specifies Unix ODBC drivers to be registered in
|
Specifies Unix ODBC drivers to be registered in
|
||||||
<filename>/etc/odbcinst.ini</filename>. You may also want to
|
<filename>/etc/odbcinst.ini</filename>. You may also want to
|
||||||
@ -25,11 +32,7 @@ with lib;
|
|||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf (config.environment.unixODBCDrivers != []) {
|
config = mkIf (config.environment.unixODBCDrivers != []) {
|
||||||
|
environment.etc."odbcinst.ini".text = concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers;
|
||||||
environment.etc."odbcinst.ini".text =
|
|
||||||
let inis = map (x : x.ini) config.environment.unixODBCDrivers;
|
|
||||||
in lib.concatStringsSep "\n" inis;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user