1 # Global configuration for freetds environment.
3 { config, lib, pkgs, ... }:
7 cfg = config.environment.freetds;
15 environment.freetds = lib.mkOption {
16 type = lib.types.attrsOf lib.types.str;
18 example = lib.literalExpression ''
27 Configure freetds database entries. Each attribute denotes
28 a section within freetds.conf, and the value (a string) is the config
29 content for that section. When at least one entry is configured
30 the global environment variables FREETDSCONF, FREETDS and SYBASE
31 will be configured to allow the programs that use freetds to find the
41 config = lib.mkIf (builtins.length (builtins.attrNames cfg) > 0) {
43 environment.variables.FREETDSCONF = "/etc/freetds.conf";
44 environment.variables.FREETDS = "/etc/freetds.conf";
45 environment.variables.SYBASE = "${pkgs.freetds}";
47 environment.etc."freetds.conf" = { text =
48 (lib.concatStrings (lib.mapAttrsToList (name: value: