mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
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:
@ -15,7 +15,7 @@ in
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
console.keyMap = "de";
|
||||
console.keyMap = "us";
|
||||
|
||||
users.users.root = {
|
||||
password = "root";
|
||||
@ -88,6 +88,9 @@ in
|
||||
firewall.allowedTCPPorts = [ 7880 ];
|
||||
};
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
system.stateVersion = "22.11";
|
||||
|
||||
# This slows down the build of a vm
|
||||
documentation.enable = false;
|
||||
|
||||
}
|
||||
|
28
nix/dev-vm/default.nix
Normal file
28
nix/dev-vm/default.nix
Normal 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; }
|
||||
];
|
||||
|
||||
}
|
@ -115,5 +115,20 @@
|
||||
joex = ((import ./modules/joex.nix) self.overlays.default);
|
||||
};
|
||||
|
||||
nixosConfigurations =
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
in
|
||||
{
|
||||
dev-vm = lib.makeOverridable nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
self.nixosModules.default
|
||||
./checks
|
||||
# nixos-shell specific module. Should be kept outside nix flake checks
|
||||
./dev-vm
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user