tsuki/vaultwarden: conditional config
This commit is contained in:
parent
3d2825d1ec
commit
fe50d92f8c
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }: let
|
{ config, pkgs, lib, ... }: let
|
||||||
cfg = config.services.vaultwarden;
|
cfg = config.services.vaultwarden;
|
||||||
in {
|
in {
|
||||||
services.vaultwarden = {
|
services.vaultwarden = {
|
||||||
|
@ -18,7 +18,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.vaultwarden = {
|
systemd.services.vaultwarden = lib.mkIf cfg.enable {
|
||||||
requires = [ "postgresql.service" ];
|
requires = [ "postgresql.service" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
@ -55,7 +55,7 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = [ "vaultwarden" ];
|
ensureDatabases = [ "vaultwarden" ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
|
|
Loading…
Reference in New Issue