Unverified Commit 39458d90 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

Merge pull request #300564 from Cynerd/bcg-fix

nixos/bcg: fix usage without environment files
parents a71aec5f 282f8b7b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -149,14 +149,14 @@ in
    systemd.services.bcg = let
      envConfig = cfg.environmentFiles != [];
      finalConfig = if envConfig
                    then "$RUNTIME_DIRECTORY/bcg.config.yaml"
                    then "\${RUNTIME_DIRECTORY}/bcg.config.yaml"
                    else configFile;
    in {
      description = "BigClown Gateway";
      wantedBy = [ "multi-user.target" ];
      wants = [ "network-online.target" ] ++ lib.optional config.services.mosquitto.enable "mosquitto.service";
      after = [ "network-online.target" ];
      preStart = ''
      preStart = mkIf envConfig ''
        umask 077
        ${pkgs.envsubst}/bin/envsubst -i "${configFile}" -o "${finalConfig}"
        '';