2023-12-13 14:53:20 +01:00
|
|
|
# Auto-generated using compose2nix v0.1.6.
|
|
|
|
{ pkgs, lib, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
# Runtime
|
|
|
|
virtualisation.podman = {
|
|
|
|
enable = true;
|
|
|
|
autoPrune.enable = true;
|
|
|
|
dockerCompat = true;
|
|
|
|
defaultNetwork.settings = {
|
|
|
|
# Required for container networking to be able to use names.
|
|
|
|
dns_enabled = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
virtualisation.oci-containers.backend = "podman";
|
|
|
|
|
|
|
|
# Containers
|
|
|
|
virtualisation.oci-containers.containers."piaware" = {
|
|
|
|
image = "ghcr.io/sdr-enthusiasts/docker-piaware:latest";
|
|
|
|
environment = {
|
|
|
|
FEEDER_ID = "cdca89ee-6612-4707-b0bb-ffb78d156c47";
|
|
|
|
LAT = "35.6837777585358";
|
|
|
|
LONG = "135.02715404216545";
|
|
|
|
RECEIVER_TYPE = "rtlsdr";
|
2023-12-14 04:03:39 +01:00
|
|
|
TZ = "Asia/Tokyo";
|
2023-12-13 14:53:20 +01:00
|
|
|
};
|
|
|
|
ports = [
|
|
|
|
"8080:80/tcp"
|
|
|
|
"30003:30003/tcp"
|
|
|
|
"30005:30005/tcp"
|
|
|
|
];
|
|
|
|
log-driver = "journald";
|
|
|
|
extraOptions = [
|
|
|
|
"--device=/dev/bus/usb:/dev/bus/usb"
|
|
|
|
"--network-alias=piaware"
|
|
|
|
"--network=piaware-default"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
systemd.services."podman-piaware" = {
|
|
|
|
serviceConfig = {
|
|
|
|
Restart = lib.mkOverride 500 "always";
|
|
|
|
};
|
|
|
|
after = [
|
|
|
|
"podman-network-piaware-default.service"
|
|
|
|
];
|
|
|
|
requires = [
|
|
|
|
"podman-network-piaware-default.service"
|
|
|
|
];
|
|
|
|
partOf = [
|
|
|
|
"podman-compose-piaware-root.target"
|
|
|
|
];
|
|
|
|
wantedBy = [
|
|
|
|
"podman-compose-piaware-root.target"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Networks
|
|
|
|
systemd.services."podman-network-piaware-default" = {
|
|
|
|
path = [ pkgs.podman ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
RemainAfterExit = true;
|
|
|
|
ExecStop = "${pkgs.podman}/bin/podman network rm -f piaware-default";
|
|
|
|
};
|
|
|
|
script = ''
|
|
|
|
podman network inspect piaware-default || podman network create piaware-default --opt isolate=true
|
|
|
|
'';
|
|
|
|
partOf = [ "podman-compose-piaware-root.target" ];
|
|
|
|
wantedBy = [ "podman-compose-piaware-root.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
# Root service
|
|
|
|
# When started, this will automatically create all resources and start
|
|
|
|
# the containers. When stopped, this will teardown all resources.
|
|
|
|
systemd.targets."podman-compose-piaware-root" = {
|
|
|
|
unitConfig = {
|
|
|
|
Description = "Root target generated by compose2nix.";
|
|
|
|
};
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
};
|
|
|
|
}
|