96 lines
2.0 KiB
Nix
96 lines
2.0 KiB
Nix
{ pkgs, ... }:
|
|
|
|
{
|
|
imports = [
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
boot.loader.grub = {
|
|
efiSupport = true;
|
|
efiInstallAsRemovable = true;
|
|
device = "nodev";
|
|
};
|
|
|
|
beatific.hostName = "centroid";
|
|
beatific.defaults = {
|
|
tvbSync = false;
|
|
};
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
# To avoid needing an active user session, run a single system instance
|
|
systemWide = true;
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
mpv # cli media player
|
|
];
|
|
|
|
users.users.tvb.extraGroups = [
|
|
"mopidy"
|
|
"networkmanager"
|
|
"pipewire"
|
|
];
|
|
|
|
users.groups.mopidy = {}; # rw group for media directory
|
|
users.users.mopidy.extraGroups = [
|
|
"mopidy"
|
|
"pipewire" # necessary to allow the system service to play sound
|
|
];
|
|
services.mopidy = let
|
|
mopidyPackages' = pkgs.mopidyPackages.overrideScope (prev: final: { extraPkgs = pkgs: [ pkgs.yt-dlp ]; });
|
|
in {
|
|
enable = true;
|
|
extensionPackages = with mopidyPackages'; [
|
|
mopidy-bandcamp
|
|
mopidy-jellyfin
|
|
mopidy-musicbox-webclient
|
|
mopidy-youtube
|
|
];
|
|
configuration = ''
|
|
[file]
|
|
media_dirs =
|
|
/media/music|Music
|
|
|
|
[jellyfin]
|
|
hostname = jellyfin.home.ktvb.site
|
|
username = mopidy
|
|
password = mopidy
|
|
libraries = Music,Weird Song Halftime
|
|
album_format = {Name} ({ProductionYear})
|
|
|
|
[youtube]
|
|
youtube_dl_package = yt_dlp
|
|
'';
|
|
};
|
|
|
|
services.nginx = {
|
|
enable = true;
|
|
recommendedProxySettings = true;
|
|
virtualHosts = {
|
|
default = {
|
|
default = true;
|
|
locations."/".return = "444";
|
|
};
|
|
"mopidy.home.ktvb.site" = {
|
|
listen = [
|
|
{ addr = "10.22.20.7"; }
|
|
{ addr = "centroid.lan"; }
|
|
];
|
|
locations."/" = {
|
|
proxyWebsockets = true;
|
|
proxyPass = "http://localhost:6680";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
networking.firewall.allowedTCPPorts = [ 80 ];
|
|
|
|
system.stateVersion = "23.11";
|
|
}
|