Merge remote-tracking branch 'origin/master' into nixos-21.11

This commit is contained in:
Giulio De Pasquale 2022-11-14 12:21:30 +01:00
commit c6cd815553
23 changed files with 61 additions and 134 deletions

View File

@ -3,8 +3,9 @@
let let
domain = "htbaz.giugl.io"; domain = "htbaz.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in
{
services = { services = {
bazarr = { bazarr = {
enable = true; enable = true;
@ -15,12 +16,9 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:6767"; proxyPass = "http://127.0.0.1:6767";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "bazarr";
client_id = "bazarr";
client_secret = "OPn4Mmto2m3dDPji1cjPfHy9W55M9JFq";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -18,7 +18,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8083"; proxyPass = "http://127.0.0.1:8083";
extraConfig = '' extraConfig = ''
client_max_body_size 500M; client_max_body_size 500M;
''; '';

View File

@ -23,27 +23,24 @@ in {
./matrix.nix ./matrix.nix
./fail2ban.nix ./fail2ban.nix
./dns.nix ./dns.nix
# ./minecraft.nix ./minecraft.nix
./prowlarr.nix ./prowlarr.nix
# ./plex.nix
#./githubrunner.nix
./libreddit.nix ./libreddit.nix
./invidious.nix ./invidious.nix
./nitter.nix ./nitter.nix
./ccache.nix
./lidarr.nix ./lidarr.nix
# ./navidrome.nix ./navidrome.nix
./jellyfin.nix ./jellyfin.nix
./prosody.nix ./prosody.nix
./deluge.nix ./deluge.nix
# ./calibre.nix ./calibre.nix
../../cachix.nix ../../cachix.nix
./docker.nix ./docker.nix
./keycloak.nix
]; ];
nixpkgs.config.permittedInsecurePackages = [ "nodejs-12.22.12" ];
time.timeZone = "Europe/Rome"; time.timeZone = "Europe/Rome";
system.stateVersion = "21.11"; # Did you read the comment? system.stateVersion = "21.11";
users.users.giulio.openssh.authorizedKeys.keys = pubkeys; users.users.giulio.openssh.authorizedKeys.keys = pubkeys;
boot = { boot = {
initrd = { initrd = {
@ -56,13 +53,6 @@ in {
hostKeys = [ /secrets/ssh_host_rsa_key ]; hostKeys = [ /secrets/ssh_host_rsa_key ];
authorizedKeys = pubkeys; authorizedKeys = pubkeys;
}; };
# postCommands = ''
# zpool import backedpool -f
# zpool import zpool -f
# echo "zfs load-key -ar; killall zfs" >> /root/.profile
# '';
}; };
}; };
}; };
@ -88,7 +78,7 @@ in {
supportedFilesystems = [ "zfs" ]; supportedFilesystems = [ "zfs" ];
zfs.requestEncryptionCredentials = true; zfs.requestEncryptionCredentials = true;
tmpOnTmpfsSize = "80%"; tmpOnTmpfsSize = "50%";
}; };
networking = { networking = {
@ -133,7 +123,7 @@ in {
''; '';
}; };
environment.systemPackages = with pkgs; [ cudatoolkit cachix ]; environment.systemPackages = with pkgs; [ cachix ];
hardware = { hardware = {
opengl.enable = true; opengl.enable = true;

View File

@ -3,7 +3,7 @@
let let
domain = "htdel.giugl.io"; domain = "htdel.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in {
services = { services = {
deluge = { deluge = {
@ -22,7 +22,7 @@ in {
max_active_seeding = 100; max_active_seeding = 100;
max_connections_global = 1000; max_connections_global = 1000;
max_active_limit = 100; max_active_limit = 100;
max_active_downloading = 100; max_active_downloading = 100;
listen_ports = [ 51413 51414 ]; listen_ports = [ 51413 51414 ];
random_port = false; random_port = false;
enabled_plugins = [ "Label" "Extractor" ]; enabled_plugins = [ "Label" "Extractor" ];
@ -37,12 +37,9 @@ in {
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8112"; proxyPass = "http://127.0.0.1:8112";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "deluge";
client_id = "deluge";
client_secret = "AGa1U9S1zkaM3TJVxtyx4Er76DBk1APR";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -1,10 +1,10 @@
{ {
# virtualisation.docker = { virtualisation.docker = {
# enable = true; enable = true;
# extraOptions = '' extraOptions = ''
# --dns 127.0.0.1 --dns 10.0.0.250 --data-root /docker --dns 127.0.0.1 --dns 10.0.0.250 --data-root /docker
# ''; '';
# enableOnBoot = false; enableOnBoot = false;
# }; };
users.users.giulio.extraGroups = [ "docker" ]; users.users.giulio.extraGroups = [ "docker" ];
} }

View File

@ -18,7 +18,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:3000"; proxyPass = "http://127.0.0.1:3000";
extraConfig = '' extraConfig = ''
allow 127.0.0.1; allow 127.0.0.1;
allow 10.0.0.0/24; allow 10.0.0.0/24;

View File

@ -1,50 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "zpool/nixos/root";
fsType = "zfs";
};
fileSystems."/home" = {
device = "zpool/data/home";
fsType = "zfs";
};
fileSystems."/media" = {
device = "datapool/media";
fsType = "zfs";
};
fileSystems."/secrets" = {
device = "backedpool/secrets";
fsType = "zfs";
};
fileSystems."/var/lib" = {
device = "backedpool/services";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/AF19-5616";
fsType = "vfat";
};
# swapDevices = [{
# device = "/dev/sdc1";
# size = 10000;
# }];
}

View File

@ -1,19 +1,21 @@
{ lib, ... }: { lib, pkgs, ... }:
let let
domain = "tube.giugl.io"; domain = "tube.giugl.io";
network = import ./network.nix; network = import ./network.nix;
in { in
{
services = { services = {
invidious = { invidious = {
enable = true; enable = true;
port = 9092; port = 9092;
package = pkgs.unstable.invidious;
}; };
nginx.virtualHosts.${domain} = { nginx.virtualHosts.${domain} = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { proxyPass = "http://localhost:9092"; }; locations."/" = { proxyPass = "http://127.0.0.1:9092"; };
}; };
}; };

View File

@ -25,7 +25,7 @@ in {
''; '';
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8096"; proxyPass = "http://127.0.0.1:8096";
# extraConfig = '' # extraConfig = ''
# allow 10.0.0.0/24; # allow 10.0.0.0/24;
# allow 10.3.0.0/24; # allow 10.3.0.0/24;
@ -34,7 +34,7 @@ in {
}; };
locations."/socket" = { locations."/socket" = {
proxyPass = "http://localhost:8096"; proxyPass = "http://127.0.0.1:8096";
proxyWebsockets = true; proxyWebsockets = true;
# extraConfig = '' # extraConfig = ''
# allow 10.0.0.0/24; # allow 10.0.0.0/24;

View File

@ -3,7 +3,8 @@
let let
domain = "reddit.giugl.io"; domain = "reddit.giugl.io";
network = import ./network.nix; network = import ./network.nix;
in { in
{
services = { services = {
libreddit = { libreddit = {
enable = true; enable = true;
@ -13,7 +14,7 @@ in {
nginx.virtualHosts.${domain} = { nginx.virtualHosts.${domain} = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { proxyPass = "http://localhost:9090"; }; locations."/" = { proxyPass = "http://127.0.0.1:9090"; };
}; };
}; };

View File

@ -3,7 +3,7 @@
let let
domain = "htlid.giugl.io"; domain = "htlid.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in {
services = { services = {
lidarr = { lidarr = {
@ -15,12 +15,9 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8686"; proxyPass = "http://127.0.0.1:8686";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "lidarr";
client_id = "lidarr";
client_secret = "7s4dd1SEi84F4fUFsqRaQmSSucZhyTco";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -25,7 +25,7 @@ in {
]; ];
listeners = [{ listeners = [{
port = 8008; port = 8008;
bind_addresses = [ "::1" ]; bind_addresses = [ "127.0.0.1" ];
type = "http"; type = "http";
tls = false; tls = false;
x_forwarded = true; x_forwarded = true;
@ -86,7 +86,7 @@ in {
# forward all Matrix API calls to the synapse Matrix homeserver # forward all Matrix API calls to the synapse Matrix homeserver
locations."/_matrix" = { locations."/_matrix" = {
proxyPass = "http://[::1]:8008"; # without a trailing / proxyPass = "http://127.0.0.1:8008"; # without a trailing /
}; };
}; };

View File

@ -11,7 +11,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:9000"; proxyPass = "http://127.0.0.1:9000";
extraConfig = '' extraConfig = ''
allow 10.0.0.0/24; allow 10.0.0.0/24;
${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg} ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg}

View File

@ -26,7 +26,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:4533"; proxyPass = "http://127.0.0.1:4533";
# extraConfig = '' # extraConfig = ''
# allow 10.0.0.0/24; # allow 10.0.0.0/24;
# ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg} # ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg}

View File

@ -23,7 +23,7 @@ in {
enable = true; enable = true;
hostName = domain; hostName = domain;
https = true; https = true;
package = pkgs.unstable.nextcloud24; package = pkgs.unstable.nextcloud25;
caching = { caching = {
redis = true; redis = true;

View File

@ -7,6 +7,7 @@ in {
services = { services = {
nitter = { nitter = {
enable = true; enable = true;
redisCreateLocally = false;
server = { server = {
port = 9093; port = 9093;
hostname = domain; hostname = domain;
@ -21,7 +22,7 @@ in {
nginx.virtualHosts.${domain} = { nginx.virtualHosts.${domain} = {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { proxyPass = "http://localhost:9093"; }; locations."/" = { proxyPass = "http://127.0.0.1:9093"; };
}; };
}; };

View File

@ -3,7 +3,7 @@
let let
domain = "htnzb.giugl.io"; domain = "htnzb.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in {
services = { services = {
nzbget = { nzbget = {
@ -15,12 +15,9 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:6789"; proxyPass = "http://127.0.0.1:6789";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "nzbget";
client_id = "nzbget";
client_secret = "tkjzdqnUoWTlGUYah5tgMqVPFMlOUvk9";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -2,12 +2,12 @@
{ {
openresty_oidc_block = openresty_oidc_block =
{ realm, client_id, client_secret, redirect_uri, access_role ? "" }: '' { access_role ? "" }: ''
access_by_lua_block { access_by_lua_block {
local opts = { local opts = {
discovery = "https://auth.giugl.io/realms/${realm}/.well-known/openid-configuration", discovery = "https://auth.giugl.io/realms/master/.well-known/openid-configuration",
client_id = "${client_id}", client_id = "nginx",
client_secret = "${client_secret}", client_secret = "9C6BYxPhTbrRS4DIwd3Smk7e11ABmnt8",
logout_path = "/logout", logout_path = "/logout",
redirect_after_logout_uri = "/", redirect_after_logout_uri = "/",
redirect_uri = "/redirect_uri", redirect_uri = "/redirect_uri",

View File

@ -77,7 +77,7 @@ in {
proxy_redirect off; proxy_redirect off;
proxy_buffering off; proxy_buffering off;
''; '';
locations."/" = { proxyPass = "http://localhost:32400"; }; locations."/" = { proxyPass = "http://127.0.0.1:32400"; };
}; };
}; };

View File

@ -11,7 +11,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:9696"; proxyPass = "http://127.0.0.1:9696";
extraConfig = '' extraConfig = ''
allow 10.0.0.0/24; allow 10.0.0.0/24;
${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg} ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg}

View File

@ -3,7 +3,7 @@
let let
domain = "htrad.giugl.io"; domain = "htrad.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in {
services = { services = {
radarr = { radarr = {
@ -15,12 +15,9 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:7878"; proxyPass = "http://127.0.0.1:7878";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "radarr";
client_id = "radarr";
client_secret = "DCoeN4PwqGrAoG6Mqw73orrUjojJ1fmn";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -3,7 +3,7 @@
let let
domain = "htson.giugl.io"; domain = "htson.giugl.io";
network = import ./network.nix; network = import ./network.nix;
auth_block = (import ./openid.nix).openresty_oidc_block; auth_block = (import ./openid.nix { inherit lib; }).openresty_oidc_block;
in { in {
services = { services = {
sonarr = { sonarr = {
@ -15,12 +15,9 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:8989"; proxyPass = "http://127.0.0.1:8989";
extraConfig = auth_block { extraConfig = auth_block {
realm = "master"; access_role = "sonarr";
client_id = "sonarr";
client_secret = "d36ehMSPCI3xLfOGNcnSUKZWQblyGumi";
redirect_uri = "https://${domain}";
}; };
}; };
}; };

View File

@ -24,7 +24,7 @@ in {
forceSSL = true; forceSSL = true;
enableACME = true; enableACME = true;
locations."/" = { locations."/" = {
proxyPass = "http://localhost:9091"; proxyPass = "http://127.0.0.1:9091";
extraConfig = '' extraConfig = ''
allow 10.0.0.0/24; allow 10.0.0.0/24;
${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg} ${lib.concatMapStrings (x: "allow ${x};") network.gdevices-wg}