Unverified Commit 2e9d7dca authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #302570 from evenbrenden/jottad-service

parents bafcff9b 021a0ffe
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -131,6 +131,8 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m

- [mautrix-meta](https://github.com/mautrix/meta), a Matrix <-> Facebook and Matrix <-> Instagram hybrid puppeting/relaybot bridge. Available as services.mautrix-meta

- [Jottacloud Command-line Tool](https://docs.jottacloud.com/en/articles/1436834-jottacloud-command-line-tool), a CLI for the [Jottacloud](https://jottacloud.com/) cloud storage provider. Available as [user.services.jotta-cli](#opt-user.services.jotta-cli.enable).

- [transfer-sh](https://github.com/dutchcoders/transfer.sh), a tool that supports easy and fast file sharing from the command-line. Available as [services.transfer-sh](#opt-services.transfer-sh.enable).

- [FCast Receiver](https://fcast.org), an open-source alternative to Chromecast and AirPlay. Available as [programs.fcast-receiver](#opt-programs.fcast-receiver.enable).
+1 −0
Original line number Diff line number Diff line
@@ -1029,6 +1029,7 @@
  ./services/networking/jigasi.nix
  ./services/networking/jitsi-videobridge.nix
  ./services/networking/jool.nix
  ./services/networking/jotta-cli.nix
  ./services/networking/kea.nix
  ./services/networking/keepalived/default.nix
  ./services/networking/keybase.nix
+27 −0
Original line number Diff line number Diff line
# Jottacloud Command-line Tool {#module-services-jotta-cli}

The [Jottacloud Command-line Tool](https://docs.jottacloud.com/en/articles/1436834-jottacloud-command-line-tool) is a headless [Jottacloud](https://jottacloud.com) client.

## Quick Start {#module-services-jotta-cli-quick-start}

```nix
{
  user.services.jotta-cli.enable = true;
}
```

This adds `jotta-cli` to `environment.systemPackages` and starts a user service that runs `jottad` with the default options.

## Example Configuration {#module-services-jotta-cli-example-configuration}

```nix
user.services.jotta-cli = {
  enable = true;
  options = [ "slow" ];
  package = pkgs.jotta-cli;
};
```

This uses `jotta-cli` and `jottad` from the `pkgs.jotta-cli` package and starts `jottad` in low memory mode.

`jottad` is also added to `environment.systemPackages`, so `jottad --help` can be used to explore options.
+43 −0
Original line number Diff line number Diff line
{ config, lib, pkgs, ... }:

with lib;

let cfg = config.user.services.jotta-cli;
in {
  options = {
    user.services.jotta-cli = {

      enable = mkEnableOption "Jottacloud Command-line Tool";

      options = mkOption {
        default = [ "stdoutlog" "datadir" "%h/.jottad/" ];
        example = [ ];
        type = with types; listOf str;
        description = "Command-line options passed to jottad.";
      };

      package = lib.mkPackageOption pkgs "jotta-cli" { };
    };
  };
  config = mkIf cfg.enable {
    systemd.user.services.jottad = {

      description = "Jottacloud Command-line Tool daemon";

      serviceConfig = {
        Type = "notify";
        EnvironmentFile = "-%h/.config/jotta-cli/jotta-cli.env";
        ExecStart = "${lib.getExe' cfg.package "jottad"} ${concatStringsSep " " cfg.options}";
        Restart = "on-failure";
      };

      wantedBy = [ "default.target" ];
      wants = [ "network-online.target" ];
      after = [ "network-online.target" ];
    };
    environment.systemPackages = [ pkgs.jotta-cli ];
  };

  meta.maintainers = with lib.maintainers; [ evenbrenden ];
  meta.doc = ./jotta-cli.md;
}
+1 −0
Original line number Diff line number Diff line
@@ -451,6 +451,7 @@ in {
  jirafeau = handleTest ./jirafeau.nix {};
  jitsi-meet = handleTest ./jitsi-meet.nix {};
  jool = import ./jool.nix { inherit pkgs runTest; };
  jotta-cli = handleTest ./jotta-cli.nix {};
  k3s = handleTest ./k3s {};
  kafka = handleTest ./kafka.nix {};
  kanidm = handleTest ./kanidm.nix {};
Loading