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"; fsType = "zfs";
}; };
fileSystems."/mnt/mass" = {
device = "/dev/disk/by-uuid/f04baac4-40a9-4115-b09d-83b252ee69ad";
fsType = "xfs";
};
swapDevices = [ ]; swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View file

@ -7,20 +7,30 @@
./persist/homeserver.nix ./persist/homeserver.nix
../sets/meta/sysadmin.nix ../sets/meta/sysadmin.nix
../packages/vim/package.nix ../packages/vim/package.nix
../packages/nginx/homeserver.nix
../packages/syncthing/homeserver.nix
]; ];
boot.loader = { boot = {
efi = { loader = {
canTouchEfiVariables = true; efi = {
canTouchEfiVariables = true;
};
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
}; };
grub = {
enable = true; kernel = {
efiSupport = true; sysctl."net.ipv6.conf.eth0.disable_ipv6" = true;
device = "nodev";
}; };
}; };
networking = { networking = {
hostName = "homeserver";
enableIPv6 = false;
hostId = "95f846dc"; hostId = "95f846dc";
interfaces = { interfaces = {
eno1.ipv4.addresses = [{ eno1.ipv4.addresses = [{
@ -34,5 +44,16 @@
console = { console = {
keyMap = "uk"; 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";
};
}