1
Fork 0

Update homserver config

This commit is contained in:
caem 2023-06-25 12:21:00 +02:00
parent 26694e1e52
commit eafad2af57
5 changed files with 72 additions and 7 deletions

View file

@ -0,0 +1,13 @@
{ ... }:
{
services.nginx.enable = true;
services.nginx.virtualHosts."192.168.2.69" = {
root = "/mnt/mass/Torrents";
extraConfig = ''
autoindex on;
'';
};
networking.firewall.allowedTCPPorts = [ 80 ];
}

View file

@ -0,0 +1,18 @@
{ ... }:
{
imports = [
../../users/media.nix
];
services.syncthing = {
enable = true;
user = "media";
dataDir = "/mnt/mass";
configDir = "/mnt/mass/Services/Syncthing";
guiAddress = "0.0.0.0:8384";
};
networking.firewall.allowedTCPPorts = [ 8384 22000 ];
networking.firewall.allowedUDPPorts = [ 22000 21027 ];
}

View file

@ -29,6 +29,11 @@
fsType = "zfs";
};
fileSystems."/mnt/mass" = {
device = "/dev/disk/by-uuid/f04baac4-40a9-4115-b09d-83b252ee69ad";
fsType = "xfs";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -7,9 +7,12 @@
./persist/homeserver.nix
../sets/meta/sysadmin.nix
../packages/vim/package.nix
../packages/nginx/homeserver.nix
../packages/syncthing/homeserver.nix
];
boot.loader = {
boot = {
loader = {
efi = {
canTouchEfiVariables = true;
};
@ -20,7 +23,14 @@
};
};
kernel = {
sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
};
};
networking = {
hostName = "homeserver";
enableIPv6 = false;
hostId = "95f846dc";
interfaces = {
eno1.ipv4.addresses = [{
@ -34,5 +44,16 @@
console = {
keyMap = "uk";
nameservers = [ "1.1.1.1" "8.8.8.8" ];
defaultGateway = "192.168.2.1";
firewall = {
enable = true;
allowedTCPPorts = [ 22 ];
};
};
# To not mess up SSH sessions from weird terminals
environment.sessionVariables = rec {
TERM = "xterm";
};
}

8
users/media.nix Normal file
View file

@ -0,0 +1,8 @@
{ ... }:
{
users.users.media = {
isNormalUser = true;
description = "media";
};
}