Create nix distrobox

Anyone have any success setting up a nixos distrobox container, or just a distrobox with nix in general? I originally tried to put nix ontop of a container image, but the installer I was using (https://docs.determinate.systems/) keeps trying to configure selinux from inside the container and breaking. So now I was trying to install nixos directly using their docker image (distrobox create --image nixos/nix:latest --name nix-dev), but when trying to enter it gives me this error:
superricky@2400-a840-5128-0-56ba-9573-97a7-59cd:~$ distrobox enter nix-dev
Error: could not start entrypoint.
+ stat /run/host/etc/shadow
++ stat -c %u /run/host/etc/shadow
+ '[' 65534 = 0 ']'
+ '[' -f /run/host/etc/locale.conf ']'
++ grep -e '^LANG=' /run/host/etc/locale.conf
++ sed s/LANG=//
++ sed 's/"//g'
/usr/bin/entrypoint: line 244: sed: command not found
/usr/bin/entrypoint: line 244: sed: command not found
++ sed 's/'\''//g'
/usr/bin/entrypoint: line 244: sed: command not found
+ HOST_LOCALE=
+ '[' 127 -ne 0 ']'
+ printf 'Error: An error occurred\n'
Error: An error occurred
superricky@2400-a840-5128-0-56ba-9573-97a7-59cd:~$ distrobox enter nix-dev
Error: could not start entrypoint.
+ stat /run/host/etc/shadow
++ stat -c %u /run/host/etc/shadow
+ '[' 65534 = 0 ']'
+ '[' -f /run/host/etc/locale.conf ']'
++ grep -e '^LANG=' /run/host/etc/locale.conf
++ sed s/LANG=//
++ sed 's/"//g'
/usr/bin/entrypoint: line 244: sed: command not found
/usr/bin/entrypoint: line 244: sed: command not found
++ sed 's/'\''//g'
/usr/bin/entrypoint: line 244: sed: command not found
+ HOST_LOCALE=
+ '[' 127 -ne 0 ']'
+ printf 'Error: An error occurred\n'
Error: An error occurred
My goal is to use Nix for development, so if you have a better way of doing that please let me know.
Determinate documentation
An end-to-end toolchain for using Nix courtesy of Determinate Systems
2 Replies
Sharperious
Sharperious2mo ago
have you tried a different distro as the container and then adding nix home manager inside of that?
superricky
superrickyOP2mo ago
Yes actually I forgot that I wrote this thing lol but I managed to create an alpine Linux distrobox and install determinate Nix in there, and then exported it to my system so thanks though

Did you find this page helpful?