write own bacula config file since the upstream one is broken
This commit is contained in:
parent
a2c7f17471
commit
10101a9e18
|
@ -1,4 +1,33 @@
|
||||||
{ config, ... }:
|
{ pkgs, config, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
# We write a custom config file because the upstream config has some flaws
|
||||||
|
fd_cfg = config.services.bacula-fd;
|
||||||
|
fd_conf = pkgs.writeText "bacula-fd.conf" ''
|
||||||
|
Client {
|
||||||
|
Name = ${fd_cfg.name}
|
||||||
|
FDPort = ${toString fd_cfg.port}
|
||||||
|
WorkingDirectory = /var/lib/bacula
|
||||||
|
Pid Directory = /run
|
||||||
|
${fd_cfg.extraClientConfig}
|
||||||
|
}
|
||||||
|
|
||||||
|
${concatStringsSep "\n" (mapAttrsToList (name: value: ''
|
||||||
|
Director {
|
||||||
|
Name = ${name}
|
||||||
|
Password = ${value.password}
|
||||||
|
Monitor = ${value.monitor}
|
||||||
|
}
|
||||||
|
'') fd_cfg.director)}
|
||||||
|
|
||||||
|
Messages {
|
||||||
|
Name = Standard;
|
||||||
|
syslog = all, !skipped, !restored
|
||||||
|
${fd_cfg.extraMessagesConfig}
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
in
|
||||||
{
|
{
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
"bacula/password".owner = "bacula";
|
"bacula/password".owner = "bacula";
|
||||||
|
@ -35,4 +64,5 @@
|
||||||
Password = @${config.sops.secrets."bacula/password".path}
|
Password = @${config.sops.secrets."bacula/password".path}
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
systemd.services.bacula-fd.serviceConfig.ExecStart = lib.mkForce "${pkgs.bacula}/sbin/bacula-fd -f -u root -g bacula -c ${fd_conf}";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue