55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
|
{pkgs, ...}: {
|
||
|
virtualisation.vmVariant = {
|
||
|
# following configuration is added only when building VM with build-vm
|
||
|
virtualisation = {
|
||
|
memorySize = 2048; # Use 2048MiB memory.
|
||
|
cores = 3;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
users.users.root.openssh.authorizedKeys.keys = [
|
||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMNeQYLFauAbzDyIbKC86NUh9yZfiyBm/BtIdkcpZnSU"
|
||
|
];
|
||
|
|
||
|
services.openssh.enable = true;
|
||
|
users.users.root.initialPassword = "root";
|
||
|
|
||
|
users.users.nixosvmtest.isSystemUser = true ;
|
||
|
users.users.nixosvmtest.initialPassword = "test";
|
||
|
users.users.nixosvmtest.group = "nixosvmtest";
|
||
|
users.groups.nixosvmtest = {};
|
||
|
|
||
|
users.groups.loomio = {};
|
||
|
users.users.loomio = {
|
||
|
description = "User to run loomio";
|
||
|
group = "loomio";
|
||
|
isSystemUser = true;
|
||
|
};
|
||
|
|
||
|
services.postgresql = {
|
||
|
enable = true;
|
||
|
ensureDatabases = [ "loomio" ];
|
||
|
ensureUsers = [{
|
||
|
name = "loomio";
|
||
|
ensureDBOwnership = true;
|
||
|
# ensurePermissions = { "DATABASE loomio" = "ALL PRIVILEGES"; };
|
||
|
}];
|
||
|
};
|
||
|
|
||
|
systemd.services.loomio = {
|
||
|
enable = true;
|
||
|
after = [ "basic.target" ];
|
||
|
|
||
|
serviceConfig = {
|
||
|
User = "loomio";
|
||
|
Restart = "always";
|
||
|
ExecStart = "${pkgs.loomio}/bin/loomio";
|
||
|
};
|
||
|
environment = {
|
||
|
DATABASE_URL = "postgresql://localhost/loomio";
|
||
|
};
|
||
|
};
|
||
|
|
||
|
system.stateVersion = "23.11";
|
||
|
}
|