81 lines
2.0 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, ... }:
2021-04-21 10:50:09 -07:00
with lib;
let hostname = "nostromo";
in {
networking = {
2021-04-21 10:55:09 -07:00
interfaces = {
eno1.useDHCP = false;
eno2.useDHCP = false;
eno3.useDHCP = false;
eno4.useDHCP = false;
enp33s0f0.useDHCP = false;
enp33s0f1.useDHCP = false;
enp9s0f0.useDHCP = false;
enp9s0f1.useDHCP = false;
2021-04-21 10:55:09 -07:00
intif0 = { useDHCP = true; };
};
};
2021-10-18 21:55:24 -07:00
# Hopefully this'll help with NFS...
boot.kernelModules = [ "rpcsec_gss_krb5" ];
2021-10-17 23:12:49 -07:00
fudo.hosts.nostromo.encrypted-filesystems.sea-store = {
encrypted-device = "/dev/nostromo-store/locked";
key-path = "/run/keys/sea-store";
filesystem-type = "btrfs";
options = [ "noatime" "nodiratime" "compress=zstd" "noexec" ];
mountpoints = {
2021-10-17 23:33:07 -07:00
"/export/documents" = {
2021-10-17 23:12:49 -07:00
options = [ "subvol=@documents" ];
2021-10-18 21:55:24 -07:00
group = "sea-documents";
users = [ "niten" ];
};
"/export/downloads" = {
options = [ "subvol=@downloads" ];
group = "sea-downloads";
users = [ "niten" ];
2021-10-17 23:12:49 -07:00
};
};
};
2021-10-18 21:55:24 -07:00
services.nfs = {
# See lib/fudo/users.nix for the user@REALM -> user mapping
server = {
enable = true;
createMountPoints = false;
exports = let
exportList = [
2021-10-19 10:04:35 -07:00
"/export/documents 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check,fsid=10,sec=krb5p)"
"/export/downloads 10.0.0.0/24(rw,sync,no_root_squash,no_subtree_check,fsid=11,sec=krb5i)"
2021-10-18 21:55:24 -07:00
];
in ''
${concatStringsSep "\n" exportList}
'';
};
};
systemd.services.nfs-server = {
2021-10-19 10:04:35 -07:00
# Don't start on boot
2021-10-18 21:55:24 -07:00
wantedBy = mkForce [ "sea-store.target" ];
# Only start after filesystem mounts are available
after = [ "export-documents.mount" "export-downloads.mount" ];
};
fudo.ipfs = {
enable = true;
users = [ "niten" ];
api-address = "/ip4/0.0.0.0/tcp/5001";
};
virtualisation = {
libvirtd = {
enable = true;
qemuPackage = pkgs.qemu_kvm;
onShutdown = "shutdown";
};
};
}