2023-07-23 14:38:24 -07:00
|
|
|
{ config, pkgs, user, lib, ... }:
|
|
|
|
{
|
2023-10-07 02:04:31 -07:00
|
|
|
imports = [
|
2023-10-13 21:11:40 -07:00
|
|
|
../../modules
|
2023-10-07 02:04:31 -07:00
|
|
|
./wireguard-server.nix
|
2023-10-07 02:11:46 -07:00
|
|
|
./samba-server.nix
|
2023-10-13 21:11:40 -07:00
|
|
|
./syncthing.nix
|
2023-11-26 23:27:58 -08:00
|
|
|
./rss.nix
|
2023-12-03 11:59:29 -08:00
|
|
|
./home-assistant
|
2024-01-01 00:13:30 -08:00
|
|
|
./gitea.nix
|
2024-05-21 21:53:08 -07:00
|
|
|
./nextcloud.nix
|
2023-10-07 02:04:31 -07:00
|
|
|
];
|
|
|
|
|
2023-07-23 14:59:13 -07:00
|
|
|
# Use normal kernel
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages;
|
2023-07-23 14:38:24 -07:00
|
|
|
|
2023-07-25 15:23:07 -07:00
|
|
|
# Set kernel modules
|
|
|
|
boot.kernelModules = [ "sg" ];
|
|
|
|
|
2023-07-23 14:38:24 -07:00
|
|
|
# Set networking options
|
2023-07-23 14:59:13 -07:00
|
|
|
networking.hostName = "torus";
|
2023-10-07 02:00:29 -07:00
|
|
|
networking.firewall.enable = true;
|
2023-07-23 14:38:24 -07:00
|
|
|
networking.firewall.checkReversePath = "loose";
|
2023-10-07 02:00:29 -07:00
|
|
|
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
|
|
|
networking.firewall.allowedUDPPorts = [ 80 443 ];
|
2024-07-21 19:23:30 -07:00
|
|
|
networking.nameservers = [ "8.8.8.8" "8.8.4.4" ];
|
|
|
|
boot.kernel.sysctl = {
|
|
|
|
"net.ipv4.conf.all.forwarding" = true; # Needed for wireguard-server
|
|
|
|
};
|
2023-07-23 14:38:24 -07:00
|
|
|
|
|
|
|
# Enable virtualisation
|
2024-08-15 21:29:02 -07:00
|
|
|
virtualisation.docker = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.docker_27;
|
|
|
|
storageDriver = "btrfs";
|
|
|
|
enableNvidia = true;
|
|
|
|
};
|
2023-07-25 15:23:07 -07:00
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
|
2023-07-23 14:38:24 -07:00
|
|
|
environment.systemPackages = with pkgs; [
|
2024-04-21 10:37:47 -07:00
|
|
|
docker-compose # Tool for defining and running multi-container Docker applications.
|
|
|
|
python3 # Interpreted, high-level programming language known for its simplicity and versatility.
|
2023-07-23 14:38:24 -07:00
|
|
|
];
|
|
|
|
|
2023-09-02 17:47:18 -07:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "starrtyler88@gmail.com";
|
|
|
|
};
|
|
|
|
|
2024-07-21 19:23:30 -07:00
|
|
|
# Nginx
|
2023-09-12 22:20:31 -07:00
|
|
|
security.pam.services.nginx.setEnvironment = false;
|
2024-07-21 19:23:30 -07:00
|
|
|
systemd.services.nginx.serviceConfig = { SupplementaryGroups = [ "shadow" ]; };
|
2023-09-02 17:47:18 -07:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
recommendedGzipSettings = true;
|
|
|
|
recommendedOptimisation = true;
|
|
|
|
recommendedProxySettings = true;
|
|
|
|
recommendedTlsSettings = true;
|
2023-09-12 22:20:31 -07:00
|
|
|
additionalModules = [ pkgs.nginxModules.pam ];
|
|
|
|
virtualHosts = let
|
|
|
|
SSL = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
}; in {
|
2023-11-05 00:43:29 -07:00
|
|
|
"rss.tstarr.us" = (SSL // {
|
2023-12-03 11:59:59 -08:00
|
|
|
locations."/".proxyPass = "http://localhost:8087/";
|
2023-11-26 23:27:58 -08:00
|
|
|
});
|
2023-09-12 22:20:31 -07:00
|
|
|
"media.tstarr.us" = (SSL // {
|
|
|
|
locations."/".proxyPass = "http://localhost:8096/";
|
|
|
|
});
|
2024-01-01 00:13:30 -08:00
|
|
|
"git.tstarr.us" = (SSL // {
|
|
|
|
locations."/".proxyPass = "http://localhost:3001/";
|
|
|
|
});
|
2024-05-04 16:17:59 -07:00
|
|
|
"workspace.tstarr.us" = (SSL // {
|
|
|
|
locations."/".proxyPass = "http://localhost:5000/";
|
|
|
|
});
|
2024-07-17 22:21:35 -07:00
|
|
|
"lc.tstarr.us" = (SSL // {
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:8065/";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
});
|
2024-05-04 16:17:59 -07:00
|
|
|
"code.tstarr.us" = (SSL // {
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:8443/";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
"plot.tstarr.us" = (SSL // {
|
|
|
|
locations."/".proxyPass = "http://localhost:8988/";
|
|
|
|
});
|
2023-09-12 22:20:31 -07:00
|
|
|
};
|
2023-09-02 17:47:18 -07:00
|
|
|
};
|
|
|
|
|
2024-07-21 19:23:30 -07:00
|
|
|
# Modules
|
2023-07-23 14:38:24 -07:00
|
|
|
modules = {
|
2023-09-12 22:18:09 -07:00
|
|
|
devel = {
|
|
|
|
tooling.enable = true;
|
|
|
|
};
|
2023-07-23 14:38:24 -07:00
|
|
|
services = {
|
2023-07-25 15:23:07 -07:00
|
|
|
jellyfin.enable = true;
|
2023-07-23 14:38:24 -07:00
|
|
|
};
|
2023-09-12 22:18:09 -07:00
|
|
|
system = {
|
|
|
|
terminal.enable = true;
|
|
|
|
ssh.enable = true;
|
2023-11-19 23:43:26 -08:00
|
|
|
secrets.enable = true;
|
2023-07-23 17:10:08 -07:00
|
|
|
};
|
2023-07-23 14:38:24 -07:00
|
|
|
};
|
2024-07-21 17:28:06 -07:00
|
|
|
|
|
|
|
home-manager.users.${user} = {
|
|
|
|
modules = {
|
|
|
|
desktop = {
|
|
|
|
kitty.enable = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-07-23 14:38:24 -07:00
|
|
|
}
|