~aasg/nixexprs

b0d0abb40316ca47caedc31965dd8dcd5af86695 — Aluísio Augusto Silva Gonçalves 2 months ago 965f83e
ipfs-cluster: Use more systemd features to ease new cluster setup
1 files changed, 17 insertions(+), 1 deletions(-)

M modules/services/cluster/ipfs-cluster.nix
M modules/services/cluster/ipfs-cluster.nix => modules/services/cluster/ipfs-cluster.nix +17 -1
@@ 55,10 55,23 @@ in
        description = "Directory where cluster management data lives.";
      };

      secretEnvFile = mkOption {
        type = with types; nullOr str;
        default = null;
        description = ''
          File containing the cluster secret as an assignment to the CLUSTER_SECRET variable.
          If none is given, a secret is generated during cluster creation.
        '';
      };

      secretFile = mkOption {
        type = with types; nullOr str;
        default = null;
        description = "File containing the cluster secret. If none is given, a secret is generated during cluster creation.";
        description = ''
          File containing the cluster secret.
          If none is given, a secret is generated during cluster creation.
          Deprecated: use `services.ipfs-cluster-secretEnvFile` instead.
        '';
      };

      consensus = mkOption {


@@ 106,6 119,9 @@ in
        ProtectSystem = "full";
        ReadWriteDirectories = cfg.dataDir;
        TimeoutStopSec = "5s";
        EnvironmentFile = optional (cfg.secretEnvFile != null) cfg.secretEnvFile;
        StateDirectory = optional (cfg.dataDir == "/var/lib/ipfs-cluster") "ipfs-cluster";
        StateDirectoryMode = "0700";
      };
      preStart = ''
        ${optionalString (cfg.secretFile != null) ''