Skip to content
This repository has been archived by the owner on Feb 6, 2022. It is now read-only.

critbase/flakewhale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flakewhale

much of the included code is from mmai’s work on creating a flake for funkwhale.

while I appreciate the work that mmai has done, I prefer tracking upstream funkwhale updates more closely, and think there’s a few changes to the flake itself that would make it easier to use.

thus, this repository was born.

example configuration

this is roughly the configuration I use.

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
  inputs.flakewhale.url = "github:critbase/flakewhale";

  outputs = { self, nixpkgs, ... }@inputs: {
    nixosConfigurations = {
      example-host = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          # all your config here
          nixpkgs.nixosModules.notDetected
          inputs.flakewhale.nixosModule
          ({ config, pkgs, lib, ... }: {
            services.funkwhale = {
              enable = true;
              hostname = "funkwhale.example.com";
              defaultFromEmail = "funkwhale@example.com";
              protocol = "https";
              forceSSL = true;

              api.djangoSecretKey = "skelter-heaven";

              # not strictly necessary unless you have port conflicts on 5000
              apiPort = 5045;

              # use this if you already have ACME certificates set up, and want to use them for funkwhale
              # TODO: make this an option in module.nix
              services.nginx.virtualHosts."funkwhale.example.com" = {
                enableACME = lib.mkForce false;
                useACMEHost = "example.com";
              };
              security.acme.certs."example.com".extraDomainNames =
                [ "funkwhale.example.com" ];
            };
          })
        ];
      };
    };
  };
}

administration

to make it easy, funkwhale’s manage.py is wrapped with the proper libraries and installed into environment.systemPackages as funkwhale-manage.

this means any commands that would normally be passed to that manage.py command should instead be passed to the shell script funkwhale-manage.

for example:

  • to create a new superuser, execute the following (as root)

    # su -l funkwhale -s /bin/sh -c "funkwhale-manage createsuperuser"

  • to import new music, execute the following (as root)

    # su -l funkwhale -s /bin/sh -c "funkwhale-manage import_files ${LIBRARY_ID} '/var/lib/funkwhale/music' --recursive --noinput --in-place"

    • where ${LIBRARY_ID} is the library ID of the funkwhale library to which you want to add music.
    • generally, you should symlink already existing music folders into /var/lib/funkwhale/music, rather than specifying those directories separately when importing.

      the main reason for this is that the funkwhale user that funkwhale runs as generally does not (and probably shouldn’t!) have permissions to even access music folders, or most folders, outside of /var/lib/funkwhale

​TODO list

Run funkwhale in a NixOS container

  • State “TODO” from [2021-06-02 Wed 18:52]
currently, it doesn’t seem to work at all when running under a container. It does not seem to be able to connect, though the services run just fine in the container. Thus far, I’ve been unable to diagnose this. All future work on trying to get containers to work will go in the container branch.

add options to use existing ACME hosts

  • State “TODO” from [2021-04-28 Wed 02:15]
this option would not be mutually exclusive with forceSSL (probably?)

get funkwhale to “see” ffmpeg (if it isn’t already)

  • State “TODO” from [2021-04-28 Wed 02:16]
funkwhale spits out errors about not being able to find ffprobe; however, this may not even be a real issue. I don’t use transcoding, so I don’t actually know whether funkwhale transcodes or not.

If you make use of transcoding and are willing to test things out, please reach out, open an issue, make a PR, etc.

autodetect and upgrade installed front files

  • State “TODO” from [2021-04-28 Wed 02:59]

Releases

No releases published

Packages

No packages published

Languages