lol

nixos/bacula: fix postgresql config and remove unneeded quotation marks

The module falsely disabled postgresql completely when the bacula-sd was not enabled.
Quotation marks are not necessary and only useful in `name` fields.

+20 -20
+20 -20
nixos/modules/services/backup/bacula.nix
··· 15 15 Client { 16 16 Name = "${fd_cfg.name}"; 17 17 FDPort = ${toString fd_cfg.port}; 18 - WorkingDirectory = "${libDir}"; 19 - Pid Directory = "/run"; 18 + WorkingDirectory = ${libDir}; 19 + Pid Directory = /run; 20 20 ${fd_cfg.extraClientConfig} 21 21 } 22 22 23 23 ${concatStringsSep "\n" (mapAttrsToList (name: value: '' 24 24 Director { 25 25 Name = "${name}"; 26 - Password = "${value.password}"; 27 - Monitor = "${value.monitor}"; 26 + Password = ${value.password}; 27 + Monitor = ${value.monitor}; 28 28 } 29 29 '') fd_cfg.director)} 30 30 ··· 41 41 Storage { 42 42 Name = "${sd_cfg.name}"; 43 43 SDPort = ${toString sd_cfg.port}; 44 - WorkingDirectory = "${libDir}"; 45 - Pid Directory = "/run"; 44 + WorkingDirectory = ${libDir}; 45 + Pid Directory = /run; 46 46 ${sd_cfg.extraStorageConfig} 47 47 } 48 48 ··· 50 50 Autochanger { 51 51 Name = "${name}"; 52 52 Device = ${concatStringsSep ", " (map (a: "\"${a}\"") value.devices)}; 53 - Changer Device = "${value.changerDevice}"; 54 - Changer Command = "${value.changerCommand}"; 53 + Changer Device = ${value.changerDevice}; 54 + Changer Command = ${value.changerCommand}; 55 55 ${value.extraAutochangerConfig} 56 56 } 57 57 '') sd_cfg.autochanger)} ··· 59 59 ${concatStringsSep "\n" (mapAttrsToList (name: value: '' 60 60 Device { 61 61 Name = "${name}"; 62 - Archive Device = "${value.archiveDevice}"; 63 - Media Type = "${value.mediaType}"; 62 + Archive Device = ${value.archiveDevice}; 63 + Media Type = ${value.mediaType}; 64 64 ${value.extraDeviceConfig} 65 65 } 66 66 '') sd_cfg.device)} ··· 68 68 ${concatStringsSep "\n" (mapAttrsToList (name: value: '' 69 69 Director { 70 70 Name = "${name}"; 71 - Password = "${value.password}"; 72 - Monitor = "${value.monitor}"; 71 + Password = ${value.password}; 72 + Monitor = ${value.monitor}; 73 73 } 74 74 '') sd_cfg.director)} 75 75 ··· 85 85 '' 86 86 Director { 87 87 Name = "${dir_cfg.name}"; 88 - Password = "${dir_cfg.password}"; 88 + Password = ${dir_cfg.password}; 89 89 DirPort = ${toString dir_cfg.port}; 90 - Working Directory = "${libDir}"; 91 - Pid Directory = "/run/"; 92 - QueryFile = "${pkgs.bacula}/etc/query.sql"; 90 + Working Directory = ${libDir}; 91 + Pid Directory = /run/; 92 + QueryFile = ${pkgs.bacula}/etc/query.sql; 93 93 ${dir_cfg.extraDirectorConfig} 94 94 } 95 95 96 96 Catalog { 97 - Name = "PostgreSQL"; 98 - dbname = "bacula"; 99 - user = "bacula"; 97 + Name = PostgreSQL; 98 + dbname = bacula; 99 + user = bacula; 100 100 } 101 101 102 102 Messages { ··· 533 533 }; 534 534 }; 535 535 536 - services.postgresql.enable = dir_cfg.enable == true; 536 + services.postgresql.enable = lib.mkIf dir_cfg.enable true; 537 537 538 538 systemd.services.bacula-dir = mkIf dir_cfg.enable { 539 539 after = [ "network.target" "postgresql.service" ];