podman: assign hostsnames to containers

This commit is contained in:
Tigor Hutasuhut 2024-06-18 21:00:43 +07:00
parent bef5faee5c
commit 9611570809
6 changed files with 10 additions and 4 deletions

View file

@ -42,9 +42,9 @@ in
# 10.88.1.1 -> Pihole
imports = [
./pihole.nix
./qbittorrent.nix
./redmage-demo.nix
./redmage.nix
./qbittorrent.nix
./suwayomi.nix
./ytptube.nix
];

View file

@ -19,12 +19,13 @@ in
'';
system.activationScripts."podman-${name}" = ''
mkdir -p ${volume}/{config,downloads,progress,auto}
chown ${uid}:${gid} ${volume} ${volume}/{config,downloads,progress,auto}
mkdir -p ${volume}/{config,downloads,progress,watch}
chown ${uid}:${gid} ${volume} ${volume}/{config,downloads,progress,watch}
'';
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
environment = {
PUID = uid;
@ -37,7 +38,7 @@ in
"${volume}/config:/config"
"${volume}/downloads:/downloads"
"${volume}/progress:/progress"
"${volume}/auto:/auto"
"${volume}/watch:/watch"
];
ports = [
"6881:6881"

View file

@ -25,6 +25,7 @@ in
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {

View file

@ -25,6 +25,7 @@ in
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {

View file

@ -28,6 +28,7 @@ in
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {
@ -56,6 +57,7 @@ in
virtualisation.oci-containers.containers.${name-flaresolverr} = {
image = image-flaresolverr;
hostname = name-flaresolverr;
autoStart = true;
environment = {
TZ = "Asia/Jakarta";

View file

@ -62,6 +62,7 @@ in
virtualisation.oci-containers.containers.${name} = {
inherit image;
hostname = name;
autoStart = true;
user = "${uid}:${gid}";
environment = {