fixed microvm
This commit is contained in:
parent
5a279d1106
commit
f3c5706763
|
@ -50,8 +50,7 @@
|
||||||
inputs.agenix.nixosModules.default
|
inputs.agenix.nixosModules.default
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
inputs.simple-nixos-mailserver.nixosModule
|
inputs.simple-nixos-mailserver.nixosModule
|
||||||
inputs.microvm.nixosModules.microvm
|
inputs.microvm.nixosModules.host
|
||||||
{microvm.hypervisor = "qemu";}
|
|
||||||
];
|
];
|
||||||
in {
|
in {
|
||||||
server-vm = nixpkgs.lib.nixosSystem {
|
server-vm = nixpkgs.lib.nixosSystem {
|
||||||
|
|
|
@ -14,15 +14,27 @@ nixpkgs.lib.extend (
|
||||||
config,
|
config,
|
||||||
}: {microvm, ...}: {
|
}: {microvm, ...}: {
|
||||||
imports = [microvm.host];
|
imports = [microvm.host];
|
||||||
|
microvm.hypervisor = "cloud-hypervisor";
|
||||||
microvm.vms.${name} = {
|
microvm.vms.${name} = {
|
||||||
pkgs = import nixpkgs {inherit system;};
|
pkgs = import nixpkgs {inherit system;};
|
||||||
|
microvm.shares = [
|
||||||
|
{
|
||||||
|
tag = "ro-store";
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
}
|
||||||
|
];
|
||||||
inherit config;
|
inherit config;
|
||||||
# Host build-time reference to where the MicroVM NixOS is defined
|
|
||||||
# under nixosConfigurations
|
|
||||||
flake = self;
|
|
||||||
# Specify from where to let `microvm -u` update later on
|
|
||||||
updateFlake = "git+file:///etc/nixos";
|
|
||||||
};
|
};
|
||||||
|
# Mount host /nix/store for drastically reduced image size and evaluation time
|
||||||
|
microvm.vms.${name}.config.shares = [
|
||||||
|
{
|
||||||
|
source = "/nix/store";
|
||||||
|
mountPoint = "/nix/.ro-store";
|
||||||
|
tag = "ro-store";
|
||||||
|
proto = "virtiofs";
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{...}:
|
{...}: {
|
||||||
{
|
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
|
|
||||||
networking.wakeOnLan.enable = true;
|
networking.wakeOnLan.enable = true;
|
||||||
|
|
|
@ -1,7 +1,15 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
boot.zfs.devNodes = "/dev/disk/by-path";
|
boot.zfs.devNodes = "/dev/disk/by-path";
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
zfs
|
zfs
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Microvm be fucking shit up
|
||||||
|
# fileSystems."/nix/store".fsType = lib.mkForce "zfs";
|
||||||
|
# fileSystems."/nix/store".device = lib.mkForce "zroot/nix/store";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue