summary refs log tree commit diff
path: root/services/akkoma/default.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-11-15 01:26:50 +0100
committerMel <einebeere@gmail.com>2024-11-15 14:01:45 +0100
commitb620dbdf8747e888c86e25237fbd736e7f443069 (patch)
treea3003dcb2127afe7a6f7e54f4a029a415219ddf8 /services/akkoma/default.nix
parent10322f9e9761a3178936eee3aa9c35fb46be9ab2 (diff)
downloadnetwork-b620dbdf8747e888c86e25237fbd736e7f443069.tar.zst
network-b620dbdf8747e888c86e25237fbd736e7f443069.zip
Factor out base images and postgres images with fixed hashes
Signed-off-by: Mel <einebeere@gmail.com>
Diffstat (limited to 'services/akkoma/default.nix')
-rw-r--r--services/akkoma/default.nix19
1 files changed, 5 insertions, 14 deletions
diff --git a/services/akkoma/default.nix b/services/akkoma/default.nix
index 84c1bff..4cd4022 100644
--- a/services/akkoma/default.nix
+++ b/services/akkoma/default.nix
@@ -1,7 +1,8 @@
-{ lib, pkgs, unstablePkgs, ... }:
+{ lib, pkgs, unstablePkgs, auxiliaryPkgs, ... }:
 
 let
   inherit (pkgs) dockerTools;
+  inherit (auxiliaryPkgs) common;
 
   akkomaLocalPort = "1111";
   akkomaDir = "/srv/akkoma";
@@ -13,20 +14,10 @@ let
     '';
   };
 
-  baseImageArm = dockerTools.pullImage {
-    imageName = "alpine";
-    imageDigest = "sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a";
-    sha256 = "06c0q5kk60i89y1d83a28wk282ymp806xjcsmlca4cwwqp590j0q";
-    finalImageName = "alpine";
-    finalImageTag = "3.20.3";
-    os = "linux";
-    arch = "arm64";
-  };
-
   akkomaImage = dockerTools.buildLayeredImage {
     name = "akkoma";
     tag = akkoma.version;
-    fromImage = baseImageArm;
+    fromImage = common.alpine.base;
 
     contents = with unstablePkgs; [
       exiftool imagemagick ffmpeg_7-headless postgresql elixir
@@ -73,8 +64,8 @@ in
     };
 
     akkoma-db = {
-      # TODO: pull through `dockerTools`.
-      image = "postgres:14-alpine";
+      inherit (common.postgres14) image imageFile;
+
       volumes = [ "${akkomaDir}/pgdata:/var/lib/postgresql/data" ];
 
       environment = {