MacOS via nix-darwin

If you are using nix-darwin you can install Riptide on macOS using a nix-darwin module. This allows much greater functionality to be supported than with the manual setup.

This module is provided via a Flake in the riptide-all repository.

Installation

You can either install the module via a Flake or by manually pulling the module with fetchTarball in a classic nix-darwin system configuration.

In addition to these steps, Docker Desktop must be installed on your system.

Via Flake

Change your flake.nix like so:

{
    inputs.riptide.url = "github:theCapypara/riptide-all";
    # optional:
    #inputs.riptide.inputs.nixpkgs.follows = "nixpkgs";

    outputs = { self, nixpkgs, riptide }: {
        # change `yourhostname` to your actual hostname
        darwinConfigurations.yourhostname = nixpkgs.lib.darwinSystem {
            # change to your system:
            system = "x86_64-darwin";
            modules = [
                ./configuration.nix
                riptide.darwinModules.default
            ];
        };
    };
}

Via fetchTarball

This is currently not supported. Please use Flakes or get in touch if you need this.

Enable Riptide

To enable and use Riptide, use the services.riptide configuration:

# Your user and its home directory MUST be declared in the configuration:
users.users."YOUR USERNAME" = {
    home = "/Users/YOUR USERNAME/";
};

services.riptide = {
    enable = true;
    # Replace with your username.
    user = "YOUR USERNAME";
};

See below for all options.

Shell integration

Riptide adds some additional features to your shell, in order to automatically add project commands into your shell. To use this feature, asuming you use Flakes, you can add hooks into your bashrc or zshrc via riptide.riptideShellIntegration.bash or riptide.riptideShellIntegration.zsh.

Example for ZSH using home-manager:

{ riptide }:

{
    programs.zsh = {
        enable = true;
        enableCompletion = true;

        initExtra = ''
            ${riptide.riptideShellIntegration.zsh}
        '';
    };
}

If you can not use this or are not using Flakes add these to either your .zshrc or .bashrc:

  • .bashrc: . <(nix-riptide.hook.bash)

  • .zshrc: . <(nix-riptide.hook.zsh)

Please note that these could change with Riptide updates, so using the value provided by the Flake is recommended.

Module configuration

services.riptide.enable

Whether to enable Riptide general service and CLI.

Type: boolean

Default: false

Example: true

services.riptide.cli

CLI settings

Type: submodule

Default: { }

services.riptide.cli.package

The riptide-cli package to use. Defaults to the one provided by this Flake

Type: package

services.riptide.dbDrivers

Database driver settings

Type: submodule

Default: { }

services.riptide.dbDrivers.mongodb

Riptide MongoDB database driver

Type: submodule

Default: { }

services.riptide.dbDrivers.mongodb.enable

Whether to enable this package.

Type: boolean

Default: false

Example: true

services.riptide.dbDrivers.mongodb.package

The riptide-db-mongo package to use. Defaults to the one provided by this Flake

Type: package

services.riptide.dbDrivers.mysql

Riptide MySQL database driver

Type: submodule

Default: { }

services.riptide.dbDrivers.mysql.enable

Whether to enable this package.

Type: boolean

Default: true

Example: true

services.riptide.dbDrivers.mysql.package

The riptide-db-mysql package to use. Defaults to the one provided by this Flake

Type: package

services.riptide.dockerHost

Override the docker/podman socket Riptide connects to. Only relevant if engine.name = "docker". Tries to auto-detect by default.

Type: string

Default: ""

Example: "unix:///run/user/1000/podman/podman.sock"

services.riptide.engine

Settings regarding Riptide’s backend engine

Type: submodule

Default: { }

services.riptide.engine.package

The Riptide Engine package to use. Defaults to riptide-engine-docker provided by this Flake

Type: package

services.riptide.engine.name

Riptide engine implementation to use

Type: string

Default: "docker"

services.riptide.extraConfig

Additional configuration to merge into the system configuration

Type: open submodule of (JSON value)

Default: { }

services.riptide.plugins

Plugin settings

Type: submodule

Default: { }

services.riptide.plugins.phpXdebug

Riptide Plugin to manage the state of PHP Xdebug

Type: submodule

Default: { }

services.riptide.plugins.phpXdebug.enable

Whether to enable this package.

Type: boolean

Default: true

Example: true

services.riptide.plugins.phpXdebug.package

The riptide-plugin-php-xdebug package to use. Defaults to the one provided by this Flake

Type: package

services.riptide.proxy

Settings regarding Riptide’s proxy server

Type: submodule

Default: { }

services.riptide.proxy.enable

Whether to enable Riptide Proxy Server.

Type: boolean

Default: true

Example: true

services.riptide.proxy.package

The riptide-proxy package to use. Defaults to the one provided by this Flake

Type: package

services.riptide.proxy.autostart

Enable or disable auto-starting when a project or service is not running

Type: boolean

Default: true

services.riptide.proxy.ports

Proxy Server port configuration

Type: submodule

Default: { }

services.riptide.proxy.ports.http

The HTTP port the proxy server should bind to

Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default: 80

Example: 80

services.riptide.proxy.ports.https

The HTTPS port the proxy server should bind to

Type: 16 bit unsigned integer; between 0 and 65535 (both inclusive)

Default: 443

Example: 443

services.riptide.proxy.url

The prefix that you want your projects to be accessible under. riptide.local -> projectname.riptide.local

Type: string

Default: "riptide.local"

Example: "riptide.local"

services.riptide.python

What Python environment to use. Change this only if you know what you are doing

Type: package

services.riptide.repos

List of Riptide repositories. By default this contains the public community repository

Type: list of string

Default:

[
  "https://github.com/theCapypara/riptide-repo.git"
]

Example:

[
  "https://github.com/theCapypara/riptide-repo.git"
  "https://github.com/foobar/repo.git"
]

services.riptide.resolveProjectHosts

If enabled, project URLs are locally resolvable. Under NixOS this will install the dnsmasq service, if not already installed. Under nix-darwin, the /etc/hosts file will be modified by Riptide.

Type: boolean

Default: true

services.riptide.user

The user to run the Riptide proxy as (if enabled) and the user for which the configuration file will be created.

Type: string

Example: "yourUser"