erpnext-nix/test-vm/configuration.nix

72 lines
1.8 KiB
Nix
Raw Normal View History

{ pkgs, lib, config, modulesPath, ... }:
{
imports = [
"${modulesPath}/profiles/minimal.nix"
"${modulesPath}/profiles/qemu-guest.nix"
"${modulesPath}/virtualisation/qemu-vm.nix"
2023-07-09 12:46:22 +00:00
../modules/erpnext.nix
];
2023-07-09 12:46:22 +00:00
config = {
services.qemuGuest.enable = true;
2023-06-05 17:28:33 +00:00
system.stateVersion = "23.05";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
boot = {
growPartition = true;
loader.timeout = 5;
};
virtualisation = {
diskSize = 8000; # MB
memorySize = 2048; # MB
# We don't want to use tmpfs, otherwise the nix store's size will be bounded
# by a fraction of available RAM.
writableStoreUseTmpfs = false;
2023-06-05 17:28:33 +00:00
forwardPorts = [{
guest.port = 22;
host.port = 2222;
} {
guest.port = 9090;
host.port = 9090;
2023-06-06 04:19:10 +00:00
} {
guest.port = 8081;
host.port = 8081;
2023-06-05 17:28:33 +00:00
}];
};
# So that we can ssh into the VM, see e.g.
# http://blog.patapon.info/nixos-local-vm/#accessing-the-vm-with-ssh
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";
# Give root an empty password to ssh in.
users.extraUsers.root.password = "";
2023-06-05 17:28:33 +00:00
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNeQYLFauAbzDyIbKC86NUh9yZfiyBm/BtIdkcpZnSU"
];
users.mutableUsers = false;
2023-06-05 17:28:33 +00:00
networking.firewall.enable = false;
environment.systemPackages = with pkgs; [
git
htop
neovim
];
2023-07-09 12:46:22 +00:00
services.erpnext = {
enable = true;
2023-07-09 12:46:22 +00:00
adminPasswordFile = ../adminpass.txt;
database.rootPasswordFile = ../dbrootpass.txt;
database.passwordFile = ../dbuserpass.txt;
caddy = {};
};
};
}