1
1
Fork 0
nixos-configs/machine/centroid/default.nix

96 lines
2.0 KiB
Nix
Raw Permalink Normal View History

{ pkgs, ... }:
{
2024-01-18 22:55:55 +00:00
imports = [
./hardware-configuration.nix
];
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
2024-01-18 23:10:24 +00:00
beatific.hostName = "centroid";
beatific.defaults = {
tvbSync = false;
};
2024-01-19 01:21:34 +00:00
networking.networkmanager.enable = true;
2024-01-19 04:36:37 +00:00
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 = [
2024-01-20 03:45:55 +00:00
"mopidy"
2024-01-19 04:36:37 +00:00
"networkmanager"
"pipewire"
];
2024-01-19 01:21:34 +00:00
2024-01-20 03:45:55 +00:00
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
mopidy-ytdlp = pkgs.callPackage ./mopidy-youtube.nix { };
in {
2024-01-20 03:45:55 +00:00
enable = true;
extensionPackages = with pkgs; [
mopidy-jellyfin
2024-01-20 03:45:55 +00:00
mopidy-musicbox-webclient
# Replace the default mopidy-youtube, which doesn't have yt-dlp or a way to inject it
mopidy-ytdlp
2024-01-20 03:45:55 +00:00
];
configuration = ''
[file]
media_dirs =
/media/music|Music
[jellyfin]
hostname = jellyfin.backyard.lan
username = mopidy
password = mopidy
libraries = Music,Weird Song Halftime
album_format = {Name} ({ProductionYear})
[youtube]
youtube_dl_package = yt_dlp
2024-01-20 03:45:55 +00:00
'';
};
2024-01-20 04:51:10 +00:00
services.nginx = {
enable = true;
recommendedProxySettings = true;
virtualHosts = {
default = {
default = true;
locations."/".return = "444";
};
2024-02-22 23:03:23 +00:00
"mopidy.home.ktvb.site" = {
listen = [
{ addr = "10.22.20.7"; }
{ addr = "centroid.lan"; }
];
2024-01-20 04:51:10 +00:00
locations."/" = {
proxyWebsockets = true;
proxyPass = "http://localhost:6680";
};
};
};
};
networking.firewall.allowedTCPPorts = [ 80 ];
system.stateVersion = "23.11";
2024-01-18 22:55:55 +00:00
}