home: add WIP mopidy config (need to fix pkg)

This commit is contained in:
NullBite 2024-02-29 21:50:04 -05:00
parent 9ae057ee36
commit 152a3b3c55
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
5 changed files with 59 additions and 0 deletions

View File

@ -13,6 +13,9 @@ in
config = lib.mkIf cfg.enable {
nixfiles = {
profile.base.enable = true;
programs = {
mopidy.enable = true;
};
packageSets = {
communication.enable = true;
dev.enable = true;

View File

@ -2,5 +2,6 @@
{
imports = [
./comma.nix
./mopidy.nix
];
}

29
home/programs/mopidy.nix Normal file
View File

@ -0,0 +1,29 @@
{ lib, pkgs, config, outputs, osConfig ? {}, ... }:
let
cfg = config.nixfiles.programs.mopidy;
in
{
options.nixfiles.programs.mopidy = {
enable = lib.mkEnableOption "mopidy configuration";
};
config = lib.mkIf cfg.enable {
xdg.configFile."mopidy/mopidy.conf".enable = lib.mkForce false;
services.mopidy = {
enable = lib.mkDefault true;
extensionPackages = with pkgs; [
mopidy-mpd
mopidy-iris
mopidy-mpris
mopidy-local
mopidy-jellyfin
mopidy-bandcamp
mopidy-ytmusic
mopidy-soundcloud
# outputs.packages.${pkgs.system}.mopidy-autoplay
];
};
home.packages = with pkgs; [
(ncmpcpp.override { visualizerSupport = true; })
];
};
}

View File

@ -7,4 +7,5 @@ in
google-fonts = callPackage ./google-fonts { };
wm-helpers = callPackage ./wm-helpers { };
atool = callPackage ./atool-wrapped { };
mopidy-autoplay = callPackage ./mopidy-autoplay { };
}

View File

@ -0,0 +1,25 @@
{ lib, python3Packages, fetchPypi, mopidy }:
# based on mopidy/jellyfin.nix
python3Packages.buildPythonApplication rec {
pname = "mopidy-autoplay";
version = "0.2.3";
src = fetchPypi {
inherit version;
pname = "Mopidy-Autoplay";
sha256 = "sha256-E2Q+Cn2LWSbfoT/gFzUfChwl67Mv17uKmX2woFz/3YM=";
};
propagatedBuildInputs = [ mopidy ];
# no tests implemented
doCheck = false;
pythonImportsCheck = [ "mopidy_autoplay" ];
meta = with lib; {
homepage = "https://codeberg.org/sph/mopidy-autoplay";
description = "Mopidy extension to automatically pick up where you left off and start playing the last track from the position before Mopidy was shut down.";
license = licenses.asl20;
};
}