summary refs log tree commit diff
path: root/nixos/modules/config/unix-odbc-drivers.nix
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-04-26 21:18:21 +0300
committerNikolay Amiantov <ab@fmap.me>2016-04-26 23:58:11 +0300
commit5a40332d7008fc60b55dc8eb54671ef4cf404680 (patch)
tree4489505281a69c314ef18aed441ea2bd9fd4f7de /nixos/modules/config/unix-odbc-drivers.nix
parent1a3f7d553d4b5fe78f5f186a08ded841a85c45a1 (diff)
downloadnixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar.gz
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar.bz2
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar.lz
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar.xz
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.tar.zst
nixpkgs-5a40332d7008fc60b55dc8eb54671ef4cf404680.zip
unix-odbc-drivers module: update for new unixODBCDrivers
Diffstat (limited to 'nixos/modules/config/unix-odbc-drivers.nix')
-rw-r--r--nixos/modules/config/unix-odbc-drivers.nix17
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 eea6477fff2..9565a09b3a1 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;
   };
 
 }