nixos-config/config/host-config/nostromo.nix
2021-10-19 10:04:35 -07:00

81 lines
2.0 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let hostname = "nostromo";
in {
networking = {
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;
intif0 = { useDHCP = true; };
};
};
# Hopefully this'll help with NFS...
boot.kernelModules = [ "rpcsec_gss_krb5" ];
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 = {
"/export/documents" = {
options = [ "subvol=@documents" ];
group = "sea-documents";
users = [ "niten" ];
};
"/export/downloads" = {
options = [ "subvol=@downloads" ];
group = "sea-downloads";
users = [ "niten" ];
};
};
};
services.nfs = {
# See lib/fudo/users.nix for the user@REALM -> user mapping
server = {
enable = true;
createMountPoints = false;
exports = let
exportList = [
"/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)"
];
in ''
${concatStringsSep "\n" exportList}
'';
};
};
systemd.services.nfs-server = {
# Don't start on boot
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";
};
};
}