Added nfs exports to terra1

This commit is contained in:
ari committed 2024-08-20 17:09:31 -04:00
1 parent 0601780ab8
commit 9bb704fd0c
3 files changed
+41 -4

No files matched your search

+5 -4
View File
@@ -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";
+30
View File
@@ -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)
'';
};
}
+6
View File
@@ -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" ];
};
};
}