Unverified Commit 0a124d55 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

nixos/gancio: add sendmail to path, make cli easier to use (#395737)

parents 3a83dad7 052423a7
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -171,7 +171,16 @@ in
  };

  config = mkIf cfg.enable {
    environment.systemPackages = [ cfg.package ];
    environment.systemPackages = [
      (pkgs.runCommand "gancio" { } ''
        mkdir -p $out/bin
        echo "#!${pkgs.runtimeShell}
          cd /var/lib/gancio/
          exec ${lib.getExe cfg.package} ''${1:---help}
        " > $out/bin/gancio
        chmod +x $out/bin/gancio
      '')
    ];

    users.users.gancio = lib.mkIf (cfg.user == "gancio") {
      isSystemUser = true;
@@ -210,6 +219,11 @@ in
          NODE_ENV = "production";
        };

        path = [
          # required for sendmail
          "/run/wrappers"
        ];

        preStart = ''
          # We need this so the gancio executable run by the user finds the right settings.
          ln -sf ${configFile} config.json