nix: add development vm

This commit adds back the ability to run a development VM with docspell.
See updated documentation for examples.
This commit is contained in:
Vladimir Timofeenko
2022-12-23 18:57:34 -08:00
parent 8f8adad595
commit eca08c7416
4 changed files with 67 additions and 29 deletions

28
nix/dev-vm/default.nix Normal file
View File

@ -0,0 +1,28 @@
# NOTE: modulesPath and imports are taken from nixpkgs#59219
{ modulesPath, pkgs, lib, ... }: {
imports = [ (modulesPath + "/virtualisation/qemu-vm.nix") ];
services.openssh = {
enable = true;
permitRootLogin = "yes";
};
services.docspell-restserver = {
openid = lib.mkForce [ ];
backend = lib.mkForce {
signup = {
mode = "open";
};
};
};
# Otherwise oomkiller kills docspell
virtualisation.memorySize = 2048;
virtualisation.forwardPorts = [
# SSH
{ from = "host"; host.port = 64022; guest.port = 22; }
# Docspell
{ from = "host"; host.port = 64080; guest.port = 7880; }
];
}