restart podman when refresh
This commit is contained in:
parent
1334de7ff6
commit
33d2ae427a
1 changed files with 8 additions and 6 deletions
|
|
@ -18,6 +18,8 @@
|
|||
nixPkgs = specialArgs.nixPkgs;
|
||||
ourRustVersion = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.complete);
|
||||
|
||||
vncContext = builtins.path { path = ./vnc-desktop; name = "vnc-desktop-context"; };
|
||||
|
||||
ourRustPlatform = nixPkgs.makeRustPlatform {
|
||||
rustc = ourRustVersion;
|
||||
cargo = ourRustVersion;
|
||||
|
|
@ -115,8 +117,8 @@ in {
|
|||
systemd.services.arion-riverside.environment.DOCKER_HOST = "unix:///run/podman/podman.sock";
|
||||
|
||||
# Build the VNC desktop image locally from the Dockerfile — no registry push/pull needed.
|
||||
# Nix copies the build context into the store; the hash changes when Dockerfile or
|
||||
# start.sh change, triggering a rebuild on the next nixos-rebuild switch.
|
||||
# vncContext is a Nix store path that changes whenever any file under vnc-desktop/ changes,
|
||||
# which causes build-vnc-image to re-run and podman-vnc-desktop to restart on nixos-rebuild.
|
||||
systemd.services.build-vnc-image = {
|
||||
description = "Build VNC desktop container image from Dockerfile";
|
||||
wantedBy = [ "podman-vnc-desktop.service" ];
|
||||
|
|
@ -126,9 +128,7 @@ in {
|
|||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writeShellScript "build-vnc-image" ''
|
||||
STAMP=/var/lib/build-vnc-image/context-hash
|
||||
EXPECTED="${builtins.hashString "sha256"
|
||||
(builtins.readFile ./vnc-desktop/Dockerfile +
|
||||
builtins.readFile ./vnc-desktop/start.sh)}"
|
||||
EXPECTED="${vncContext}"
|
||||
if [ -f "$STAMP" ] && [ "$(cat "$STAMP")" = "$EXPECTED" ]; then
|
||||
echo "VNC image is up to date, skipping build"
|
||||
exit 0
|
||||
|
|
@ -136,13 +136,15 @@ in {
|
|||
echo "Building VNC desktop image..."
|
||||
${pkgs.podman}/bin/podman build \
|
||||
-t forge.quinefoundation.com/ironmagma/vnc-desktop:latest \
|
||||
${./vnc-desktop}
|
||||
${vncContext}
|
||||
mkdir -p "$(dirname "$STAMP")"
|
||||
echo "$EXPECTED" > "$STAMP"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.podman-vnc-desktop.restartTriggers = [ "${vncContext}" ];
|
||||
|
||||
services.gitea-actions-runner.instances."ubuntu" = {
|
||||
enable = true;
|
||||
name = "ubuntu";
|
||||
|
|
|
|||
Loading…
Reference in a new issue