added support for unixODBC in configuration.nix writing /etc/odbcinst.ini

svn path=/nixos/trunk/; revision=12045
This commit is contained in:
Marc Weber 2008-06-11 23:06:53 +00:00
parent d28ecc593f
commit 216e3b73f4
2 changed files with 15 additions and 1 deletions

View File

@ -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;
}

View File

@ -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 = {