Create a lazy /nix/store filesystem using nixfs.py
- Grab static nix from https://hydra.nixos.org/build/170454219/download/1/nix and place in the same dir as py script
- Install
fusepy
(on nix:nix-shell -p python3Packages.fusepy
) - Ensure your
/etc/fuse.conf
containsuser_allow_other
- Create workdirs:
mkdir -p $(pwd)/{fakenix,workdir} && mkdir -p $(pwd)/fakenix/nix/store
- Mount our fs:
python nixfs.py $(pwd)/fakenix $(pwd)/workdir
- Run some container image with
workdir
mounted:docker run -v $(pwd)/workdir/nix:/nix ubuntu:latest
- Try running some command, for example:
/nix/store/pqpa3glx3iqd0cavslmr0lfkzgq1iias-cowsay-3.03+dfsg2/bin/cowsay thefuck?