Skip to content

Instantly share code, notes, and snippets.

@inclyc
Created May 1, 2023 17:45
Show Gist options
  • Save inclyc/887425ea610e9d6d03d86a92a775d37a to your computer and use it in GitHub Desktop.
Save inclyc/887425ea610e9d6d03d86a92a775d37a to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import subprocess
def main():
storePaths = [
'5jrqcja5680bgm7ycdw6lpnvm65hga5y-qemu-8.0.0',
'1nyg1fvhpz8bx3vn3r9f18zhra2rpbx9-glibc-2.37-8',
'28wb2asziwwv2wxynqi9nxiigycsjjmg-zlib-1.2.13',
'hp8yk1q64r8qmxp1k6bava09asgx805z-pcre2-10.42',
'rp02libq0kx9yryblhzy9xvznadyhqxk-numactl-2.0.16',
'siizz368yk5pz6gb06r1qqylvzh83skp-qemu-aarch64-binfmt-P-x86_64-unknown-linux-musl',
'vwbvkkb2182by6wnd8blxaaniahir270-glib-2.76.1',
'vmpna0kmb9yqar5snq7wk0lv80a1572r-gcc-12.2.0-lib',
'ygllvizni1f0by8kc7rj4spnk6lz47wq-curl-8.0.1',
'67882lwyvc22syw4gj29b6fb593af275-qemu-8.0.0-ga',
'qsq1wyf888vcd8ph0578l1c171rdnckx-zstd-1.5.5',
'ml8i126ppfx57p2z5an9bfxl1qxwb1zv-libiscsi-1.19.0',
'm6h942chrynndxlqazc5fnpjc38nghzk-libcap-ng-0.8.3',
'32ccxl7hfii5qjm5dymqngf58lap3jdf-liburing-2.3',
'2jpsf05ghm0bxq86b3gc1x3bms3rng1y-libaio-0.3.113',
'qw9mws7zbq8y7dwqsc99hsfpjavy3r3q-gcc-12.2.0-libgcc'
]
cmd = [
'podman',
'run',
'--rm',
'-it',
'-e',
'PATH='
'/nix/store/wvxdxcfahb7p9bk94yas4zcrj4dbxrf7-iproute2-6.2.0/bin'
':/nix/store/6rd0dixhb93qhmyqy57wi7ljd94az8gg-bash-interactive-5.2-p15/bin'
':/nix/store/ji0vhfq62v5wcailsbhnhr2srspzpy05-nix-2.15.0/bin'
':/nix/store/wvxdxcfahb7p9bk94yas4zcrj4dbxrf7-iproute2-6.2.0/bin'
':/nix/store/h70p8snjqzbf24hhf28sm0dz7bhwv8pb-curl-8.0.1-bin/bin'
':/nix/store/87jhaswysr0kvg9hh3xiyh2g1051p1m1-coreutils-full-9.1/bin',
'-e',
'SSL_CERT_FILE=/nix/store/lgf95f97m8ybji1zli6ghlp7dq8krh6q-nss-cacert-3.86/etc/ssl/certs/ca-bundle.crt',
'-e',
'NIX_CONFIG=extra-experimental-features = nix-command flakes repl-flake',
'-v',
'/run/binfmt/:/run/binfmt',
]
for storePath in storePaths:
cmd += [ '-v', f'/nix/store/{storePath}:/nix/store/{storePath}' ]
cmd += [
'localhost/thebe-base:latest',
'/nix/store/6rd0dixhb93qhmyqy57wi7ljd94az8gg-bash-interactive-5.2-p15/bin/bash'
]
# print("\n".join(cmd))
subprocess.run(cmd)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment