summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-05-11 17:42:33 +0300
committerNikolay Amiantov <ab@fmap.me>2016-05-11 17:42:33 +0300
commit700e2952be4a8dae6b1d49dd625e1d00eac7a366 (patch)
treefdccfaba99e1af935a94bf81d81220b6e9bb80fb /nixos/modules/config
parent008ba8f712770b72832b9e7f89c8a56c8bb8bb31 (diff)
parent5a40332d7008fc60b55dc8eb54671ef4cf404680 (diff)
downloadnixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar.gz
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar.bz2
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar.lz
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar.xz
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.tar.zst
nixlib-700e2952be4a8dae6b1d49dd625e1d00eac7a366.zip
Merge pull request #15012 from abbradar/unixodbc
UnixODBC updates
Diffstat (limited to 'nixos/modules/config')
-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 eea6477fff23..9565a09b3a1e 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;
   };
 
 }