Skip to content

Commit

Permalink
feat(jeeves)!: nginx reverse-proxying for jeeves.local
Browse files Browse the repository at this point in the history
  • Loading branch information
reo101 committed Jul 20, 2024
1 parent a8e669c commit 0a0c79f
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 20 deletions.
2 changes: 2 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
inputs.agenix-rekey.nixosModules.default
./network.nix
./wireguard.nix
./nginx.nix
./jellyfin.nix
./transmission.nix
./mindustry.nix
# ./home-assistant
./samba.nix
Expand Down
26 changes: 6 additions & 20 deletions machines/nixos/x86_64-linux/jeeves/jellyfin.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
{ lib, pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
tremc
];

# networking.extraHosts = ''
# 127.0.0.1 jeeves
# '';

hardware.graphics = {
enable = true;
enable32Bit = true;
Expand All @@ -21,20 +13,14 @@
};

services = {
transmission = {
enable = true;
package = pkgs.transmission_4;
openRPCPort = true;
webHome = pkgs.flood-for-transmission;
# TODO: `credentialsFile` for RPC password with agenix
settings = {
download-dir = "/data/torrents/download";
incomplete-dir = "/data/torrents/incomplete";
incomplete-dir-enabled = true;
rpc-bind-address = "0.0.0.0";
rpc-whitelist = "127.0.0.1,192.168.*.*,10.100.0.*";
nginx = {
virtualHosts."jellyfin.jeeves.local" = {
enableACME = false;
forceSSL = false;
locations."/".proxyPass = "http://127.0.0.1:8096";
};
};

jellyfin = {
enable = true;
openFirewall = true;
Expand Down
4 changes: 4 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/network.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
environment.systemPackages = with pkgs; [
];

networking.extraHosts = ''
127.0.0.1 jeeves.local
'';

# networking.nftables.enable = true;

age.secrets."home.wifi.env" = {
Expand Down
25 changes: 25 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/nginx.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ inputs, outputs, lib, pkgs, config, ... }:

{
environment.systemPackages = [
# config.services.nextcloud.package
];

networking.firewall.allowedTCPPorts = [ 80 443 ];

services.nginx = {
enable = true;
package = pkgs.openresty;
# virtualHosts."_.jeeves.local" = {
# # listen = [
# # {
# # addr = "127.0.0.1";
# # port = 1234;
# # }
# # ];
# enableACME = false;
# forceSSL = false;
# locations."/".proxyPass = "http://127.0.0.1:1234";
# };
};
}
31 changes: 31 additions & 0 deletions machines/nixos/x86_64-linux/jeeves/transmission.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ lib, pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
tremc
];

services = {
transmission = {
enable = true;
package = pkgs.transmission_4;
openRPCPort = true;
webHome = pkgs.flood-for-transmission;
# TODO: `credentialsFile` for RPC password with agenix
settings = {
download-dir = "/data/torrents/download";
incomplete-dir = "/data/torrents/incomplete";
incomplete-dir-enabled = true;
rpc-bind-address = "0.0.0.0";
rpc-whitelist = "127.0.0.1,192.168.*.*,10.100.0.*,*.local";
};
};

nginx = {
virtualHosts."transmission.jeeves.local" = {
enableACME = false;
forceSSL = false;
locations."/".proxyPass = "http://127.0.0.1:9091";
};
};
};
}

0 comments on commit 0a0c79f

Please sign in to comment.