Git Product home page Git Product logo

funkwhale-flake's Introduction

Funkwhale flake

Funkwhale 1.3.3 for NixOS 23.05

Below is an example of a nixos configuration using this flake :

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
  inputs.funkwhale.url = "github:mmai/funkwhale-flake";

  outputs = { self, nixpkgs, funkwhale }: 
  let
    system = "x86_64-linux";
    djangoSecretFile = pkgs.writeText "djangoSecret" "test123"; # DON'T DO THIS IN PRODUCTION - the password file will be world-readable in the Nix Store!
  in {
    nixosConfigurations = {

      server-hostname = nixpkgs.lib.nixosSystem {
        system = system;
        modules = [ 
          nixpkgs.nixosModules.notDetected
	        funkwhale.nixosModule
          ( { config, pkgs, ... }:
            { imports = [ ./hardware-configuration.nix ];

              nix = {
                package = pkgs.nixUnstable;
                extraOptions = ''
                  experimental-features = nix-command flakes
                '';
              };

              nixpkgs.overlays = [ funkwhale.overlay ];

              services.funkwhale = {
                enable = true;
                hostname = "funkwhale.rhumbs.fr";
                defaultFromEmail = "[email protected]";
                protocol = "https";
                # forceSSL = false; # uncomment when LetsEncrypt needs to access "http:" in order to check domain
                api = {
                  djangoSecretKeyFile = "${djangoSecretFile}";
                };
              };

              security.acme = {
                email = "[email protected]";
                acceptTerms = true;
              };

              # Overrides default 30M
              services.nginx.clientMaxBodySize = "100m";

              services.fail2ban.enable = true;
              networking.firewall.allowedTCPPorts = [ 80 443 ];
            })
        ];
      };

    };
  };
}

Imports

  • Copy audio files to the server on the /srv/funkwhale/music/import/ directory
  • execute the import command as funkwhale user, with the library id as a parameter
su -l funkwhale -s /bin/sh -c "funkwhale-manage import_files <your_library_id> '/srv/funkwhale/music/imports' --recursive --noinput --in-place"

Test on a local container

  • start the funkwhale services in a container on the local machine : make local
  • wait 30s for the bootstraping of funkwhale services, then create the super user : make superuser
  • connect to the local service: Get the ip address of the container : machinectl, which output something like this :
MACHINE   CLASS     SERVICE        OS    VERSION ADDRESSES
funkwhale container systemd-nspawn nixos 23.05   10.233.2.2…

Then browse to the ip firefox http://10.233.2.2 and login with the super user credentials you created.

funkwhale-flake's People

Contributors

critbase avatar mmai avatar oxapentane avatar tanneberger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

funkwhale-flake's Issues

Aarch64 support

Heya,

would love to use this flake to deploy funkwhale to my small aarch64 home server. Currently this fails:

nix shell nixpkgs#gnumake
git clone https://github.com/mmai/funkwhale-flake
cd funkwhale-flake
make local

After a while produces this output:

error: a 'x86_64-linux' with features {} is required to build '/nix/store/w7w7w9w60z1dhj4yw1rldb2n1jkiidgi-audit-disable.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
/run/current-system/sw/bin/nixos-container: failed to build container from flake './container/'
make: *** [Makefile:6: local] Error 2

Are there any big hurdles for aarch64 support? Should I rather look for some other deployment option?

`make local` doesn't seem to work any more

Here's what I get when trying to run make local:

$ make local
cd container && nix flake update --update-input funkwhale && cd -
error: unrecognised flag '--update-input'
Try 'nix --help' for more information.
make: *** [Makefile:4: local] Error 1
$ nix flake update --version
nix (Nix) 2.7.0pre20220127_558c4ee

License

Hi!

I would like to upstream some of your work and/or copy it to my nixfiles. Can you please add a license to the repository?

Thanks!

- Milan

access to full import_files functionality

Currently, it appears that the importFiles.sh script doesn't allow any custom usage of funkwhale's import_files command, instead restricting to only one method:

funkwhale-flake/module.nix

Lines 568 to 569 in f0bb472

${funkwhaleEnvScriptData} ${pythonEnv.interpreter} ${pkgs.funkwhale}/api/manage.py \
import_files \$LIBRARY_ID '/srv/funkwhale/music/imports' --recursive --noinput --in-place" > ${cfg.dataDir}/importMusic.sh

I have not begun using this flake yet, however I am concerned that I will not be able to have multiple users each with their own source folder. Could this flake provide a more robust proxy to the import_files command?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.