From efbc368db377bb9d4e16d4d0228f0881add2bcd9 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Fri, 20 Jun 2025 16:01:24 -0500 Subject: [PATCH] working on media server --- hosts/lio/containers.nix | 78 ++++++++++++++++++++++++++++++++++++++- hosts/lio/flake.lock | 79 ++++++++++++++++++++++++++++++++++++++-- hosts/lio/flake.nix | 56 +++++++++++++++++++++++++++- hosts/lio/media_test.md | 12 ++++++ 4 files changed, 219 insertions(+), 6 deletions(-) create mode 100644 hosts/lio/media_test.md diff --git a/hosts/lio/containers.nix b/hosts/lio/containers.nix index 8854431..240ea85 100644 --- a/hosts/lio/containers.nix +++ b/hosts/lio/containers.nix @@ -1,4 +1,8 @@ -{ common }: +{ inputs }: +let + common = inputs.common; + nixarr = inputs.nixarr; +in { config, ... @@ -32,6 +36,78 @@ firewall.trustedInterfaces = [ "ve-*" ]; }; + # containers.nixarr = + # let + # name = "nixarr"; + # # hostDataDir = "/var/lib/${name}"; + # hostAddress = "10.0.0.1"; + # containerAddress = "10.0.0.3"; + # hostAddress6 = "fc00::1"; + # containerAddress6 = "fc00::3"; + # in + # { + # ephemeral = true; + # autoStart = true; + # privateNetwork = true; + # hostAddress = hostAddress; + # localAddress = containerAddress; + # hostAddress6 = hostAddress6; + # localAddress6 = containerAddress6; + # config = + # { config, pkgs, ... }: + # { + # imports = [ + # nixarr.nixosModules.default + # ]; + # system.stateVersion = "25.05"; + # nixpkgs.config.allowUnfree = true; + # + # nixarr = { + # enable = true; + # # These two values are also the default, but you can set them to whatever + # # else you want + # # WARNING: Do _not_ set them to `/home/user/whatever`, it will not work! + # mediaDir = "/var/lib/nixarr_test/media"; + # stateDir = "/var/lib/nixarr_test/state"; + # + # # vpn = { + # # enable = true; + # # # WARNING: This file must _not_ be in the config git directory + # # # You can usually get this wireguard file from your VPN provider + # # wgConf = "/data/.secret/wg.conf"; + # # }; + # + # jellyfin = { + # enable = true; + # # These options set up a nginx HTTPS reverse proxy, so you can access + # # Jellyfin on your domain with HTTPS + # # expose.https = { + # # enable = true; + # # domainName = "your.domain.com"; + # # acmeMail = "your@email.com"; # Required for ACME-bot + # # }; + # }; + # + # # transmission = { + # # enable = true; + # # vpn.enable = true; + # # peerPort = 50000; # Set this to the port forwarded by your VPN + # # }; + # + # # It is possible for this module to run the *Arrs through a VPN, but it + # # is generally not recommended, as it can cause rate-limiting issues. + # sabnzbd.enable = true; # Usenet downloader + # prowlarr.enable = true; # Index manager + # sonarr.enable = true; # TV + # radarr.enable = true; # Movies + # bazarr.enable = true; # subtitles for sonarr and radarr + # lidarr.enable = true; # music + # readarr.enable = true; # books + # jellyseerr.enable = true; # request manager for media + # }; + # }; + # }; + # containers.wasabi = { # ephemeral = true; # autoStart = true; diff --git a/hosts/lio/flake.lock b/hosts/lio/flake.lock index 122ad62..bf260a4 100644 --- a/hosts/lio/flake.lock +++ b/hosts/lio/flake.lock @@ -161,6 +161,26 @@ "type": "github" } }, + "nixarr": { + "inputs": { + "nixpkgs": "nixpkgs_4", + "vpnconfinement": "vpnconfinement", + "website-builder": "website-builder" + }, + "locked": { + "lastModified": 1750367617, + "narHash": "sha256-1kz35TbeqhJMdo1s/WHidoUT64IuoKCGlngv5/JCHiw=", + "owner": "rasmus-kirk", + "repo": "nixarr", + "rev": "450d76583ae6ec025577bde7da2a38cfc7fb0510", + "type": "github" + }, + "original": { + "owner": "rasmus-kirk", + "repo": "nixarr", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1749024892, @@ -210,6 +230,22 @@ } }, "nixpkgs_4": { + "locked": { + "lastModified": 1748662220, + "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { "locked": { "lastModified": 1750133334, "narHash": "sha256-urV51uWH7fVnhIvsZIELIYalMYsyr2FCalvlRTzqWRw=", @@ -225,7 +261,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { "lastModified": 1750188666, "narHash": "sha256-yAfLvtbCzSigTfbsJeOrvljS7VYLAwi2RZ6F+qd+A5E=", @@ -1161,13 +1197,14 @@ "root": { "inputs": { "common": "common", - "nixpkgs": "nixpkgs_4", + "nixarr": "nixarr", + "nixpkgs": "nixpkgs_5", "ros_neovim": "ros_neovim" } }, "ros_neovim": { "inputs": { - "nixpkgs": "nixpkgs_5", + "nixpkgs": "nixpkgs_6", "nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim", "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim", "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring", @@ -1312,6 +1349,42 @@ "repo": "default", "type": "github" } + }, + "vpnconfinement": { + "locked": { + "lastModified": 1743810720, + "narHash": "sha256-kbv/W4gizUSa6qH2rUQdgPj9AJaeN9k2XSWUYqj7IMU=", + "owner": "Maroka-chan", + "repo": "VPN-Confinement", + "rev": "74ae51e6d18b972ecc918ab43e8bde60c21a65d8", + "type": "github" + }, + "original": { + "owner": "Maroka-chan", + "repo": "VPN-Confinement", + "type": "github" + } + }, + "website-builder": { + "inputs": { + "nixpkgs": [ + "nixarr", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750317638, + "narHash": "sha256-B4RWcXXOLO6gMeYyV+K4olu+kGGsYamKH+JAm0cIXqI=", + "owner": "rasmus-kirk", + "repo": "website-builder", + "rev": "b54192000a00e865947f45bacf3184d56363ee38", + "type": "github" + }, + "original": { + "owner": "rasmus-kirk", + "repo": "website-builder", + "type": "github" + } } }, "root": "root", diff --git a/hosts/lio/flake.nix b/hosts/lio/flake.nix index b038ebb..db51cd8 100644 --- a/hosts/lio/flake.nix +++ b/hosts/lio/flake.nix @@ -8,6 +8,8 @@ common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles"; ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim"; + + nixarr.url = "github:rasmus-kirk/nixarr"; }; outputs = @@ -15,8 +17,9 @@ nixpkgs, common, ros_neovim, + nixarr, ... - }: + }@inputs: let configuration_name = "lio"; lib = nixpkgs.lib; @@ -25,15 +28,61 @@ nixosConfigurations = { "${configuration_name}" = ( lib.nixosSystem { + specialArgs = { inherit inputs; }; modules = [ common.nixosModules.default ros_neovim.nixosModules.default + nixarr.nixosModules.default ./configuration.nix ./hardware-configuration.nix - (import ./containers.nix { inherit common; }) + (import ./containers.nix { inherit inputs; }) ( { config, pkgs, ... }: { + # nixarr = { + # enable = true; + # # These two values are also the default, but you can set them to whatever + # # else you want + # # WARNING: Do _not_ set them to `/home/user/whatever`, it will not work! + # mediaDir = "/var/lib/nixarr_test/media"; + # stateDir = "/var/lib/nixarr_test/state"; + # + # # vpn = { + # # enable = true; + # # # WARNING: This file must _not_ be in the config git directory + # # # You can usually get this wireguard file from your VPN provider + # # wgConf = "/data/.secret/wg.conf"; + # # }; + # + # jellyfin = { + # enable = true; + # # These options set up a nginx HTTPS reverse proxy, so you can access + # # Jellyfin on your domain with HTTPS + # expose.https = { + # enable = true; + # domainName = "your.domain.com"; + # acmeMail = "your@email.com"; # Required for ACME-bot + # }; + # }; + # + # # transmission = { + # # enable = true; + # # vpn.enable = true; + # # peerPort = 50000; # Set this to the port forwarded by your VPN + # # }; + # + # # It is possible for this module to run the *Arrs through a VPN, but it + # # is generally not recommended, as it can cause rate-limiting issues. + # sabnzbd.enable = true; # Usenet downloader + # prowlarr.enable = true; # Index manager + # sonarr.enable = true; # TV + # radarr.enable = true; # Movies + # bazarr.enable = true; # subtitles for sonarr and radarr + # lidarr.enable = true; # music + # readarr.enable = true; # books + # jellyseerr.enable = true; # request manager for media + # }; + programs = { steam.enable = true; }; @@ -100,6 +149,9 @@ "input" ]; shell = pkgs.zsh; + packages = with pkgs; [ + sabnzbd + ]; }; }; }; diff --git a/hosts/lio/media_test.md b/hosts/lio/media_test.md new file mode 100644 index 0000000..4819b37 --- /dev/null +++ b/hosts/lio/media_test.md @@ -0,0 +1,12 @@ +[jellyfin](http://10.0.0.3:8096) +[sabnzbd](http://10.0.0.3:6336) +[prowlarr](http://10.0.0.3:9696/) +[radarr](http://10.0.0.3:7878/) +[sonarr](http://10.0.0.3:8989/) +[lidarr](http://10.0.0.3:8686/) +[readarr](http://10.0.0.3:8787/) +[bazarr](http://10.0.0.3:6767) +[jellyseer](http://10.0.0.3:5055/) + + +[reference for setup](https://www.youtube.com/watch?v=twJDyoj0tDc&t=1172s)