general/other Nix package manager on Freebsd with Podman

The Nix package manager can be installed on Freebsd using Podman


Code:
doas podman run -it --os linux --network host nixos/nix

Its also possible to enable flakes in the Podman container
which allows you to pin all the dependencies to a specific version for an application

Its also possible to pin applications to a specific git commit as well

You can run nix develop in the same directory as the flake.nix file
which creates a shell with all the dependencies needed to run the application

Nixos has the largest software repo on Linux

You cant use the Nix Podman container with Nvidia/Cuda
because the nvidia-libs on the Linuxulator are built with a different glib version

However a use case is creating dev environment for different languages
such as c, rust etc

Or installing applications that have a web interface like Invidious
or gui applications that arent available on Freebsd

At the moment i have enabled flakes in the container which is running as root like this this
After entering the container with the Podman run command listed above

Code:
mkdir -p /root/.config/nix
echo "experimental-features = nix-command flakes" >> /root/.config/nix/nix.conf

You have to disable the sandbox so it works with the Linuxulator syscalls

Code:
echo "sandbox = false" >> /etc/nix/nix.conf
echo "filter-syscalls = false" >> /etc/nix/nix.conf

Im just working on create Dockerfile and compose.yaml files
to run the container as a non root user

And create a flakes directory to store all the flakes files
which would be mounted from Freebsd so the flakes are stored on the Freebsd side for persistent storage

Also a working directory that would be mounted from Freebsd
into the container for file access

I should be able to enable Wayland/X11 support for gui applications
and pulseaudio/pipewire for audio

The advantage is you could have one Nix podman container
which you could use with different flakes to create reproducible dev environments

Is also easy to create a project on github with the Dockerfile and compose.yaml files
and some flake files, so you could just clone the project and be ready to go

It would also mean you wouldnt have to set up Poudrire to enable options for packages
that arent the enabled by default

Having access to all the nix packages on Freebsd
would gives us access to a lot more software

Any thoughts, feedback
Applications you would like to be able to run i could create flake file for
 
Back
Top