From 69b3d5f1b3bb70f3d9de384597c8b136f085b1af Mon Sep 17 00:00:00 2001 From: Erik Arvstedt Date: Mon, 15 Jul 2024 20:31:31 +0200 Subject: [PATCH] bitcoind: fix module warning Fix warning: ``` bitcoind.service is ordered after 'network-online.target' but doesn't depend on it ``` --- modules/bitcoind.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/bitcoind.nix b/modules/bitcoind.nix index b602937..062915c 100644 --- a/modules/bitcoind.nix +++ b/modules/bitcoind.nix @@ -373,16 +373,20 @@ in { "d '${cfg.dataDir}' 0770 ${cfg.user} ${cfg.group} - -" ]; - systemd.services.bitcoind = { - # Use `wants` instead of `requires` so that bitcoind and all dependent services - # are not restarted when the secrets target restarts. - # The secrets target always restarts when deploying with one of the methods - # in ./deployment. - # - # TODO-EXTERNAL: Instead of `wants`, use a future systemd dependency type - # that propagates initial start failures but no restarts - wants = [ "nix-bitcoin-secrets.target" ]; - after = [ "network-online.target" "nix-bitcoin-secrets.target" ]; + systemd.services.bitcoind = rec { + wants = [ + "network-online.target" + # Use `wants` instead of `requires` for `nix-bitcoin-secrets.target` + # so that bitcoind and all dependent services are not restarted when + # the secrets target restarts. + # The secrets target always restarts when deploying with one of the methods + # in ./deployment. + # + # TODO-EXTERNAL: Instead of `wants`, use a future systemd dependency type + # that propagates initial start failures but no restarts + "nix-bitcoin-secrets.target" + ]; + after = wants; wantedBy = [ "multi-user.target" ]; preStart = let