Add attic

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-03 13:29:49 +01:00
parent dd34a05ee8
commit eeb33c92ed
21 changed files with 636 additions and 18 deletions

View File

@@ -0,0 +1,34 @@
{ pkgs, ... }:
let
entrypoint = pkgs.writeTextFile {
name = "entrypoint";
executable = true;
destination = "/bin/entrypoint";
text = builtins.readFile ./entrypoint.sh;
};
in
pkgs.dockerTools.buildImage {
name = "attic";
fromImage = pkgs.docker-image-base;
copyToRoot = pkgs.buildEnv {
name = "root";
paths = with pkgs; [
entrypoint
attic-server
attic-client
];
pathsToLink = [ "/bin" ];
};
config = {
Entrypoint = [ "entrypoint" ];
ExposedPorts = {
"8080/tcp" = { };
};
WorkingDir = "/var/lib/atticd";
Volumes = {
"/var/lib/atticd" = { };
};
};
}

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env sh
set -o errexit
set -o nounset
atticd "$@" &
PID=$!
if [ -f /etc/attic/post-start.sh ]; then
# shellcheck disable=SC1091
. /etc/attic/post-start.sh
fi
trap 'kill -KILL "$PID"' INT TERM
wait "$PID"
exit $?