made containers ephemeral

This commit is contained in:
Gerg-L 2023-03-10 18:24:18 -05:00
parent 30a932907c
commit 9ebe553ce1
2 changed files with 9 additions and 0 deletions

View file

@ -1,5 +1,6 @@
_: {...}: { _: {...}: {
containers."minecraft" = { containers."minecraft" = {
ephemeral = true;
privateNetwork = true; privateNetwork = true;
hostBridge = "bridge0"; hostBridge = "bridge0";
localAddress = "192.168.1.10/24"; localAddress = "192.168.1.10/24";
@ -36,6 +37,8 @@ _: {...}: {
wantedBy = ["basic.target"]; wantedBy = ["basic.target"];
after = ["dhcpcd.service"]; after = ["dhcpcd.service"];
}; };
boot.initrd.postDeviceCommands = "mkdir -p /minecraft";
system.stateVersion = "unstable"; system.stateVersion = "unstable";
users.users.minecraft = { users.users.minecraft = {
description = "Minecraft server service user"; description = "Minecraft server service user";

View file

@ -1,10 +1,16 @@
_: {...}: { _: {...}: {
containers."website" = { containers."website" = {
ephemeral = true;
autoStart = true; autoStart = true;
privateNetwork = true; privateNetwork = true;
hostBridge = "bridge0"; hostBridge = "bridge0";
localAddress = "192.168.1.11/24"; localAddress = "192.168.1.11/24";
localAddress6 = "2605:59c8:252e:500:200:ff:fe00:11/64"; localAddress6 = "2605:59c8:252e:500:200:ff:fe00:11/64";
bindMounts."/persist/website" = {
mountPoint = "/var";
hostPath = "/persist/website";
isReadOnly = false;
};
config = { config = {
pkgs, pkgs,
config, config,