From 216e3b73f4e593e449497049add9aacbbd5d1621 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Wed, 11 Jun 2008 23:06:53 +0000 Subject: [PATCH] added support for unixODBC in configuration.nix writing /etc/odbcinst.ini svn path=/nixos/trunk/; revision=12045 --- etc/default.nix | 9 ++++++++- system/options.nix | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/etc/default.nix b/etc/default.nix index 3015c34926d..9f2056f679f 100644 --- a/etc/default.nix +++ b/etc/default.nix @@ -258,7 +258,14 @@ import ../helpers/make-etc.nix { target = "nix.machines"; } + # unixODBC drivers (this solution is not perfect.. Because the user has to + # ask the admin to add a driver.. but it's an easy solution which works) + ++ (let inis = config.environment.unixODBCDrivers pkgs; + in optional ((pkgs.lib.traceWhatis inis) != [] ) { + source = pkgs.writeText "odbcinst.ini" (pkgs.lib.concatStringsSep "\n" inis); + target = "odbcinst.ini"; + }) + # Additional /etc files declared by Upstart jobs. ++ extraEtc; - } diff --git a/system/options.nix b/system/options.nix index 1e9081e0e3b..28c9e15c58f 100644 --- a/system/options.nix +++ b/system/options.nix @@ -2473,6 +2473,13 @@ root ALL=(ALL) SETENV: ALL If all configuration options must be checked. Non-existing options fail build. "; }; + + unixODBCDrivers = mkOption { + default = pkgs : []; + example = "pkgs : map (x : x.ini) (with pkgs.unixODBCDrivers; [ mysql psql psqlng ] )"; + description = "specifies unix odbc drivers to be registered at /etc/odbcinst.ini"; + }; + }; nesting = {