# SPDX-FileCopyrightText: 2020 Luke Granger-Brown # # SPDX-License-Identifier: Apache-2.0 { pkgs, ... }: let origImageArgs = { imageName = "octobus/heptapod"; imageDigest = "sha256:cef5e7502dd8857170f696aec549918604f546677fa10b0996727951b5e8060c"; sha256 = "sha256:18ld6sn7m5vhgc07w4pzyg04sg1dv5nn0lz37gdlln44j95kkp38"; finalImageName = "octobus/heptapod"; finalImageTag = "0.26.0"; }; origImage = pkgs.dockerTools.pullImage origImageArgs; name = origImageArgs.imageName; tag = "${origImageArgs.finalImageTag}-lukegb"; in pkgs.dockerTools.buildImage rec { inherit name tag; fromImage = origImage; fromImageName = origImageArgs.finalImageName; fromImageTag = origImageArgs.finalImageTag; diskSize = 8192; runAsRoot = '' #!{pkgs.runtimeShell} cat <<"EOF" >/assets/wrapper_wrapper #!/bin/bash /usr/bin/id hg || /usr/sbin/useradd -g $(id -u git) -u $(id -g git) -o -d /var/opt/gitlab -p "*" hg /usr/bin/grep "AllowUsers git hg" /assets/sshd_config || /bin/sed -i "s/AllowUsers git/AllowUsers git hg/" /assets/sshd_config exec /assets/wrapper "$@" EOF chmod ugo=rx /assets/wrapper_wrapper ''; config.Cmd = ["/assets/wrapper_wrapper"]; } // { meta = { inherit name tag; }; }