Skip to content

Commit 824ce99

Browse files
committed
move stuff to fridge
1 parent 665ac1f commit 824ce99

File tree

2 files changed

+121
-130
lines changed

2 files changed

+121
-130
lines changed

hosts/blender/configuration.nix

Lines changed: 1 addition & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, pkgs, inputs, ... }:
1+
{ pkgs, ... }:
22
{
33
imports = [
44
./hardware-configuration.nix
@@ -31,134 +31,6 @@
3131
dockerCompat = true;
3232
};
3333

34-
networking.vpn = {
35-
enable = true;
36-
wgConfigFile = "/var/lib/secrets/wg0.conf";
37-
ip = "10.197.52.6/24";
38-
portForwards = {
39-
# note: this string becomes the service name
40-
"portforward-transmission" = {
41-
localPort = 9091;
42-
namespacePort = 9091;
43-
};
44-
};
45-
services = [
46-
"transmission"
47-
];
48-
};
49-
50-
services.k3s = {
51-
enable = false;
52-
role = "server";
53-
extraFlags = toString [
54-
"--disable=traefik"
55-
];
56-
};
57-
58-
services.transmission = {
59-
enable = true;
60-
package = pkgs.transmission_4.overrideAttrs (finalAttrs: previousAttrs: {
61-
version = "4.0.5";
62-
src = pkgs.fetchFromGitHub {
63-
owner = "transmission";
64-
repo = "transmission";
65-
rev = finalAttrs.version;
66-
hash = "sha256-gd1LGAhMuSyC/19wxkoE2mqVozjGPfupIPGojKY0Hn4=";
67-
fetchSubmodules = true;
68-
};
69-
});
70-
openRPCPort = true;
71-
settings = {
72-
download-dir = "/mnt/nas-fun/downloads/complete";
73-
incomplete-dir = "/mnt/nas-fun/downloads/incomplete";
74-
watch-dir = "/mnt/nas-fun/downloads/watch";
75-
watch-dir-enabled = true;
76-
speed-limit-up = 1000;
77-
speed-limit-up-enabled = true;
78-
alt-speed-up = 0;
79-
alt-speed-down = 0;
80-
peer-port = 51414;
81-
download-queue-size = 20;
82-
rpc-whitelist-enabled = false;
83-
rpc-bind-address = "0.0.0.0";
84-
rpc-host-whitelist-enabled = false;
85-
ratio-limit-enabled = true;
86-
ratio-limit = 3;
87-
};
88-
};
89-
systemd.services.transmission = {
90-
after = [ "mnt-nas\\x2dfun.mount" ];
91-
requires = [ "mnt-nas\\x2dfun.mount" ];
92-
};
93-
services.nginx.virtualHosts."torrent.pine.marco.ooo" = {
94-
forceSSL = true;
95-
useACMEHost = "pine.marco.ooo";
96-
locations."/" = {
97-
proxyPass = "http://127.0.0.1:9091";
98-
};
99-
};
100-
101-
security.acme.acceptTerms = true;
102-
security.acme.defaults = {
103-
email = inputs.self.users.marco.email;
104-
# server = "https://acme-staging-v02.api.letsencrypt.org/directory";
105-
group = "nginx";
106-
dnsProvider = "cloudflare";
107-
credentialsFile = "/var/lib/secrets/cloudflare-blender-acme";
108-
# dnsPropagationCheck = false;
109-
# dnsResolver = "1.1.1.1:53";
110-
};
111-
security.acme.certs."pine.marco.ooo" = {
112-
domain = "*.pine.marco.ooo";
113-
};
114-
115-
services.nginx = {
116-
enable = true;
117-
recommendedProxySettings = true;
118-
recommendedTlsSettings = true;
119-
clientMaxBodySize = "200m";
120-
};
121-
122-
services.sonarr = {
123-
enable = true;
124-
user = "nas";
125-
group = "users";
126-
};
127-
services.nginx.virtualHosts."sonarr.pine.marco.ooo" = {
128-
forceSSL = true;
129-
useACMEHost = "pine.marco.ooo";
130-
locations."/" = {
131-
proxyPass = "http://localhost:8989";
132-
proxyWebsockets = true;
133-
};
134-
};
135-
136-
services.radarr = {
137-
enable = true;
138-
user = "nas";
139-
group = "users";
140-
};
141-
services.nginx.virtualHosts."radarr.pine.marco.ooo" = {
142-
forceSSL = true;
143-
useACMEHost = "pine.marco.ooo";
144-
locations."/" = {
145-
proxyPass = "http://localhost:7878";
146-
proxyWebsockets = true;
147-
};
148-
};
149-
150-
services.jellyseerr = {
151-
enable = true;
152-
};
153-
services.nginx.virtualHosts."jellyseerr.pine.marco.ooo" = {
154-
forceSSL = true;
155-
useACMEHost = "pine.marco.ooo";
156-
locations."/" = {
157-
proxyPass = "http://localhost:${toString config.services.jellyseerr.port}";
158-
proxyWebsockets = true;
159-
};
160-
};
161-
16234
services.qemuGuest.enable = true;
16335

16436
fileSystems."/mnt/nas-fun" = {

hosts/fridge/configuration.nix

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,130 @@
1-
{ ... }: {
1+
{ pkgs, config, inputs, ... }: {
22
imports = [
33
./disk-config.nix
44
./hardware-config.nix
5+
../../modules/nixos/network-stuff.nix
56
];
67

78
networking.hostName = "fridge";
89

10+
networking.firewall = {
11+
allowedTCPPorts = [
12+
80
13+
443
14+
];
15+
};
16+
17+
environment.systemPackages = with pkgs; [
18+
iftop
19+
];
20+
21+
networking.vpn = {
22+
enable = true;
23+
wgConfigFile = "/mnt/persist/var/lib/secrets/wg0.conf";
24+
ip = "10.197.52.11/24";
25+
portForwards = {
26+
# note: this string becomes the service name
27+
"portforward-transmission" = {
28+
localPort = 9091;
29+
namespacePort = 9091;
30+
};
31+
};
32+
services = [
33+
"transmission"
34+
];
35+
};
36+
37+
users.users."nas" = {
38+
uid = 1024;
39+
isSystemUser = true;
40+
group = "users";
41+
};
42+
43+
services.transmission = {
44+
enable = true;
45+
46+
package = pkgs.transmission_4.overrideAttrs (finalAttrs: previousAttrs: {
47+
version = "4.0.5";
48+
src = pkgs.fetchFromGitHub {
49+
owner = "transmission";
50+
repo = "transmission";
51+
rev = finalAttrs.version;
52+
hash = "sha256-gd1LGAhMuSyC/19wxkoE2mqVozjGPfupIPGojKY0Hn4=";
53+
fetchSubmodules = true;
54+
};
55+
});
56+
57+
home = "/mnt/persist/var/lib/transmission";
58+
59+
settings = {
60+
download-dir = "/mnt/nas-fun/downloads/complete";
61+
incomplete-dir = "/mnt/nas-fun/downloads/incomplete";
62+
watch-dir = "/mnt/nas-fun/downloads/watch";
63+
watch-dir-enabled = true;
64+
speed-limit-up = 1000;
65+
speed-limit-up-enabled = true;
66+
alt-speed-up = 0;
67+
alt-speed-down = 0;
68+
peer-port = 51414;
69+
download-queue-size = 20;
70+
rpc-whitelist-enabled = false;
71+
rpc-bind-address = "0.0.0.0";
72+
rpc-host-whitelist-enabled = false;
73+
ratio-limit-enabled = true;
74+
ratio-limit = 3;
75+
};
76+
};
77+
78+
systemd.services.transmission = {
79+
after = [ "mnt-nas\\x2dfun.mount" ];
80+
requires = [ "mnt-nas\\x2dfun.mount" ];
81+
};
82+
83+
services.sonarr = {
84+
enable = true;
85+
dataDir = "/mnt/persist/var/lib/sonarr/.config/NzbDrone";
86+
user = "nas";
87+
group = "users";
88+
};
89+
90+
services.nginx = {
91+
enable = true;
92+
recommendedProxySettings = true;
93+
recommendedTlsSettings = true;
94+
clientMaxBodySize = "200m";
95+
virtualHosts = {
96+
"sonarr.risaro.la" = {
97+
forceSSL = true;
98+
useACMEHost = "risaro.la";
99+
locations."/" = {
100+
proxyPass = "http://localhost:${toString config.services.sonarr.settings.server.port}";
101+
proxyWebsockets = true;
102+
};
103+
};
104+
"torrent.risaro.la" = {
105+
forceSSL = true;
106+
useACMEHost = "risaro.la";
107+
locations."/" = {
108+
proxyPass = "http://127.0.0.1:${toString config.services.transmission.settings.rpc-port}";
109+
};
110+
};
111+
};
112+
};
113+
114+
security.acme = {
115+
acceptTerms = true;
116+
defaults = {
117+
email = inputs.self.users.marco.email;
118+
# server = "https://acme-staging-v02.api.letsencrypt.org/directory";
119+
group = "nginx";
120+
dnsProvider = "cloudflare";
121+
credentialsFile = "/mnt/persist/var/lib/secrets/cloudflare-fridge-acme";
122+
};
123+
certs."risaro.la" = {
124+
domain = "*.risaro.la";
125+
};
126+
};
127+
9128
services.qemuGuest.enable = true;
10129

11130
services.openssh.hostKeys = [

0 commit comments

Comments
 (0)