Move nix code into separate files and directory and create basic module

This commit is contained in:
thiloho
2024-08-09 20:12:31 +02:00
parent f2a11529db
commit cfee37ad90
4 changed files with 169 additions and 156 deletions

49
nix/module-test.nix Normal file
View File

@@ -0,0 +1,49 @@
{
pkgs,
lib,
modulesPath,
...
}:
{
imports = [
"${modulesPath}/virtualisation/qemu-vm.nix"
./module.nix
];
networking = {
hostName = "archtika-module-test";
firewall.enable = false;
};
nix.settings.experimental-features = [ "nix-command flakes" ];
users.users.dev = {
isNormalUser = true;
extraGroups = [ "wheel" ];
password = "dev";
};
virtualisation = {
graphics = false;
# Alternatively a bridge network for QEMU could be setup, but requires much more effort
forwardPorts = [
{
from = "host";
host.port = 13000;
guest.port = 3000;
}
{
from = "host";
host.port = 14000;
guest.port = 4000;
}
];
};
services.archtika = {
enable = true;
jwtSecret = "test-secret";
};
system.stateVersion = "24.05";
}