2022-09-14 08:47:49 +02:00
|
|
|
{ stdenv
|
|
|
|
, pkgs
|
|
|
|
, lib
|
|
|
|
, utils
|
|
|
|
}:
|
|
|
|
{ configDir ? "/etc/haproxy"
|
|
|
|
, configFile ? "haproxy.cfg"
|
2022-12-18 01:45:00 +01:00
|
|
|
, user
|
|
|
|
, group
|
2022-12-04 07:37:38 +01:00
|
|
|
, config
|
2022-09-14 08:47:49 +02:00
|
|
|
}:
|
2022-12-18 01:45:00 +01:00
|
|
|
dependsOn:
|
2022-09-14 08:47:49 +02:00
|
|
|
|
2022-10-26 07:02:51 +02:00
|
|
|
with builtins;
|
2022-12-04 07:37:38 +01:00
|
|
|
with lib.attrsets;
|
|
|
|
with lib.lists;
|
2022-10-26 07:02:51 +02:00
|
|
|
with lib.strings;
|
2022-09-14 08:47:49 +02:00
|
|
|
let
|
|
|
|
|
2022-12-04 07:37:38 +01:00
|
|
|
configcreator = pkgs.callPackage ./configcreator.nix {};
|
2022-09-14 08:47:49 +02:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
utils.mkConfigFile {
|
|
|
|
name = configFile;
|
|
|
|
dir = configDir;
|
2022-12-18 01:45:00 +01:00
|
|
|
content = configcreator.render (configcreator.default (config dependsOn // {inherit user group;}));
|
2022-12-04 07:37:38 +01:00
|
|
|
}
|