unix-odbc-drivers module: update for new unixODBCDrivers

+10 -7
+10 -7
nixos/modules/config/unix-odbc-drivers.nix
··· 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 7 8 - { 9 ###### interface 10 11 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 26 27 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 }; 34 35 }
··· 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 7 8 + let 9 + iniDescription = pkg: '' 10 + [${pkg.fancyName}] 11 + Description = ${pkg.meta.description} 12 + Driver = ${pkg}/${pkg.driver} 13 + ''; 14 + 15 + in { 16 ###### interface 17 18 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 33 34 config = mkIf (config.environment.unixODBCDrivers != []) { 35 + environment.etc."odbcinst.ini".text = concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers; 36 }; 37 38 }