freifunk: microvmize
This commit is contained in:
parent
a96244697a
commit
a4723c6cf2
|
@ -314,6 +314,7 @@
|
||||||
|
|
||||||
freifunk = nixosSystem' {
|
freifunk = nixosSystem' {
|
||||||
modules = [
|
modules = [
|
||||||
|
microvm.nixosModules.microvm
|
||||||
./hosts/containers/freifunk
|
./hosts/containers/freifunk
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = with secrets.overlays; [
|
nixpkgs.overlays = with secrets.overlays; [
|
||||||
|
|
|
@ -24,10 +24,33 @@ let
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
"${modulesPath}/profiles/minimal.nix"
|
"${modulesPath}/profiles/minimal.nix"
|
||||||
../../../config/lxc-container.nix
|
|
||||||
../../../config/shared.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
microvm = {
|
||||||
|
mem = 512;
|
||||||
|
hypervisor = "cloud-hypervisor";
|
||||||
|
|
||||||
|
shares = [ {
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
tag = "store";
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "store.socket";
|
||||||
|
} ] ++ map (dir: {
|
||||||
|
source = "/var/lib/microvms/${config.networking.hostName}/${dir}";
|
||||||
|
mountPoint = "/${dir}";
|
||||||
|
tag = dir;
|
||||||
|
proto = "virtiofs";
|
||||||
|
socket = "${dir}.socket";
|
||||||
|
}) [ "etc" "home" "var"];
|
||||||
|
|
||||||
|
interfaces = [ {
|
||||||
|
type = "tap";
|
||||||
|
id = "freifunk";
|
||||||
|
mac = "00:de:13:cb3:9a:7b";
|
||||||
|
} ];
|
||||||
|
};
|
||||||
|
|
||||||
boot.tmpOnTmpfs = true;
|
boot.tmpOnTmpfs = true;
|
||||||
boot.postBootCommands = ''
|
boot.postBootCommands = ''
|
||||||
if [ ! -c /dev/net/tun ]; then
|
if [ ! -c /dev/net/tun ]; then
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
microvm.autostart = [ "oparl" "leon" "nfsroot" ];
|
microvm.autostart = [ "oparl" "leon" "nfsroot" ];
|
||||||
c3d2.server.bridgePorts = {
|
c3d2.server.bridgePorts = {
|
||||||
serv = [ "oparl" "leon" "nfsroot" ];
|
serv = [ "oparl" "leon" "nfsroot" ];
|
||||||
|
core = [ "freifunk" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
|
|
Loading…
Reference in New Issue