2024-03-12 22:14:08 -04:00
|
|
|
# Custom desktop with AMD Ryzen 5 2600, 16GB RAM, AMD Rx 6700, and 1TB SSD + 2TB HDD.
|
2024-03-03 21:42:59 -05:00
|
|
|
{
|
2024-04-07 22:16:33 -04:00
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
2024-04-22 20:34:02 -04:00
|
|
|
}: let
|
|
|
|
email = "alyraffauf@gmail.com";
|
|
|
|
hostName = "mauville";
|
|
|
|
domain = "raffauflabs.com";
|
|
|
|
mediaDirectory = "/mnt/Media";
|
|
|
|
archiveDirectory = "/mnt/Archive";
|
|
|
|
in {
|
2024-04-07 22:16:33 -04:00
|
|
|
imports = [./hardware-configuration.nix ./home.nix];
|
2024-03-03 21:42:59 -05:00
|
|
|
|
|
|
|
# Bootloader.
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
networking.hostName = hostName; # Define your hostname.
|
2024-03-06 23:56:27 -05:00
|
|
|
|
2024-04-18 14:21:33 -04:00
|
|
|
alyraffauf = {
|
2024-04-22 20:18:47 -04:00
|
|
|
apps = {
|
|
|
|
steam.enable = true;
|
|
|
|
podman.enable = true;
|
|
|
|
virt-manager.enable = true;
|
|
|
|
};
|
|
|
|
containers = {
|
|
|
|
nixos = {
|
|
|
|
navidrome.enable = true;
|
|
|
|
};
|
|
|
|
oci = {
|
|
|
|
audiobookshelf.enable = true;
|
|
|
|
freshRSS.enable = true;
|
|
|
|
jellyfin.enable = true;
|
|
|
|
plexMediaServer.enable = true;
|
|
|
|
transmission.enable = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
desktop = {
|
|
|
|
enable = true;
|
|
|
|
hyprland.enable = true;
|
|
|
|
};
|
|
|
|
user = {
|
|
|
|
aly.enable = true;
|
|
|
|
dustin.enable = true;
|
|
|
|
};
|
|
|
|
services = {
|
|
|
|
binaryCache.enable = true;
|
|
|
|
};
|
2024-04-18 14:21:33 -04:00
|
|
|
system = {
|
|
|
|
plymouth.enable = true;
|
|
|
|
zramSwap = {
|
|
|
|
enable = true;
|
|
|
|
size = 100;
|
|
|
|
};
|
|
|
|
};
|
2024-04-22 20:18:47 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
networking = {
|
2024-04-22 21:49:08 -04:00
|
|
|
firewall = let
|
|
|
|
transmissionPort = config.alyraffauf.containers.oci.transmission.port;
|
|
|
|
bitTorrentPort = config.alyraffauf.containers.oci.transmission.bitTorrentPort;
|
|
|
|
in {
|
|
|
|
allowedTCPPorts = [80 443 transmissionPort bitTorrentPort];
|
|
|
|
allowedUDPPorts = [bitTorrentPort];
|
2024-04-18 14:21:33 -04:00
|
|
|
};
|
2024-04-22 20:18:47 -04:00
|
|
|
# My router doesn't expose settings for NAT loopback
|
|
|
|
# So we have to use this workaround.
|
|
|
|
extraHosts = ''
|
2024-04-22 20:34:02 -04:00
|
|
|
127.0.0.1 music.${domain}
|
|
|
|
127.0.0.1 nixcache.${domain}
|
|
|
|
127.0.0.1 plex.${domain}
|
|
|
|
127.0.0.1 podcasts.${domain}
|
|
|
|
127.0.0.1 news.${domain}
|
2024-04-22 20:18:47 -04:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
2024-04-22 20:34:02 -04:00
|
|
|
defaults.email = email;
|
2024-04-22 20:18:47 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
nginx = {
|
2024-03-30 21:14:13 -04:00
|
|
|
enable = true;
|
2024-04-22 20:18:47 -04:00
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
virtualHosts."music.${domain}" = {
|
2024-04-22 20:18:47 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:4533";
|
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
virtualHosts."news.${domain}" = {
|
2024-04-22 20:18:47 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
2024-04-22 21:49:08 -04:00
|
|
|
proxyPass = "http://127.0.0.1:${toString config.alyraffauf.containers.oci.freshRSS.port}";
|
2024-04-22 20:18:47 -04:00
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
proxy_redirect off;
|
|
|
|
# Forward the Authorization header for the Google Reader API.
|
|
|
|
proxy_set_header Authorization $http_authorization;
|
|
|
|
proxy_pass_header Authorization;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
virtualHosts."nixcache.${domain}" = {
|
2024-04-22 20:18:47 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/".proxyPass = "http://${config.services.nix-serve.bindAddress}:${
|
|
|
|
toString config.services.nix-serve.port
|
|
|
|
}";
|
|
|
|
};
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
virtualHosts."plex.${domain}" = {
|
2024-04-22 20:18:47 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
2024-04-22 21:49:08 -04:00
|
|
|
proxyPass = "http://127.0.0.1:${toString config.alyraffauf.containers.oci.plexMediaServer.port}";
|
2024-04-22 20:18:47 -04:00
|
|
|
proxyWebsockets = true; # needed if you need to use WebSocket
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-04-22 20:34:02 -04:00
|
|
|
virtualHosts."podcasts.${domain}" = {
|
2024-04-22 20:18:47 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
2024-04-22 21:49:08 -04:00
|
|
|
proxyPass = "http://127.0.0.1:${toString config.alyraffauf.containers.oci.audiobookshelf.port}";
|
2024-04-22 20:18:47 -04:00
|
|
|
# proxyWebsockets = true; # This breaks audiobookshelf.
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_redirect http:// https://;
|
|
|
|
proxy_buffering off;
|
|
|
|
client_max_body_size 500M;
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
2024-04-18 14:21:33 -04:00
|
|
|
};
|
2024-04-22 20:18:47 -04:00
|
|
|
samba = {
|
|
|
|
enable = true;
|
|
|
|
securityType = "user";
|
|
|
|
openFirewall = true;
|
|
|
|
shares = {
|
|
|
|
Media = {
|
2024-04-22 20:34:02 -04:00
|
|
|
comment = "Media @ ${hostName}";
|
|
|
|
path = mediaDirectory;
|
2024-04-22 20:18:47 -04:00
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "yes";
|
|
|
|
"create mask" = "0755";
|
|
|
|
"directory mask" = "0755";
|
|
|
|
};
|
|
|
|
Archive = {
|
2024-04-22 20:34:02 -04:00
|
|
|
comment = "Archive @ ${hostName}";
|
|
|
|
path = archiveDirectory;
|
2024-04-22 20:18:47 -04:00
|
|
|
browseable = "yes";
|
|
|
|
"read only" = "no";
|
|
|
|
"guest ok" = "yes";
|
|
|
|
"create mask" = "0755";
|
|
|
|
"directory mask" = "0755";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
samba-wsdd = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
2024-03-30 21:14:13 -04:00
|
|
|
};
|
2024-03-28 16:36:10 -04:00
|
|
|
};
|
|
|
|
|
2024-03-16 13:23:59 -04:00
|
|
|
system.stateVersion = "23.11";
|
2024-03-03 21:42:59 -05:00
|
|
|
}
|