diff options
Diffstat (limited to 'nixos/modules/config/unix-odbc-drivers.nix')
-rw-r--r-- | nixos/modules/config/unix-odbc-drivers.nix | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/nixos/modules/config/unix-odbc-drivers.nix b/nixos/modules/config/unix-odbc-drivers.nix index eea6477fff233..9565a09b3a1e0 100644 --- a/nixos/modules/config/unix-odbc-drivers.nix +++ b/nixos/modules/config/unix-odbc-drivers.nix @@ -5,14 +5,21 @@ with lib; # 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 -{ +let + iniDescription = pkg: '' + [${pkg.fancyName}] + Description = ${pkg.meta.description} + Driver = ${pkg}/${pkg.driver} + ''; + +in { ###### interface options = { environment.unixODBCDrivers = mkOption { type = types.listOf types.package; default = []; - example = literalExample "with pkgs.unixODBCDrivers; [ mysql psql psqlng ]"; + example = literalExample "with pkgs.unixODBCDrivers; [ sqlite psql ]"; description = '' Specifies Unix ODBC drivers to be registered in <filename>/etc/odbcinst.ini</filename>. You may also want to @@ -25,11 +32,7 @@ with lib; ###### implementation config = mkIf (config.environment.unixODBCDrivers != []) { - - environment.etc."odbcinst.ini".text = - let inis = map (x : x.ini) config.environment.unixODBCDrivers; - in lib.concatStringsSep "\n" inis; - + environment.etc."odbcinst.ini".text = concatMapStringsSep "\n" iniDescription config.environment.unixODBCDrivers; }; } |