/mbslave-flake

Package the mbslave utility as a systemd service and make it available as a command-line command.

Primary LanguageNixGNU General Public License v3.0GPL-3.0

MBSlave Flake

This is a thin wrapper for the MBSlave tool that is used to automate synchronization with the Music Brainz database in a local postgres database.

Importing this flake allows you to install the mbslave command through pkgs.

# flake.nix

inputs = {

    # ...
    mbslave = {
        url = "github:Nickiel12/mbslave-flake";
    };
    # ...

};

# Don't take my word for how this has to be. 
# As long as the mbslave gets passed as a parameter to the output, it's fine
outputs = inputs@{
    # ...
    mbslave
    #...
}:
#...

    packages = [
        mbslave.packages.${system}.mbslave
    ];

#...

Disclaimers

This flake does not yet expose a systemd service that will automatically run mbslave for you. Right now all it exposes is the command line utility.

All that needs to be set up is either a configuration file (that is not generated by this flake), or the environment variables set (not recommended as setting the environment variables such that a systemd service could read them may expose secrets in your repo! Just keep it in mind), and mbslave sync will automatically keep an existing database up to date. Read the MBSlave doc page for more information.

You can create your systemd service using this package, but keep in mind that mb-slave does have required schema migrations as warned on their github that may break the utility.