I’m trying to use Nix as a way of unifying my local development environment and the docker based Gitlab CI build that I’m using.
I have a simple shell.nix that works perfectly - I can run nix-shell locally and get everything I need.
If, in my CI config I then use nixos/nix:latest
as my docker image, and surround every command with nix-shell --run "xxx"
that all works. That nix-shell
all over the place is tedious to maintain and hard to read what is actually going on. What I'd like to do is apply that configuration to the docker image somehow as the first command, so that the environment is available to all the subsequent build commands.
I think what I want is something like nix-env -f shell.nix -i
but that fails with “This derivation is not meant to be built, aborting”.
Thanks in advance.