mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
Convert "unix-odbc-drivers"
svn path=/nixos/branches/fix-style/; revision=14359
This commit is contained in:
parent
1c43b4946b
commit
e344a2d055
4 changed files with 46 additions and 19 deletions
|
@ -241,13 +241,6 @@ let
|
||||||
target = "nix.machines";
|
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 (inis != [] ) {
|
|
||||||
source = pkgs.writeText "odbcinst.ini" (pkgs.lib.concatStringsSep "\n" inis);
|
|
||||||
target = "odbcinst.ini";
|
|
||||||
})
|
|
||||||
;
|
;
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
|
@ -2171,12 +2171,6 @@ in
|
||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -2212,6 +2206,9 @@ in
|
||||||
|
|
||||||
(import ../upstart-jobs/acpid.nix) # ACPI daemon
|
(import ../upstart-jobs/acpid.nix) # ACPI daemon
|
||||||
|
|
||||||
|
(import ../system/unix-odbc-drivers.nix)
|
||||||
|
|
||||||
|
|
||||||
# security
|
# security
|
||||||
(import ../system/sudo.nix)
|
(import ../system/sudo.nix)
|
||||||
|
|
||||||
|
|
43
system/unix-odbc-drivers.nix
Normal file
43
system/unix-odbc-drivers.nix
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
{pkgs, config, ...}:
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
let
|
||||||
|
inherit (pkgs.lib) mkOption mkIf;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
environment = {
|
||||||
|
unixODBCDrivers = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = "map (x : x.ini) (with pkgs.unixODBCDrivers; [ mysql psql psqlng ] )";
|
||||||
|
description = ''
|
||||||
|
specifies unix odbc drivers to be registered at /etc/odbcinst.ini.
|
||||||
|
Maybe you also want to add pkgs.unixODBC to the system path to get a
|
||||||
|
command line client t connnect to odbc databases.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
mkIf (config.environment.unixODBCDrivers != []) {
|
||||||
|
|
||||||
|
require = [
|
||||||
|
options
|
||||||
|
];
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
etc = [
|
||||||
|
{ source =
|
||||||
|
let inis = config.environment.unixODBCDrivers;
|
||||||
|
in pkgs.writeText "odbcinst.ini" (pkgs.lib.concatStringsSep "\n" inis);
|
||||||
|
target = "odbcinst.ini";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -305,12 +305,6 @@ let
|
||||||
inherit (config.services.bitlbee) portNumber interface;
|
inherit (config.services.bitlbee) portNumber interface;
|
||||||
})
|
})
|
||||||
|
|
||||||
# ACPI daemon.
|
|
||||||
++ optional config.powerManagement.enable
|
|
||||||
(import ../upstart-jobs/acpid.nix {
|
|
||||||
inherit config pkgs;
|
|
||||||
})
|
|
||||||
|
|
||||||
# Postfix mail server.
|
# Postfix mail server.
|
||||||
++ optional config.services.postfix.enable
|
++ optional config.services.postfix.enable
|
||||||
(import ../upstart-jobs/postfix.nix {
|
(import ../upstart-jobs/postfix.nix {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue