nb
This commit is contained in:
@@ -15,43 +15,31 @@ in
|
||||
# Open firewall for netbootxyz if enabled
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [
|
||||
cfg.httpPort
|
||||
cfg.httpsPort
|
||||
cfg.webPort
|
||||
cfg.assetPort
|
||||
cfg.tftpPort
|
||||
];
|
||||
allowedUDPPorts = [
|
||||
cfg.httpPort
|
||||
cfg.httpsPort
|
||||
cfg.webPort
|
||||
cfg.assetPort
|
||||
cfg.tftpPort
|
||||
];
|
||||
};
|
||||
|
||||
# Create data directory
|
||||
systemd.tmpfiles.rules = [
|
||||
"d ${cfg.dataDir} 0755 root root -"
|
||||
];
|
||||
|
||||
# Configure netbootxyz as a container service
|
||||
virtualisation.oci-containers = {
|
||||
backend = "podman";
|
||||
containers.netbootxyz = {
|
||||
autoStart = true;
|
||||
image = "ghcr.io/netbootxyz/netbootxyz:latest";
|
||||
ports = [
|
||||
"${toString cfg.httpPort}:3000"
|
||||
"${toString cfg.httpsPort}:3001"
|
||||
"${toString cfg.webPort}:3000"
|
||||
"${toString cfg.assetPort}:80"
|
||||
"${toString cfg.tftpPort}:69"
|
||||
];
|
||||
volumes = [
|
||||
"${cfg.dataDir}:/app/src/config"
|
||||
];
|
||||
environment = {
|
||||
MENU_VERSION = "2.0.76";
|
||||
PORT_RANGE = "30000:30010";
|
||||
};
|
||||
extraOptions = [
|
||||
"--restart=unless-stopped"
|
||||
"${cfg.dataDir}:/config"
|
||||
"${cfg.assetDir}:/assets"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Enable podman for oci-containers
|
||||
virtualisation.podman.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user