Skip to content

Instantly share code, notes, and snippets.

@LnL7
Created March 5, 2020 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LnL7/68fea354c7ce2017dad28b96f05b34f2 to your computer and use it in GitHub Desktop.
Save LnL7/68fea354c7ce2017dad28b96f05b34f2 to your computer and use it in GitHub Desktop.
docker + nix-daemon
$ sudo nix-env -p /nix/var/nix/profiles/docker -i $(which nix)
installing 'nix-2.3.1'
building '/nix/store/pgm4fqp01wivc0yj5pvmmx6s6vvwg4dp-user-environment.drv'...
created 5 symlinks in user environment
$ docker run -v /nix:/nix:ro -e NIX_PATH=nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos -e PATH=/nix/var/nix/profiles/docker/bin:/usr/sbin:/usr/bin:/sbin:/bin -u 1:1 --rm -it busybox
/ $ nix run nixpkgs.hello -c hello
Hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment