xrforge/nix/docker.nix

49 lines
1.2 KiB
Nix

{ pkgs ? import <nixpkgs> { }
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
}:
let
vars = import ./vars.nix;
# generate the reproducable blob below via:
# $ nix-shell -p nix-prefetch-docker --run 'nix-prefetch-docker ghcr.io/manyfold3d/manyfold-solo 0.117.0'
manyfoldImage = pkgs.dockerTools.pullImage {
imageName = "ghcr.io/manyfold3d/manyfold-solo";
imageDigest = "sha256:95ae855376eb075bd718018e09eeee2735eece87d26c392abd0d63c38c8db44b";
sha256 = "0na33qdll24cp4lc77dcmf3pi5s521gjrfqlahq52aw5vjapknfp";
finalImageName = "ghcr.io/manyfold3d/manyfold-solo";
finalImageTag = "0.117.0";
};
in
rec
{
xrforgeImage = pkgs.dockerTools.buildImage {
name = "xrforge";
tag = "latest";
created = "now";
fromImage = manyfoldImage;
# add nix pkgs + local files
contents = pkgs.buildEnv {
name = "image-root";
pathsToLink = ["/manyfold" "/bin"];
paths = [
pkgs.pkgsStatic.rsync
pkgs.pkgsStatic.sqlite
pkgs.pkgsStatic.rclone
pkgs.pkgsStatic.fuse3
./..
];
};
config = {
Cmd = ["/init"];
# We substitute the /init entrypoing with our own wrapper
EntryPoint = ["/manyfold/cli/manyfold.sh" "boot"];
};
};
}