craige
August 18, 2019, 9:13pm
1
I’m been using NixOps with the Libvirtd backend but it’s been turtles all the way down with one problem overcome only to find another waiting.
If any one has any successful NixOps + Libvirtd backend deployment configurations they’d like to share, that’d be greatly appreciated.
eadwu
August 19, 2019, 12:06am
2
The trivial example should work fine from the manual [1].
[1] NixOps User's Guide
Last week I tried using the libvirtd backend and had all sorts of issues as well. In the end I switched to VirtualBox and everything worked much better.
I would much prefer to use libvirtd but it looks like it’s under-maintained right now.
eadwu
August 19, 2019, 4:52pm
4
My base libvirt expression
{ lib, ... }:
{
deployment = {
targetEnv = "libvirtd";
libvirtd = {
vcpu = lib.mkDefault 1;
memorySize = lib.mkDefault 1024;
headless = lib.mkDefault true;
baseImageSize = lib.mkDefault 10;
};
};
# See https://github.com/NixOS/nixops/issues/931
system.activationScripts.nixops-vm-fix-931 = ''
if ls -l /nix/store | grep sudo | grep -q nogroup; then
mount -o remount,rw /nix/store
chown -R root:nixbld /nix/store
fi
'';
}
While regarding architectures other than x86_64
it is more complicated.
1 Like