dotfiles/hosts/soryu/ai.nix

41 lines
891 B
Nix
Raw Permalink Normal View History

2024-08-17 03:58:06 +02:00
{ config, lib, pkgs, ... }:
{
systemd.nspawn.ubuntu-ai = {
execConfig = {
Boot = true;
};
networkConfig = {
Private = false;
};
filesConfig = {
BindReadOnly = [
"/etc/resolv.conf:/etc/resolv.conf"
];
Bind = [
"/dev/dri:/dev/dri"
"/dev/kfd:/dev/kfd"
2024-10-11 04:22:36 +02:00
"/mnt/human/llama:/llama:idmap"
"/mnt/human/sd:/sd:idmap"
2024-08-17 03:58:06 +02:00
];
};
};
systemd.services."systemd-nspawn@ubuntu-ai" = {
environment = {
SYSTEMD_NSPAWN_TMPFS_TMP = "0";
};
serviceConfig = {
CPUQuota = "300%";
2024-10-11 04:22:36 +02:00
MemoryHigh = "29G";
MemoryMax = "30G";
2024-08-17 03:58:06 +02:00
MemorySwapMax = "25G";
ExecStart = "systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i -D /mnt/human/machines/ubuntu-ai";
};
# overrideStrategy = "asDropin";
};
}