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 # 10.88.1.1 -> Pihole
imports = [ imports = [
./pihole.nix ./pihole.nix
./qbittorrent.nix
./redmage-demo.nix ./redmage-demo.nix
./redmage.nix ./redmage.nix
./qbittorrent.nix
./suwayomi.nix ./suwayomi.nix
./ytptube.nix ./ytptube.nix
]; ];

View file

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

View file

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

View file

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

View file

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

View file

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