diff options
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | home.nix | 1 | ||||
-rw-r--r-- | hosts/laurel/configuration.nix | 55 | ||||
-rw-r--r-- | hosts/laurel/servarr.nix | 87 | ||||
-rw-r--r-- | scripts/record.nix | 4 |
5 files changed, 141 insertions, 8 deletions
@@ -53,6 +53,8 @@ | |||
53 | flaresolverr = flaresolverr.overlays.default; | 53 | flaresolverr = flaresolverr.overlays.default; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | formatter."x86_64-linux" = nixpkgs.legacyPackages."x86_64-linux".nixpkgs-fmt; | ||
57 | |||
56 | nixosConfigurations = { | 58 | nixosConfigurations = { |
57 | olive = nixpkgs.lib.nixosSystem { | 59 | olive = nixpkgs.lib.nixosSystem { |
58 | system = "x86_64-linux"; | 60 | system = "x86_64-linux"; |
@@ -50,6 +50,7 @@ | |||
50 | thunderbird | 50 | thunderbird |
51 | calibre | 51 | calibre |
52 | gh | 52 | gh |
53 | sonixd | ||
53 | 54 | ||
54 | # gaming | 55 | # gaming |
55 | mgba | 56 | mgba |
diff --git a/hosts/laurel/configuration.nix b/hosts/laurel/configuration.nix index a40dafd..ab05bc0 100644 --- a/hosts/laurel/configuration.nix +++ b/hosts/laurel/configuration.nix | |||
@@ -9,6 +9,7 @@ | |||
9 | [ | 9 | [ |
10 | # Include the results of the hardware scan. | 10 | # Include the results of the hardware scan. |
11 | ./hardware-configuration.nix | 11 | ./hardware-configuration.nix |
12 | ./servarr.nix | ||
12 | ]; | 13 | ]; |
13 | 14 | ||
14 | # Use the systemd-boot EFI boot loader. | 15 | # Use the systemd-boot EFI boot loader. |
@@ -20,7 +21,7 @@ | |||
20 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. | 21 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. |
21 | # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. | 22 | # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. |
22 | networking.hostName = "laurel"; | 23 | networking.hostName = "laurel"; |
23 | networking.firewall.allowedTCPPorts = [ 80 443 ]; | 24 | networking.firewall.allowedTCPPorts = [ 80 443 6197 ]; |
24 | 25 | ||
25 | time.timeZone = "Europe/London"; | 26 | time.timeZone = "Europe/London"; |
26 | i18n.defaultLocale = "en_US.UTF-8"; | 27 | i18n.defaultLocale = "en_US.UTF-8"; |
@@ -44,10 +45,19 @@ | |||
44 | ]; | 45 | ]; |
45 | }; | 46 | }; |
46 | 47 | ||
47 | environment.systemPackages = with pkgs; [ | 48 | environment.systemPackages = [ |
48 | vim | 49 | pkgs.vim |
49 | wget | 50 | pkgs.wget |
50 | curl | 51 | pkgs.curl |
52 | |||
53 | pkgs.jellyfin | ||
54 | pkgs.jellyfin-web | ||
55 | pkgs.jellyfin-ffmpeg | ||
56 | |||
57 | pkgs.htop | ||
58 | pkgs.ripgrep | ||
59 | pkgs.git | ||
60 | |||
51 | ]; | 61 | ]; |
52 | 62 | ||
53 | users.users.op = { | 63 | users.users.op = { |
@@ -115,15 +125,48 @@ | |||
115 | }; | 125 | }; |
116 | }; | 126 | }; |
117 | 127 | ||
128 | services.miniflux = { | ||
129 | enable = true; | ||
130 | adminCredentialsFile = "/etc/miniflux/admin"; | ||
131 | config = { | ||
132 | FETCH_YOUTUBE_WATCH_TIME = 1; | ||
133 | PORT = 8383; | ||
134 | BASE_URL = "http://rss.laurel"; | ||
135 | }; | ||
136 | }; | ||
137 | services.nginx.virtualHosts."rss.laurel" = { | ||
138 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
139 | locations."/" = { | ||
140 | proxyPass = "http://127.0.0.1:${builtins.toString config.services.miniflux.config.PORT}"; | ||
141 | }; | ||
142 | }; | ||
143 | |||
118 | services.nginx.virtualHosts."oppi.li" = { | 144 | services.nginx.virtualHosts."oppi.li" = { |
119 | listen = [{ port = 8282; addr = "0.0.0.0"; }]; | 145 | listen = [{ port = 8282; addr = "0.0.0.0"; }]; |
120 | root = "/home/op/site/docs"; | 146 | root = "/www/site/docs"; |
121 | locations."/" = { | 147 | locations."/" = { |
122 | tryFiles = "$uri $uri/ =404"; | 148 | tryFiles = "$uri $uri/ =404"; |
123 | index = "index.html"; | 149 | index = "index.html"; |
124 | }; | 150 | }; |
125 | }; | 151 | }; |
126 | 152 | ||
153 | services.matrix-conduit = { | ||
154 | enable = true; | ||
155 | settings = { | ||
156 | global = { | ||
157 | allow_encryption = true; | ||
158 | allow_federation = true; | ||
159 | allow_registration = false; | ||
160 | database_backend = "rocksdb"; | ||
161 | server_name = "oppi.li"; | ||
162 | address = "0.0.0.0"; | ||
163 | port = 6197; | ||
164 | enable_lightning_bolt = false; | ||
165 | }; | ||
166 | }; | ||
167 | }; | ||
168 | |||
169 | |||
127 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; | 170 | nix.settings.experimental-features = [ "nix-command" "flakes" ]; |
128 | 171 | ||
129 | # This option defines the first version of NixOS you have installed on this particular machine, | 172 | # This option defines the first version of NixOS you have installed on this particular machine, |
diff --git a/hosts/laurel/servarr.nix b/hosts/laurel/servarr.nix new file mode 100644 index 0000000..8b5dd83 --- /dev/null +++ b/hosts/laurel/servarr.nix | |||
@@ -0,0 +1,87 @@ | |||
1 | { config, lib, pkgs, ... }: | ||
2 | |||
3 | { | ||
4 | imports = [ ]; | ||
5 | |||
6 | services.transmission = { | ||
7 | enable = true; | ||
8 | openFirewall = true; | ||
9 | openRPCPort = true; | ||
10 | user = "torrent"; | ||
11 | settings = { | ||
12 | download-dir = "/torrents"; | ||
13 | incomplete-dir = "/.incomplete"; | ||
14 | rpc-bind-address = "0.0.0.0"; | ||
15 | rpc-whitelist = "127.0.0.1,10.0.0.1,192.168.*.*,100.64.*.*"; | ||
16 | }; | ||
17 | }; | ||
18 | services.nginx.virtualHosts."torrent.${config.networking.hostName}" = { | ||
19 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
20 | locations."/" = { | ||
21 | proxyPass = "http://127.0.0.1:9091"; | ||
22 | }; | ||
23 | }; | ||
24 | |||
25 | services.sonarr = { | ||
26 | enable = true; | ||
27 | openFirewall = true; | ||
28 | user = "torrent"; | ||
29 | }; | ||
30 | services.nginx.virtualHosts."sonarr.${config.networking.hostName}" = { | ||
31 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
32 | locations."/" = { | ||
33 | proxyPass = "http://127.0.0.1:8989"; | ||
34 | }; | ||
35 | }; | ||
36 | |||
37 | services.radarr = { | ||
38 | enable = true; | ||
39 | openFirewall = true; | ||
40 | user = "torrent"; | ||
41 | }; | ||
42 | services.nginx.virtualHosts."radarr.${config.networking.hostName}" = { | ||
43 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
44 | locations."/" = { | ||
45 | proxyPass = "http://127.0.0.1:7878"; | ||
46 | }; | ||
47 | }; | ||
48 | |||
49 | services.bazarr = { | ||
50 | enable = true; | ||
51 | openFirewall = true; | ||
52 | user = "torrent"; | ||
53 | }; | ||
54 | services.nginx.virtualHosts."bazarr.${config.networking.hostName}" = { | ||
55 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
56 | locations."/" = { | ||
57 | proxyPass = "http://127.0.0.1:6767"; | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | services.jackett = { | ||
62 | enable = true; | ||
63 | openFirewall = true; | ||
64 | user = "torrent"; | ||
65 | }; | ||
66 | services.nginx.virtualHosts."jackett.${config.networking.hostName}" = { | ||
67 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
68 | locations."/" = { | ||
69 | proxyPass = "http://127.0.0.1:9117"; | ||
70 | }; | ||
71 | }; | ||
72 | |||
73 | services.lidarr = { | ||
74 | enable = true; | ||
75 | openFirewall = true; | ||
76 | user = "torrent"; | ||
77 | }; | ||
78 | services.nginx.virtualHosts."lidarr.${config.networking.hostName}" = { | ||
79 | listen = [{ port = 80; addr = "0.0.0.0"; }]; | ||
80 | locations."/" = { | ||
81 | proxyPass = "http://127.0.0.1:8686"; | ||
82 | }; | ||
83 | }; | ||
84 | |||
85 | } | ||
86 | |||
87 | |||
diff --git a/scripts/record.nix b/scripts/record.nix index d5bfff5..a86d4cd 100644 --- a/scripts/record.nix +++ b/scripts/record.nix | |||
@@ -1,11 +1,11 @@ | |||
1 | { pkgs, ...}: | 1 | { pkgs, ... }: |
2 | 2 | ||
3 | let | 3 | let |
4 | name = "record"; | 4 | name = "record"; |
5 | slop = "${pkgs.slop}/bin/slop"; | 5 | slop = "${pkgs.slop}/bin/slop"; |
6 | ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg"; | 6 | ffmpeg = "${pkgs.ffmpeg}/bin/ffmpeg"; |
7 | in | 7 | in |
8 | pkgs.writeScriptBin name | 8 | pkgs.writeScriptBin name |
9 | '' | 9 | '' |
10 | echo starting recording ... | 10 | echo starting recording ... |
11 | coords=$(${slop} -f "%x %y %w %h %g %i") || exit 1 | 11 | coords=$(${slop} -f "%x %y %w %h %g %i") || exit 1 |