drives helix and broot

This commit is contained in:
RootHost-Stormwind
2025-04-07 12:45:31 +02:00
parent 6e76f581c0
commit da0535eb09
8 changed files with 172 additions and 20 deletions

29
drives.nix Normal file
View File

@@ -0,0 +1,29 @@
{ ... }:
{
fileSystems = {
"/mnt/nethergarde/windblows" = {
device = "10.94.157.2:/mnt/Nethergarde/Windows";
fsType = "nfs";
};
"/mnt/nethergarde/bigdata" = {
device = "10.94.157.2:/mnt/Nethergarde/Bigdata";
fsType = "nfs";
};
"/mnt/nethergarde/nextcloud" = {
device = "10.94.157.2:/mnt/Nethergarde/New-Nextcloud";
fsType = "nfs";
};
"/" = {
device = "/dev/disk/by-uuid/f8ce741e-1a4d-469d-bc6c-0777c1c84423";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/802B-4F26";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
};
}

View File

@@ -10,20 +10,10 @@
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" "vfio_pci" ];
boot.kernelParams = [ "amd_iommu=on" "iommu=pt" "pci_acs_override=downstream,multifunction" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/f8ce741e-1a4d-469d-bc6c-0777c1c84423";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/802B-4F26";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = swapDevices =
[ { device = "/dev/disk/by-uuid/7e34cdc3-bd48-435a-8ea2-e1fe43926262"; } [ { device = "/dev/disk/by-uuid/7e34cdc3-bd48-435a-8ea2-e1fe43926262"; }
]; ];

View File

@@ -21,7 +21,8 @@ in
./sshd.nix ./sshd.nix
./tailscale.nix ./tailscale.nix
./incus.nix ./incus.nix
./auto-upgrade.nix ./drives.nix
#./auto-upgrade.nix
]; ];
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default

View File

@@ -3,7 +3,7 @@
{ {
networking = { networking = {
hostName = "Stormwind"; hostName = "Stormwind";
networkmanager.enable = true; networkmanager.enable = false;
nftables = { nftables = {
enable = true; enable = true;
@@ -11,31 +11,136 @@
table ip nat { table ip nat {
chain PREROUTING { chain PREROUTING {
type nat hook prerouting priority dstnat; policy accept; type nat hook prerouting priority dstnat; policy accept;
iifname "enp3s0" tcp dport 80 dnat to 10.94.157.229:80 iifname "enp3s0" tcp dport 80 dnat to 10.94.157.2:80
iifname "enp3s0" tcp dport 443 dnat to 10.94.157.229:443 iifname "enp3s0" tcp dport 443 dnat to 10.94.157.2:443
iifname "enp3s0" tcp dport 20 dnat to 10.94.157.2:20
iifname "enp3s0" tcp dport 21 dnat to 10.94.157.2:21
iifname "enp3s0" tcp dport 22 dnat to 10.94.157.2:22
iifname "enp3s0" tcp dport 990 dnat to 10.94.157.2:990
iifname "enp3s0" tcp dport 989 dnat to 10.94.157.2:989
iifname "enp3s0" tcp dport 445 dnat to 10.94.157.2:445
iifname "enp3s0" tcp dport 111 dnat to 10.94.157.2:111
iifname "enp3s0" udp dport 111 dnat to 10.94.157.2:111
iifname "enp3s0" tcp dport 2049 dnat to 10.94.157.2:2049
iifname "enp3s0" udp dport 2049 dnat to 10.94.157.2:2049
iifname "enp3s0" tcp dport 32765 dnat to 10.94.157.2:32765
iifname "enp3s0" udp dport 32765 dnat to 10.94.157.2:32765
iifname "enp3s0" tcp dport 32768 dnat to 10.94.157.2:32768
iifname "enp3s0" udp dport 32768 dnat to 10.94.157.2:32768
iifname "enp3s0" tcp dport 20048 dnat to 10.94.157.2:20048
iifname "enp3s0" udp dport 20048 dnat to 10.94.157.2:20048
} }
} }
''; '';
}; };
firewall = { firewall = {
allowedTCPPorts = [ 80 443 ]; allowedTCPPorts = [ 80 443 20 21 22 990 989 445 111 2049 32765 32768 20048 ];
allowedUDPPorts = [ 111 2049 20048 32765 32768 ];
}; };
nat = { nat = {
enable = true; enable = true;
internalInterfaces = [ "incusbr0" ]; internalInterfaces = [ "incusbr0" ];
externalInterface = "enp3s0"; externalInterface = "enp4s0";
forwardPorts = [ forwardPorts = [
{ {
sourcePort = 80; sourcePort = 80;
proto = "tcp"; proto = "tcp";
destination = "10.94.157.229:80"; destination = "10.94.157.2:80";
} }
{ {
sourcePort = 443; sourcePort = 443;
proto = "tcp"; proto = "tcp";
destination = "10.94.157.229:443"; destination = "10.94.157.2:443";
}
# FTP
{
sourcePort = 20;
proto = "tcp";
destination = "10.94.157.2:20";
}
{
sourcePort = 21;
proto = "tcp";
destination = "10.94.157.2:21";
}
{
sourcePort = 22;
proto = "tcp";
destination = "10.94.157.2:22";
}
{
sourcePort = 990;
proto = "tcp";
destination = "10.94.157.2:990";
}
{
sourcePort = 989;
proto = "tcp";
destination = "10.94.157.2:989";
}
{
sourcePort = 21;
proto = "tcp";
destination = "10.94.157.2:21";
}
# SMB
{
sourcePort = 445;
proto = "tcp";
destination = "10.94.157.2:445";
}
# NFS
{
sourcePort = 111;
proto = "tcp";
destination = "10.94.157.2:111";
}
{
sourcePort = 111;
proto = "udp";
destination = "10.94.157.2:111";
}
{
sourcePort = 2049;
proto = "tcp";
destination = "10.94.157.2:2049";
}
{
sourcePort = 2049;
proto = "udp";
destination = "10.94.157.2:2049";
}
{
sourcePort = 32765;
proto = "tcp";
destination = "10.94.157.2:32765";
}
{
sourcePort = 32765;
proto = "udp";
destination = "10.94.157.2:32765";
}
{
sourcePort = 32768;
proto = "tcp";
destination = "10.94.157.2:32768";
}
{
sourcePort = 32768;
proto = "udp";
destination = "10.94.157.2:32768";
}
{
sourcePort = 20048;
proto = "tcp";
destination = "10.94.157.2:20048";
}
{
sourcePort = 20048;
proto = "udp";
destination = "10.94.157.2:20048";
} }
]; ];
}; };

View File

@@ -13,6 +13,10 @@
hyfetch hyfetch
lvm2 lvm2
cryptsetup cryptsetup
pciutils
smartmontools
helix # Very bazed terminal editor
broot # Very bazed terminal file explorer
]; ];
} }

View File

@@ -3,6 +3,7 @@
{ {
services.openssh = { services.openssh = {
enable = true; enable = true;
ports = [ 2222 ];
settings = { settings = {
PasswordAuthentication = false; PasswordAuthentication = false;
}; };

View File

@@ -0,0 +1,21 @@
theme = "dark_plus"
[keys.normal]
"{" = ["goto_prev_paragraph", "collapse_selection"]
"}" = ["goto_next_paragraph", "collapse_selection"]
"…" = "repeat_last_motion" # Alt+.
"" = "split_selection_on_newline" # Alt+S
"ø" = "expand_selection" # Alt+O
"" = "shrink_selection" # Alt+I
"π" = "select_prev_sibling" # Alt+P
"µ" = "select_next_sibling" # Alt+M
"ç" = "copy_selection_on_prev_line"# Alt+C. Shift+C, but upwards
[keys.select]
"{" = ["goto_prev_paragraph", "collapse_selection"]
"}" = ["goto_next_paragraph", "collapse_selection"]
"ø" = "expand_selection" # Alt+O
"" = "shrink_selection" # Alt+I
"π" = "select_prev_sibling" # Alt+P
"µ" = "select_next_sibling" # Alt+M

View File

@@ -49,6 +49,7 @@
home.stateVersion = "24.11"; home.stateVersion = "24.11";
home.file = { home.file = {
".config/nvim/init.vim".source = dotfiles/neovim/init.vim; ".config/nvim/init.vim".source = dotfiles/neovim/init.vim;
".config/helix/config.toml".source = dotfiles/helix.toml;
}; };
}; };
} }