1
Fork 0
e11sync/vm.nix

67 lines
1.3 KiB
Nix
Raw Normal View History

2024-01-20 14:47:44 +02:00
{
lib,
pkgs,
...
}: {
2024-01-16 15:38:00 +02:00
e11sync = {
enable = true;
migrateOnStart = true;
2024-01-16 22:48:36 +02:00
secretKeyPath = "unsafe";
2024-01-16 23:50:59 +02:00
vhost = ":8001";
};
services.caddy = {
enable = true;
globalConfig = ''
http_port 8001
auto_https off
debug
'';
virtualHosts.":8001".extraConfig = lib.mkForce ''
2024-01-25 14:00:44 +02:00
redir /admin/* http://{host}:8003{uri}
${builtins.readFile "${pkgs.e11sync-caddyfile}"}
'';
2024-01-20 14:47:44 +02:00
virtualHosts."http://:8003".extraConfig = lib.mkForce ''
2024-01-20 14:35:18 +02:00
redir / /admin/
${builtins.readFile "${pkgs.e11sync-caddyfile}"}
'';
2024-01-16 15:38:00 +02:00
};
2024-01-15 23:11:46 +02:00
environment.systemPackages = with pkgs; [
tmux
htop
];
2024-01-16 11:41:15 +02:00
nix.extraOptions = ''experimental-features = nix-command flakes'';
2024-01-15 23:11:46 +02:00
users = {
mutableUsers = false;
users.nixos = {
extraGroups = ["wheel"];
isNormalUser = true;
hashedPassword = "";
};
};
2024-01-16 23:54:24 +02:00
virtualisation = {
graphics = false;
forwardPorts = [
{
from = "host";
host.port = 8001;
guest.port = 8001;
}
2024-01-20 14:35:18 +02:00
{
from = "host";
host.port = 8003;
guest.port = 8003;
}
2024-01-16 23:54:24 +02:00
];
};
2024-01-15 23:11:46 +02:00
security.sudo.wheelNeedsPassword = false;
services.getty.autologinUser = "nixos";
networking = {
hostName = "vm";
firewall.allowedTCPPorts = [8001 8003];
2024-01-15 23:11:46 +02:00
};
system.stateVersion = "23.11";
}