Add nicotine service

This commit is contained in:
Nathan McCarty 2023-02-19 20:03:05 -05:00
parent 8c6a855a00
commit b42283f459
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
3 changed files with 52 additions and 32 deletions

View File

@ -71,6 +71,7 @@ with nLib; {
media = { media = {
enable = mkDefaultOption "Media Applications" enable = mkDefaultOption "Media Applications"
(config.nathan.config.isDesktop && pkgs.stdenv.isLinux); (config.nathan.config.isDesktop && pkgs.stdenv.isLinux);
nicotineService = mkDefaultOption "Nicotine service" false;
mopidyExtraConfig = mkOption { mopidyExtraConfig = mkOption {
description = "Extra config files for mopidy"; description = "Extra config files for mopidy";
default = [ ]; default = [ ];

View File

@ -12,39 +12,57 @@ let
terminal = false; terminal = false;
}; };
in { in {
config = lib.mkIf config.nathan.programs.media.enable { config = lib.mkMerge [
# General Packages (lib.mkIf config.nathan.programs.media.enable {
home.packages = with pkgs; [ # General Packages
spotify home.packages = with pkgs; [
unstable.vlc spotify
unstable.plex-media-player unstable.vlc
unstable.obs-studio unstable.plex-media-player
nicotine-plus unstable.obs-studio
irisDesktopItem nicotine-plus
picard irisDesktopItem
mpc-cli picard
calibre mpc-cli
]; calibre
# Mopidy service
# TODO: Add scrobbling
services.mopidy = {
enable = true;
extensionPackages = with pkgs; [
mopidy-mpd
mopidy-iris
mopidy-scrobbler
mopidy-local
]; ];
# extraConfigFiles = config.nathan.programs.media.mopidyExtraConfig; # Mopidy service
settings = { # TODO: Add scrobbling
file = { media_dirs = [ "~/Music" ]; }; services.mopidy = {
local = { enable = true;
enabled = true; extensionPackages = with pkgs; [
media_dir = "~/Music"; mopidy-mpd
mopidy-iris
mopidy-scrobbler
mopidy-local
];
# extraConfigFiles = config.nathan.programs.media.mopidyExtraConfig;
settings = {
file = { media_dirs = [ "~/Music" ]; };
local = {
enabled = true;
media_dir = "~/Music";
};
mpd = { enabled = true; };
}; };
mpd = { enabled = true; }; extraConfigFiles = [ nixosConfig.sops.secrets."last.fm".path ];
}; };
extraConfigFiles = [ nixosConfig.sops.secrets."last.fm".path ]; })
}; (lib.mkIf (config.nathan.programs.media.enable
}; && config.nathan.programs.media.nicotineService) {
systemd.user.services.nicotine = {
Unit = {
Description = "Nicotine++";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = ''
${pkgs.nicotine-plus}/bin/nicotine -s
'';
};
Install = { WantedBy = [ "graphical-session.target" ]; };
};
})
];
} }

View File

@ -7,6 +7,7 @@
programs = { programs = {
util = { wine = true; }; util = { wine = true; };
games = { launcher = true; }; games = { launcher = true; };
media.nicotineService = true;
}; };
}; };