Update homserver config
This commit is contained in:
parent
26694e1e52
commit
eafad2af57
5 changed files with 72 additions and 7 deletions
13
packages/nginx/homeserver.nix
Normal file
13
packages/nginx/homeserver.nix
Normal 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 ];
|
||||
}
|
18
packages/syncthing/homeserver.nix
Normal file
18
packages/syncthing/homeserver.nix
Normal 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 ];
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -7,20 +7,30 @@
|
|||
./persist/homeserver.nix
|
||||
../sets/meta/sysadmin.nix
|
||||
../packages/vim/package.nix
|
||||
../packages/nginx/homeserver.nix
|
||||
../packages/syncthing/homeserver.nix
|
||||
];
|
||||
|
||||
boot.loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
boot = {
|
||||
loader = {
|
||||
efi = {
|
||||
canTouchEfiVariables = true;
|
||||
};
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
};
|
||||
};
|
||||
grub = {
|
||||
enable = true;
|
||||
efiSupport = true;
|
||||
device = "nodev";
|
||||
|
||||
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
8
users/media.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
users.users.media = {
|
||||
isNormalUser = true;
|
||||
description = "media";
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue