xrforge/nix/docker.nix

92 lines
3.1 KiB
Nix
Raw Permalink Normal View History

{ pkgs ? import <nixpkgs> { }
, pkgsLinux ? import <nixpkgs> { system = "x86_64-linux"; }
}:
2025-07-22 13:16:53 +02:00
let
2025-08-05 13:57:59 +02:00
# -- swap the above pkgs with the pkgs definition below for 100% reproducability
# -- WARNING: requires quite some diskspace
#{ } :
#
#let
# pkgs = import ( builtins.fetchTarball {
# # https://github.com/NixOS/nixpkgs/archive/refs/heads/nixos-25.05.zip
# name = "nixos-25.05";
# url = "https://github.com/NixOS/nixpkgs/archive/nixos-25.05.tar.gz";
# sha256 = "sha256:10cqhkqkifcgyibj9nwxrnq424crfl40kwr3daky83m2fisb4f6p";
# }) {};
2025-08-05 13:57:59 +02:00
2025-07-22 13:16:53 +02:00
vars = import ./vars.nix;
# generate the reproducable blob below via:
2025-07-31 11:30:07 +02:00
# $ nix-shell -p nix-prefetch-docker --run 'nix-prefetch-docker ghcr.io/manyfold3d/manyfold-solo 0.120.0'
#manyfoldImage = pkgs.dockerTools.pullImage {
# imageName = "ghcr.io/manyfold3d/manyfold-solo";
# imageDigest = "sha256:6250e562a05bf9476ddcfdc897a7b03cbf2090c727d9fe051afde486579b54a6";
# sha256 = "sha256-V5y1N0l4JQjVDQbboGYX15MQaImXtP/HpNwPjDtxeJQ=";
# finalImageName = "ghcr.io/manyfold3d/manyfold-solo";
# finalImageTag = "0.121.0";
#};
2025-07-22 13:16:53 +02:00
manyfoldImage = pkgs.dockerTools.pullImage {
imageName = "ghcr.io/manyfold3d/manyfold-solo";
imageDigest = "sha256:465399a2d296034ef84dba18a13744b567694c652387bd17fe97d51c672d1fa9";
hash = "sha256-j7YSUGRFUDh6FJ1CrIQEzGU/0B8uPO8y1kd9lYLad4w=";
finalImageName = "ghcr.io/manyfold3d/manyfold-solo";
finalImageTag = "latest";
2025-07-22 13:16:53 +02:00
};
# generate the reproducable blob below via:
# $ nix-shell -p nix-prefetch-github --command 'nix-prefetch-github assimp assimp --rev e778c84cd62bc8b38d8e491ad3d2c27cb8ed37d5'
assimpSrc = pkgs.fetchFromGitHub {
"owner" = "assimp";
"repo" = "assimp";
"rev" = "e778c84cd62bc8b38d8e491ad3d2c27cb8ed37d5";
"hash" = "sha256-ja5pFwpnzLT2MDIR8ISwC6+eA5UXyqRZW2CMCCrF1Q0=";
};
myAssimp = pkgs.pkgsStatic.assimp.overrideAttrs (oldAttrs: {
inherit assimpSrc; # Set the source to the fetched commit
src = assimpSrc;
});
2025-07-22 13:16:53 +02:00
in
rec
2025-07-22 13:16:53 +02:00
{
xrforgeImage = pkgs.dockerTools.buildImage {
2025-07-22 13:16:53 +02:00
name = "xrforge";
tag = "latest";
created = "now";
2025-07-22 13:16:53 +02:00
fromImage = manyfoldImage;
# add nix pkgs + local files
contents = pkgs.buildEnv {
2025-07-22 13:16:53 +02:00
name = "image-root";
2025-10-23 19:21:56 +02:00
pathsToLink = ["/manyfold" "/bin" ];
paths = [
pkgs.pkgsStatic.rsync
pkgs.pkgsStatic.sqlite
pkgs.pkgsStatic.rclone
pkgs.pkgsStatic.fuse3
2025-08-08 12:33:55 +02:00
pkgs.pkgsStatic.acl # getfacl e.g.
pkgs.pkgsStatic.inotify-tools # inotifywait e.g.
2025-08-08 12:33:55 +02:00
pkgs.pkgsStatic.zip # inotifywait e.g.
pkgs.pkgsStatic.ts # job management
myAssimp # cli 3D editing/conversion
./..
];
2025-07-22 13:16:53 +02:00
};
config = {
Cmd = ["/init"];
# We substitute the /init entrypoing with our own wrapper
EntryPoint = ["/manyfold/cli/manyfold.sh" "boot"];
2025-07-22 13:16:53 +02:00
};
};
2025-07-22 13:16:53 +02:00
}