Skip to content

Commit

Permalink
home-media
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Dec 7, 2024
1 parent 77f5f15 commit 8a4b539
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 33 deletions.
34 changes: 1 addition & 33 deletions configurations/nixos/pureintent/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ in
self.nixosModules.default
./configuration.nix
(self + /webapps/host.nix)
./home-media.nix
];

services.openssh.enable = true;
Expand All @@ -21,39 +22,6 @@ in
package = pkgs.netdataCloud;
};

services.jellyfin = {
enable = true;
openFirewall = true;
};
users.users.vinoth = {
isNormalUser = true;
extraGroups = [ "jellyfin" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGQAoH/iaojJSIHZmPdxZH+CrI8lKqgWA3tMRFlGI41M [email protected]"
];
};
environment.systemPackages = with pkgs; [
yt-dlp
ffmpeg
aria2
tmux
zellij
];
/*
services.transmission = {
enable = true;
group = "jellyfin";
openRPCPort = true;
settings = {
rpc-bind-address = "localhost";
rpc-whitelist-enabled = false; # ACL managed through Tailscale
rpc-host-whitelist = "pureintent pureintent.rooster-blues.ts.net";
download-dir = "/Self/Downloads";
trash-original-torrent-files = true;
};
};
*/

programs.nix-ld.enable = true; # for vscode server

# Workaround the annoying `Failed to start Network Manager Wait Online` error on switch.
Expand Down
75 changes: 75 additions & 0 deletions configurations/nixos/pureintent/home-media.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{ flake, config, pkgs, ... }:

let
inherit (flake) inputs;
inherit (inputs) self;
in
{
services.jellyfin = {
enable = true;
openFirewall = true;
};
environment.systemPackages = with pkgs; [
yt-dlp
ffmpeg
aria2
tmux
zellij
];

/* Not using this
services.transmission = {
enable = true;
group = "jellyfin";
openRPCPort = true;
settings = {
rpc-bind-address = "localhost";
rpc-whitelist-enabled = false; # ACL managed through Tailscale
rpc-host-whitelist = "pureintent pureintent.rooster-blues.ts.net";
download-dir = "/Self/Downloads";
trash-original-torrent-files = true;
};
};
*/

/* Disabled, because jellyfin has issues
age.secrets = {
"pureintent-basic-auth.age" = {
file = self + /secrets/pureintent-basic-auth.age;
owner = "nginx";
};
};
services.nginx = {
enable = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
# virtualHosts."pureintent.rooster-blues.ts.net" = {
virtualHosts = rec {
"pureintent.rooster-blues.ts.net" = pureintent;
"pureintent" = {
locations = {
# Return index.html with likns to other two sites
"/" = {
extraConfig = ''
default_type text/html;
'';
return = "200 '<ul style=\"font-size: 4em;\"><li><a href=\"/web\">Jellyfin</a> (Watch Movies)</li><li><a href=\"/transmission\">Transmission</a> (Torrent Download)</li></ul>'";
};
# Transmission
"/transmission" = {
proxyPass = "http://localhost:9091/transmission";
proxyWebsockets = true;
# transmission has no login page, so use basic auth
basicAuthFile = config.age.secrets."pureintent-basic-auth.age".path;
};
# Jellyfin
"/web" = {
proxyPass = "http://localhost:8096";
proxyWebsockets = true;
};
};
};
};
};
*/
}
Binary file added secrets/pureintent-basic-auth.age
Binary file not shown.
1 change: 1 addition & 0 deletions secrets/secrets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ in
{
"hedgedoc.env.age".publicKeys = users ++ systems;
"github-nix-ci/srid.token.age".publicKeys = users ++ systems;
"pureintent-basic-auth.age".publicKeys = users ++ systems;
}

0 comments on commit 8a4b539

Please sign in to comment.