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
|
||||
.aider*
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
# and in the NixOS manual (accessible by running 'nixos-help').
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
|
|
@ -34,7 +35,7 @@
|
|||
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
#nix.settings.trusted-users = [ "polen" "polensky" ];
|
||||
#nix.settings.extra-platforms = config.boot.binfmt.emulatedSystems;
|
||||
#boot.binfmt.emulatedSystems = ["aarch64-linux"];
|
||||
|
|
@ -42,6 +43,20 @@
|
|||
# Enable networking
|
||||
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.
|
||||
time.timeZone = "America/Toronto";
|
||||
|
||||
|
|
@ -85,11 +100,11 @@
|
|||
# Enable touchpad support (enabled default in most desktopManager).
|
||||
# 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 = {
|
||||
isNormalUser = true;
|
||||
description = "polensky";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
extraGroups = ["networkmanager" "wheel"];
|
||||
shell = pkgs.zsh;
|
||||
packages = with pkgs; [
|
||||
kdePackages.kate
|
||||
|
|
@ -143,21 +158,38 @@
|
|||
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.
|
||||
# services.openssh.enable = true;
|
||||
services.openssh.enable = true;
|
||||
|
||||
# Open ports in the firewall.
|
||||
# networking.firewall.allowedTCPPorts = [ ... ];
|
||||
# networking.firewall.allowedUDPPorts = [ ... ];
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
2049 # NFS
|
||||
111 # RPC
|
||||
20048 # NFS mountd
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [
|
||||
2049 # NFS
|
||||
111 # RPC
|
||||
20048 # NFS mountd
|
||||
5353 # mDNS
|
||||
];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# 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.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
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 = {
|
||||
hostName = "server";
|
||||
firewall.allowedTCPPorts = [
|
||||
|
|
@ -119,6 +146,9 @@ in {
|
|||
8989 # sonarr
|
||||
10222 # taskchampion-sync-server
|
||||
];
|
||||
firewall.allowedUDPPorts = [
|
||||
5353 # mDNS
|
||||
];
|
||||
};
|
||||
|
||||
time.timeZone = "America/Toronto";
|
||||
|
|
@ -136,6 +166,7 @@ in {
|
|||
wget
|
||||
xmrig
|
||||
tmux
|
||||
nfs-utils
|
||||
];
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue