Open dschrempf opened 3 years ago
OK, so I answer this question myself. It took me a while to figure everthing out. (Is anybody reading these issues? If so, is this module still developed?)
I used the NixOS unstable channel and installed nixopsUnstable
(this already installs nixops-libvirtd
, so no need to even clone this reopository. Then I followed the steps in the Readme.md
.
virtualisation.libvirtd.enable = true;
users.extraUsers.myuser.extraGroups = [ "libvirtd" ];
networking.firewall.checkReversePath = false;
images=/var/lib/libvirt/images
sudo mkdir $images
sudo chgrp libvirtd $images
sudo chmod g+w $images
sudo virsh pool-define-as default dir --target $images
sudo virsh pool-autostart default
sudo virsh pool-start default
Then, I had to create my own machine configuration file (both the example and the test file didn't work).
Let's call it workingExample.nix
.
{
machine =
{ resources, ... }:
{
deployment.targetEnv = "libvirtd";
deployment.libvirtd = {
headless = true;
};
};
network =
{
description = "libvirtd test";
};
}
Then, I used
nixops create -d lv workingExample.nix
nixops deploy -d lv
Also, I rebooted after switching to the new system configuration.
It is not clear to me how this module can be used with NixOps. If I install NixOps from the NixOps GitHub repository, this libvirtd backend is not found. If I try to enter a nix-shell in this (nixops-libvirtdd) repository, I get the compilation error appended below. Maybe I misunderstand something, but it would be very nice, if a working example is available somewhere!
Thank you!
The compilation error: