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.
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" ];
};
})
];
};
};
};
}
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
- State “TODO” from [2021-06-02 Wed 18:52]
container
branch.
- State “TODO” from [2021-04-28 Wed 02:15]
- State “TODO” from [2021-04-28 Wed 02:16]
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.
- State “TODO” from [2021-04-28 Wed 02:59]