switch to incus

This commit is contained in:
Sam 2024-06-30 12:25:44 +01:00
parent 6d41b7dea9
commit 9f593876ab
4 changed files with 14 additions and 33 deletions

View File

@ -1,18 +1,13 @@
{ pkgs, ... }:
{ {
imports = [ imports = [
./lxd-preseed.nix ./lxd-preseed.nix
./lxd-networking.nix
]; ];
networking.nftables.enable = true;
virtualisation = { virtualisation = {
lxd = { incus = {
package = pkgs.incus;
enable = true; enable = true;
recommendedSysctlSettings = true;
};
lxc = {
lxcfs.enable = true;
}; };
}; };
} }

View File

@ -1,21 +0,0 @@
{ ... }:
let
lxd_profiles = {
"default" = (import ./profiles/default.nix);
};
in
{
boot = {
kernelModules = [ "nf_nat_ftp" ];
kernel.sysctl = {
"net.ipv4.conf.all.forwarding" = true;
"net.ipv4.conf.default.forwarding" = true;
};
};
# allow static ipv4 for containers
networking.firewall.extraCommands = ''
iptables -A INPUT -i ${lxd_profiles.default.network.name} -m comment --comment "lxd rule for ${lxd_profiles.default.network.name}" -j ACCEPT
'';
}

View File

@ -7,8 +7,14 @@ let
in in
{ {
virtualisation = { virtualisation = {
lxd = { incus = {
preseed = { preseed = {
config = {
"core.https_address" = ":8443";
"images.auto_update_interval" = 9;
};
networks = [ networks = [
lxd_profiles.default.network lxd_profiles.default.network
]; ];

View File

@ -6,6 +6,7 @@
config = { config = {
"ipv4.address" = "10.100.1.1/8"; "ipv4.address" = "10.100.1.1/8";
"ipv4.nat" = "true"; "ipv4.nat" = "true";
"ipv4.firewall" = "false";
}; };
}; };
@ -13,12 +14,12 @@
{ {
name = "postgres"; name = "postgres";
driver = "btrfs"; driver = "btrfs";
config.source = "/dev/zd0"; config.source = "/dev/zvol/zspeed/postgres";
} }
{ {
name = "test"; name = "test";
driver = "btrfs"; driver = "btrfs";
config.source = "/dev/zd16"; config.source = "/dev/zvol/zspeed/test";
} }
]; ];