diff --git a/hosts/hl-terra1.hardware-configuration.nix b/hosts/hl-terra1.hardware-configuration.nix index b81f15a..2a084d9 100644 --- a/hosts/hl-terra1.hardware-configuration.nix +++ b/hosts/hl-terra1.hardware-configuration.nix @@ -1,6 +1,3 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: let kernel = config.boot.kernelPackages.kernel; @@ -60,7 +57,11 @@ in fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; - + fileSystems."/mnt/Data" = + { + device = "/dev/sda1"; + fsType = "btrfs"; + }; swapDevices = [ ]; networking.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; diff --git a/hosts/hl-terra1.nix b/hosts/hl-terra1.nix index 59d71a3..c28fe3d 100644 --- a/hosts/hl-terra1.nix +++ b/hosts/hl-terra1.nix @@ -1,5 +1,18 @@ { user }: { pkgs, lib, config, ... }: +let + openPorts = [ + # nfs + 111 + 2049 + 4000 + 4001 + 4002 + 20048 + # ssh + 22 + ]; +in { imports = [ ./hl-terra1.hardware-configuration.nix ]; skyg.user.enabled = true; @@ -9,5 +22,22 @@ # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + environment.systemPackages = with pkgs; [ + btrfs-progs + ]; + # Firewall + networking.firewall.allowedUDPPorts = openPorts; + networking.firewall.allowedTCPPorts = openPorts; + # NFS + services.nfs.server = { + enable = true; + lockdPort = 4001; + mountdPort = 4002; + statdPort = 4000; + extraNfsdConfig = ''''; + exports = '' + /mnt/Data/apps 10.0.0.0/16(rw,wdelay,insecure,no_root_squash,no_subtree_check,sec=sys,rw,insecure,no_root_squash,no_all_squash) + ''; + }; } diff --git a/modules/network-drives.nix b/modules/network-drives.nix index 9cc4fdb..d149ba3 100644 --- a/modules/network-drives.nix +++ b/modules/network-drives.nix @@ -31,5 +31,11 @@ in fsType = "nfs"; options = [ "x-systemd.automount" "noauto" ]; }; + + fileSystems."/mnt/terra1/Data/apps" = { + device = "terra1.lab.internal:/mnt/Data/apps"; + fsType = "nfs"; + options = [ "x-systemd.automount" "noauto" ]; + }; }; }