nixfiles/nixos/boxes/kelder/containers/acquisition/default.nix

126 lines
3.4 KiB
Nix
Raw Normal View History

2023-05-27 18:44:23 +01:00
{ lib, ... }:
let
inherit (lib.my) net;
2023-11-02 13:41:50 +00:00
inherit (lib.my.c.kelder) domain prefixes;
2023-05-27 18:44:23 +01:00
in
{
nixos.systems.kelder-acquisition = { config, ...}: {
2023-05-23 21:32:38 +01:00
system = "x86_64-linux";
nixpkgs = "mine";
rendered = config.configuration.config.my.asContainer;
2023-05-23 21:32:38 +01:00
assignments = {
internal = {
name = "acquisition-ctr";
2023-05-27 18:44:23 +01:00
inherit domain;
ipv4.address = net.cidr.host 2 prefixes.ctrs.v4;
2023-05-23 21:32:38 +01:00
};
};
configuration = { lib, pkgs, config, ... }:
let
inherit (lib);
in
{
imports = [ ./networking.nix ];
config = {
# Hardware acceleration for Jellyfin
2024-11-30 17:45:59 +00:00
hardware.graphics = {
2023-05-23 21:32:38 +01:00
enable = true;
extraPackages = with pkgs; [
vaapiIntel
intel-ocl
];
};
my = {
deploy.enable = false;
server.enable = true;
user.config.name = "kontent";
secrets = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILSJ8d0prcSvyYi0UasnxMk/HGF5lWZz/t/VFYgQuFwO";
};
};
users = {
2023-11-02 13:41:50 +00:00
groups.media.gid = lib.my.c.kelder.groups.media;
2023-05-23 21:32:38 +01:00
users = {
"${config.my.user.config.name}".extraGroups = [ "media" ];
transmission.extraGroups = [ "media" ];
radarr.extraGroups = [ "media" ];
sonarr.extraGroups = [ "media" ];
jellyfin.extraGroups = [ "render" ];
};
};
environment.systemPackages = with pkgs; [
libva-utils
clinfo
jellyfin-ffmpeg
];
systemd = {
services = {
jackett.bindsTo = [ "systemd-networkd-wait-online@vpn.service" ];
2023-05-23 21:32:38 +01:00
transmission.bindsTo = [ "systemd-networkd-wait-online@vpn.service" ];
# https://github.com/NixOS/nixpkgs/issues/258793#issuecomment-1748168206
transmission.serviceConfig = {
RootDirectoryStartOnly = lib.mkForce false;
RootDirectory = lib.mkForce "";
};
2023-05-23 21:32:38 +01:00
radarr.serviceConfig.UMask = "0002";
sonarr.serviceConfig.UMask = "0002";
};
};
2024-11-30 17:45:59 +00:00
nixpkgs.config.permittedInsecurePackages = [
# FIXME: This is needed for Sonarr
"aspnetcore-runtime-wrapped-6.0.36"
"aspnetcore-runtime-6.0.36"
"dotnet-sdk-wrapped-6.0.428"
"dotnet-sdk-6.0.428"
];
2023-05-23 21:32:38 +01:00
services = {
transmission = {
enable = true;
downloadDirPermissions = null;
performanceNetParameters = true;
settings = {
download-dir = "/mnt/media/downloads/torrents";
incomplete-dir-enabled = true;
incomplete-dir = "/mnt/media/downloads/torrents/.incomplete";
umask = 002;
utp-enabled = true;
port-forwarding-enabled = false;
speed-limit-down = 20480;
speed-limit-down-enabled = true;
speed-limit-up = 1024;
speed-limit-up-enabled = true;
ratio-limit = 2.0;
ratio-limit-enabled = true;
rpc-bind-address = "::";
rpc-whitelist-enabled = false;
rpc-host-whitelist-enabled = false;
};
};
jackett.enable = true;
radarr.enable = true;
sonarr.enable = true;
jellyfin.enable = true;
};
};
};
};
}