Funkwhale

Federated platform for audio streaming, exploration, and publishing.

Declared in: projects/Funkwhale/default.nix

Try the service in a VM

  1. Install Nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ apt install --yes curl git jq nix
    Bash
    $ pacman --sync --refresh --noconfirm curl git jq nix
  2. Download a configuration file
    # default.nix
    {
      ngipkgs ? import (fetchTarball "https://github.com/ngi-nix/ngipkgs/tarball/main") { },
    }:
    ngipkgs.demo-vm (
      {
        services.funkwhale = {
          enable = true;
          configureNginx = true;
          settings = {
            FUNKWHALE_HOSTNAME = "localhost";
          };
        };
      }
    )
    
  3. Enable binary substituters
    Bash
    $ export NIX_CONFIG='substituters = https://cache.nixos.org/ https://ngi.cachix.org/
    trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ngi.cachix.org-1:n+CAL72ROC3qQuLxIHpV+Tw5t42WhXmMhprAGkRSrOw='
  4. Build and run a virtual machine
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ nix-build ./default.nix && ./result
    Bash
    $ rev=$(nix-instantiate --eval --attr sources.nixpkgs.rev https://github.com/ngi-nix/ngipkgs/archive/master.tar.gz | jq --raw-output)
    $ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$rev.tar.gz --packages nix --run "nix-build ./default.nix && ./result"
    Bash
    $ nix-build ./default.nix && ./result
  5. Usage Instructions
    1. Create your initial superuser account in the shell:

      cd / && sudo -u funkwhale funkwhale-manage fw users create --superuser

    2. You can log into the website at http://localhost:12345.

Options

services.funkwhale
services.funkwhale.configureNginx

Configure nginx as a reverse proxy for Funkwhale.

You will still need to configure SSL/HTTPS.

Type:
boolean
Default:
false
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.createDatabaseLocally

Create a local PostgreSQL database for Funkwhale.

Type:
boolean
Default:
true
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.createRedisLocally

Create a local Redis server for Funkwhale.

Type:
boolean
Default:
true
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.enable

Whether to enable Funkwhale, a federated audio platform.

Type:
boolean
Default:
false
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.package

The funkwhale package to use.

Type:
package
Default:
pkgs.funkwhale
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.secretEnvironmentFile

Secret environment variable settings. These overwrite services.funkwhale.settings. See https://docs.funkwhale.audio/administrator/configuration/env-file.html.

Example:

DJANGO_SECRET_KEY="some-very-increadibly-secret-key"
TYPESENSE_API_KEY="some-other-very-increadibly-super-secret-key"

DJANGO_SECRET_KEY will be auto-generated if not set here.

Type:
null or absolute path
Default:
null
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings

See https://docs.funkwhale.audio/administrator/configuration/env-file.html.

Secret settings such as DJANGO_SECRET_KEY should go in services.funkwhale.secretEnvironmentFile.

You will need to manually create your first user account. Example: sudo -u funkwhale funkwhale-manage fw users create --superuser. See https://docs.funkwhale.audio/administrator/manage-script/users.html for more information.

Type:
open submodule of attribute set of (signed integer or string or boolean or absolute path or list of (signed integer or string or boolean or absolute path))
Default:
{ }
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings.DATABASE_NAME

Name of the PostgreSQL database.

Type:
string
Default:
"funkwhale"
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings.FUNKWHALE_API_IP

Host or address to bind the API socket to.

Type:
string
Default:
"127.0.0.1"
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings.FUNKWHALE_API_PORT

Port to bind the API socket to.

Type:
16 bit unsigned integer; between 0 and 65535 (both inclusive)
Default:
5000
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings.FUNKWHALE_HOSTNAME

Hostname of your Funkwhale pod.

Type:
string
Declared in:
projects/Funkwhale/services/funkwhale/module.nix
services.funkwhale.settings.FUNKWHALE_PROTOCOL

Protocol end users will use to access your pod.

Type:
one of "http", "https"
Default:
"http"
Declared in:
projects/Funkwhale/services/funkwhale/module.nix

Examples

Basic local configuration
{
  services.funkwhale = {
    enable = true;
    configureNginx = true;
    settings = {
      FUNKWHALE_HOSTNAME = "localhost";
    };
  };
}

Declared in: projects/Funkwhale/services/funkwhale/examples/basic.nix

Metadata

This project is funded by NLnet through these subgrants:

Commons
Funkwhale-AP
Entrust
FunkWhale-Federation
Review
Funkwhale

Related links: