chore: initial commit

This commit is contained in:
Technofab 2023-05-29 13:52:53 +02:00
commit 9447dcb310
No known key found for this signature in database
GPG key ID: A0AA746B951C8830
3 changed files with 33 additions and 0 deletions

7
Dockerfile Normal file
View file

@ -0,0 +1,7 @@
ARG NIX_TAG="latest"
FROM nixos/nix:$NIX_TAG
COPY entrypoint.sh /usr/local/bin/
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]

14
README.md Normal file
View file

@ -0,0 +1,14 @@
# Gitlab Nix Docker Image
Image: [`technofab/nix-gitlab-ci:latest`](https://hub.docker.com/repository/docker/technofab/nix-gitlab-ci/general)
This simple image tries to start a Nix devShell from a flake.nix in the repository.
It uses the devShell named `ci` (optionally just link to the default shell, see below).
```nix
...
rec {
default = devenv.lib.mkShell {};
ci = default;
};
...
```

12
entrypoint.sh Normal file
View file

@ -0,0 +1,12 @@
#!/bin/sh
set -e
cd "$CI_PROJECT_DIR"
echo "Trying to activate flake's CI shell..."
{
nix --extra-experimental-features "flakes nix-command" develop .#ci --impure --command "bash" >/dev/null
} || {
echo "nix develop failed, falling back to normal shell..."
eval "bash"
}