From 860ca121b05db1ac69238af1ddcd3457201d6662 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 28 Feb 2024 16:59:34 -0500 Subject: [PATCH] feat(arion): migrate gameyfin --- devices/cluster/modules/caddy.nix | 5 ++++- .../nas/modules/arion/.template/compose.nix | 9 +++++++++ .../modules/arion/.template/images/image.nix | 8 ++++++++ devices/nas/modules/arion/default.nix | 1 + .../nas/modules/arion/gameyfin/compose.nix | 19 +++++++++++++++++++ .../arion/gameyfin/images/gameyfin.nix | 8 ++++++++ flake.lock | 8 ++++---- 7 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 devices/nas/modules/arion/.template/compose.nix create mode 100644 devices/nas/modules/arion/.template/images/image.nix create mode 100644 devices/nas/modules/arion/gameyfin/compose.nix create mode 100644 devices/nas/modules/arion/gameyfin/images/gameyfin.nix diff --git a/devices/cluster/modules/caddy.nix b/devices/cluster/modules/caddy.nix index ec74e90..7dcfb3b 100644 --- a/devices/cluster/modules/caddy.nix +++ b/devices/cluster/modules/caddy.nix @@ -101,7 +101,10 @@ in { reverseProxy = "${dockerIP}:5055"; }; - games.reverseProxy = "${dockerIP}:8074"; + gameyfin = { + subDomainName = "games"; + reverseProxy = "${servivi}:8074"; + }; wgui.reverseProxy = "${servivi}:51821"; diff --git a/devices/nas/modules/arion/.template/compose.nix b/devices/nas/modules/arion/.template/compose.nix new file mode 100644 index 0000000..e88934d --- /dev/null +++ b/devices/nas/modules/arion/.template/compose.nix @@ -0,0 +1,9 @@ +{config, ...}: let + inherit (config.sops) secrets; + inherit (config.arion) rwDataDir; + + rwPath = rwDataDir + "/projectName"; +in { + arion.projects."projectName" = { + }; +} diff --git a/devices/nas/modules/arion/.template/images/image.nix b/devices/nas/modules/arion/.template/images/image.nix new file mode 100644 index 0000000..5a21225 --- /dev/null +++ b/devices/nas/modules/arion/.template/images/image.nix @@ -0,0 +1,8 @@ +pkgs: +pkgs.dockerTools.pullImage { + imageName = "some/image/name"; + imageDigest = ""; + sha256 = ""; + finalImageName = ""; + finalImageTag = "latest"; +} diff --git a/devices/nas/modules/arion/default.nix b/devices/nas/modules/arion/default.nix index e19c74b..da9f844 100644 --- a/devices/nas/modules/arion/default.nix +++ b/devices/nas/modules/arion/default.nix @@ -6,6 +6,7 @@ in { ./forgejo/compose.nix ./freshrss/compose.nix + ./gameyfin/compose.nix ./hauk/compose.nix ./homepage/compose.nix ./immich/compose.nix diff --git a/devices/nas/modules/arion/gameyfin/compose.nix b/devices/nas/modules/arion/gameyfin/compose.nix new file mode 100644 index 0000000..772a279 --- /dev/null +++ b/devices/nas/modules/arion/gameyfin/compose.nix @@ -0,0 +1,19 @@ +{config, ...}: let + inherit (config.sops) secrets; +in { + arion.projects."gameyfin"."gameyfin" = { + image = ./images/gameyfin.nix; + restart = "always"; + user = "1000:1000"; + + env_file = [secrets.gameyfin.path]; + environment.GAMEYFIN_USER = "mathis"; + + volumes = [ + "/data/games:/opt/gameyfin-library" + ]; + + expose = ["8080"]; + ports = ["8074:8080"]; + }; +} diff --git a/devices/nas/modules/arion/gameyfin/images/gameyfin.nix b/devices/nas/modules/arion/gameyfin/images/gameyfin.nix new file mode 100644 index 0000000..6079855 --- /dev/null +++ b/devices/nas/modules/arion/gameyfin/images/gameyfin.nix @@ -0,0 +1,8 @@ +pkgs: +pkgs.dockerTools.pullImage { + imageName = "grimsi/gameyfin"; + imageDigest = "sha256:97842e65252e0854ccced478c10a007ee57e7a35c98c3cb26ecce9d0fd5be41c"; + sha256 = "19gbbaqg4n188piyh3lb54rfwz5xpj6f6fkvpqsbls3v9a4ambjw"; + finalImageName = "grimsi/gameyfin"; + finalImageTag = "latest"; +} diff --git a/flake.lock b/flake.lock index eaebc1f..57134b6 100644 --- a/flake.lock +++ b/flake.lock @@ -1342,11 +1342,11 @@ "sops-nix": "sops-nix" }, "locked": { - "lastModified": 1709143835, - "narHash": "sha256-75Ww7bpWFdKyYxTiSd2zO8FX6T5FxfAAwuyOf6PgkWs=", + "lastModified": 1709155444, + "narHash": "sha256-bdKOhfSskioOc/p9CkT7POkbP9aauCAFgAPO7JxKJO4=", "ref": "refs/heads/main", - "rev": "38fcf652c0fb0c441cd0fff092772f547be7c42d", - "revCount": 48, + "rev": "6d61a2cfc9ef021f9ad5cde38ea94659340afe77", + "revCount": 49, "type": "git", "url": "ssh://git@git.nelim.org/matt1432/nixos-secrets" },