toure/server setup enhance
This commit is contained in:
parent
fa7b157c5d
commit
81b8dceeae
3 changed files with 107 additions and 43 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
result
|
result
|
||||||
|
.aider*
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
# Edit this configuration file to define what should be installed on
|
# Edit this configuration file to define what should be installed on
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running 'nixos-help').
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
config,
|
||||||
[ # Include the results of the hardware scan.
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
imports = [
|
||||||
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -42,6 +43,20 @@
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
# Enable mDNS for .local hostname resolution
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
publish = {
|
||||||
|
enable = true;
|
||||||
|
addresses = true;
|
||||||
|
domain = true;
|
||||||
|
hinfo = true;
|
||||||
|
userServices = true;
|
||||||
|
workstation = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# Set your time zone.
|
# Set your time zone.
|
||||||
time.timeZone = "America/Toronto";
|
time.timeZone = "America/Toronto";
|
||||||
|
|
||||||
|
|
@ -85,7 +100,7 @@
|
||||||
# Enable touchpad support (enabled default in most desktopManager).
|
# Enable touchpad support (enabled default in most desktopManager).
|
||||||
# services.xserver.libinput.enable = true;
|
# services.xserver.libinput.enable = true;
|
||||||
|
|
||||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
# Define a user account. Don't forget to set a password with 'passwd'.
|
||||||
users.users.polensky = {
|
users.users.polensky = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "polensky";
|
description = "polensky";
|
||||||
|
|
@ -143,21 +158,38 @@
|
||||||
user = "polensky";
|
user = "polensky";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# NFS Server - Export storage to other machines
|
||||||
|
services.nfs.server = {
|
||||||
|
enable = true;
|
||||||
|
exports = ''
|
||||||
|
/data 192.168.1.0/24(rw,sync,no_subtree_check,fsid=0)
|
||||||
|
/data1 192.168.1.0/24(rw,sync,no_subtree_check,fsid=1)
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
# services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
# Open ports in the firewall.
|
# Open ports in the firewall.
|
||||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
networking.firewall.allowedTCPPorts = [
|
||||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
2049 # NFS
|
||||||
|
111 # RPC
|
||||||
|
20048 # NFS mountd
|
||||||
|
];
|
||||||
|
networking.firewall.allowedUDPPorts = [
|
||||||
|
2049 # NFS
|
||||||
|
111 # RPC
|
||||||
|
20048 # NFS mountd
|
||||||
|
5353 # mDNS
|
||||||
|
];
|
||||||
# Or disable the firewall altogether.
|
# Or disable the firewall altogether.
|
||||||
# networking.firewall.enable = false;
|
# networking.firewall.enable = false;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It's perfectly fine and recommended to leave
|
||||||
# this value at the release version of the first install of this system.
|
# this value at the release version of the first install of this system.
|
||||||
# Before changing this value read the documentation for this option
|
# Before changing this value read the documentation for this option
|
||||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
system.stateVersion = "24.05"; # Did you read the comment?
|
system.stateVersion = "24.05"; # Did you read the comment?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,33 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable mDNS for .local hostname resolution
|
||||||
|
services.avahi = {
|
||||||
|
enable = true;
|
||||||
|
nssmdns4 = true;
|
||||||
|
publish = {
|
||||||
|
enable = true;
|
||||||
|
addresses = true;
|
||||||
|
domain = true;
|
||||||
|
hinfo = true;
|
||||||
|
userServices = true;
|
||||||
|
workstation = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# NFS Client - Mount storage from latoure
|
||||||
|
fileSystems."/mnt/latoure-data" = {
|
||||||
|
device = "latoure.local:/data";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/mnt/latoure-data1" = {
|
||||||
|
device = "latoure.local:/data1";
|
||||||
|
fsType = "nfs";
|
||||||
|
options = [ "x-systemd.automount" "noauto" "x-systemd.idle-timeout=600" ];
|
||||||
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "server";
|
hostName = "server";
|
||||||
firewall.allowedTCPPorts = [
|
firewall.allowedTCPPorts = [
|
||||||
|
|
@ -119,6 +146,9 @@ in {
|
||||||
8989 # sonarr
|
8989 # sonarr
|
||||||
10222 # taskchampion-sync-server
|
10222 # taskchampion-sync-server
|
||||||
];
|
];
|
||||||
|
firewall.allowedUDPPorts = [
|
||||||
|
5353 # mDNS
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
time.timeZone = "America/Toronto";
|
time.timeZone = "America/Toronto";
|
||||||
|
|
@ -136,6 +166,7 @@ in {
|
||||||
wget
|
wget
|
||||||
xmrig
|
xmrig
|
||||||
tmux
|
tmux
|
||||||
|
nfs-utils
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue