···5# unixODBC drivers (this solution is not perfect.. Because the user has to
6# ask the admin to add a driver.. but it's simple and works
78-{
00000009 ###### interface
1011 options = {
12 environment.unixODBCDrivers = mkOption {
13 type = types.listOf types.package;
14 default = [];
15- example = literalExample "with pkgs.unixODBCDrivers; [ mysql psql psqlng ]";
16 description = ''
17 Specifies Unix ODBC drivers to be registered in
18 <filename>/etc/odbcinst.ini</filename>. You may also want to
···25 ###### implementation
2627 config = mkIf (config.environment.unixODBCDrivers != []) {
28-29- environment.etc."odbcinst.ini".text =
30- let inis = map (x : x.ini) config.environment.unixODBCDrivers;
31- in lib.concatStringsSep "\n" inis;
32-33 };
3435}
···5# unixODBC drivers (this solution is not perfect.. Because the user has to
6# ask the admin to add a driver.. but it's simple and works
78+let
9+ iniDescription = pkg: ''
10+ [${pkg.fancyName}]
11+ Description = ${pkg.meta.description}
12+ Driver = ${pkg}/${pkg.driver}
13+ '';
14+15+in {
16 ###### interface
1718 options = {
19 environment.unixODBCDrivers = mkOption {
20 type = types.listOf types.package;
21 default = [];
22+ example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]";
23 description = ''
24 Specifies Unix ODBC drivers to be registered in
25 <filename>/etc/odbcinst.ini</filename>. You may also want to
···32 ###### implementation
3334 config = mkIf (config.environment.unixODBCDrivers != []) {
35+ environment.etc."odbcinst.ini".text = concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers;
000036 };
3738}