mirror of
https://github.com/srid/nixos-config.git
synced 2026-05-11 17:36:07 +08:00
* Enable incus on pureintent, rename lxd.nix, drop unused flake-parts - Add incus module import to pureintent and bind the UI to its Tailscale IP (no firewall change needed since tailscale0 is trusted). - Rename modules/nixos/linux/lxd.nix -> incus.nix since the module configures virtualisation.incus, and enable the bundled web UI. - Drop the unused modules/flake-parts/incus-image helper; the `images:nixos/*` community images cover container/VM launches. * Move incus module into a directory with a README The troubleshooting notes used to live as comments in the module; they belong in docs alongside a quick-start on launching containers/VMs and configuring the UI listener. * Expand incus README with VM gotchas Document the sharp edges hit while bringing up a NixOS VM for the first time: secureboot, memory/cpu/disk limits (with the error signatures that point at each), configuring the guest (flakes, firewall), and a three-step guide to exposing a service from inside.
55 lines
1 KiB
Nix
55 lines
1 KiB
Nix
# See ./README.md for usage and troubleshooting.
|
|
{ flake, ... }:
|
|
let
|
|
networkName = "incusbr0";
|
|
|
|
preseedConfig = {
|
|
networks = [
|
|
{
|
|
name = networkName;
|
|
type = "bridge";
|
|
}
|
|
];
|
|
profiles = [
|
|
{
|
|
name = "default";
|
|
devices = {
|
|
eth0 = {
|
|
name = "eth0";
|
|
network = networkName;
|
|
type = "nic";
|
|
};
|
|
root = {
|
|
path = "/";
|
|
pool = "default";
|
|
type = "disk";
|
|
};
|
|
};
|
|
}
|
|
];
|
|
storage_pools = [
|
|
{
|
|
name = "default";
|
|
driver = "dir";
|
|
config = {
|
|
source = "/var/lib/incus/storage-pools/default";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
in
|
|
{
|
|
virtualisation.incus = {
|
|
enable = true;
|
|
ui.enable = true;
|
|
preseed = preseedConfig;
|
|
};
|
|
|
|
users.users.${flake.config.me.username} = {
|
|
extraGroups = [ "incus" "incus-admin" ];
|
|
};
|
|
|
|
networking.nftables.enable = true;
|
|
|
|
networking.firewall.trustedInterfaces = [ networkName ];
|
|
}
|