From b5b90b598430cfa876639d76dbbdc8d826ccb5c0 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 4 Aug 2020 20:28:04 +0200 Subject: types.secret-file: add service option --- tv/3modules/charybdis/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tv/3modules/charybdis') diff --git a/tv/3modules/charybdis/default.nix b/tv/3modules/charybdis/default.nix index 62a7037e3..3809da404 100644 --- a/tv/3modules/charybdis/default.nix +++ b/tv/3modules/charybdis/default.nix @@ -51,8 +51,15 @@ in { systemd.services.charybdis = { wantedBy = [ "multi-user.target" ]; - requires = [ "secret.service" ]; - after = [ "network-online.target" "secret.service" ]; + after = [ + config.krebs.secret.files.charybdis-ssl_dh_params.service + config.krebs.secret.files.charybdis-ssl_private_key.service + "network-online.target" + ]; + requires = [ + config.krebs.secret.files.charybdis-ssl_dh_params.service + config.krebs.secret.files.charybdis-ssl_private_key.service + ]; environment = { BANDB_DBPATH = "${cfg.user.home}/ban.db"; }; -- cgit v1.2.3 From ec91d1b83cfad151033433159a04eb7b5381bc73 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 4 Aug 2020 22:22:43 +0200 Subject: krebs.secret: restart units on secret change --- tv/3modules/charybdis/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tv/3modules/charybdis') diff --git a/tv/3modules/charybdis/default.nix b/tv/3modules/charybdis/default.nix index 3809da404..a0638e1eb 100644 --- a/tv/3modules/charybdis/default.nix +++ b/tv/3modules/charybdis/default.nix @@ -17,6 +17,7 @@ in { ssl_dh_params = mkOption { type = types.secret-file; default = { + name = "charybdis-ssl_dh_params"; path = "${cfg.user.home}/dh.pem"; owner = cfg.user; source-path = toString + "/charybdis.dh.pem"; @@ -25,6 +26,7 @@ in { ssl_private_key = mkOption { type = types.secret-file; default = { + name = "charybdis-ssl_private_key"; path = "${cfg.user.home}/ssl.key.pem"; owner = cfg.user; source-path = toString + "/charybdis.key.pem"; @@ -56,7 +58,7 @@ in { config.krebs.secret.files.charybdis-ssl_private_key.service "network-online.target" ]; - requires = [ + partOf = [ config.krebs.secret.files.charybdis-ssl_dh_params.service config.krebs.secret.files.charybdis-ssl_private_key.service ]; -- cgit v1.2.3