added factorio server to cirrostratus.

This commit is contained in:
Gabe Venberg 2024-10-19 22:08:48 +02:00
parent c1221756d7
commit 8bc7e966f6
4 changed files with 46 additions and 1 deletions

15
configs/nixos/docker.nix Normal file
View file

@ -0,0 +1,15 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
virtualisation.docker = {
enable = true;
daemon.settings = {
userland-proxy = false;
};
};
users.users.${config.host.user}.extraGroups = ["docker"];
}

View file

@ -0,0 +1,26 @@
{
inputs,
config,
pkgs,
lib,
...
}: {
virtualisation.oci-containers = {
backend = "docker";
containers.factorio = {
image = "factoriotools/factorio:stable";
volumes = ["/storage/factorio:/factorio"];
hostname = "factorio";
ports = [
"34197:34197"
"27015:27015"
];
environment={
UPDATE_MODS_ON_START=true;
};
};
};
imports = [
./docker.nix
];
}

View file

@ -22,6 +22,7 @@ inputs.nixpkgs.lib.nixosSystem {
../../configs/nixos/jellyfin.nix
../../configs/nixos/syncthing.nix
../../configs/nixos/grocy.nix
../../configs/nixos/factorio-docker.nix
({
config,
pkgs,
@ -48,7 +49,7 @@ inputs.nixpkgs.lib.nixosSystem {
# dns = ["1.1.1.1"];
};
};
time.timeZone = "America/Chicago";
time.timeZone = "America/Chicago";
services.duckdns = lib.mkIf (lib.hasAttrByPath ["sops" "secrets" "duckdns-token"] config) {
enable = true;
@ -69,6 +70,8 @@ inputs.nixpkgs.lib.nixosSystem {
services.tailscale.useRoutingFeatures = "server";
# virtualisation.docker.daemon.settings.data-root="/storage/docker";
home-manager.users.${config.host.user} = {
inputs,
osConfig,

View file

@ -48,6 +48,7 @@ in {
initialize = true;
paths = [
"/storage/syncthing"
"/storage/factorio"
];
timerConfig = {
OnCalendar = "daily";