mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
chore: initial commit
This commit is contained in:
commit
9447dcb310
3 changed files with 33 additions and 0 deletions
7
Dockerfile
Normal file
7
Dockerfile
Normal 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
14
README.md
Normal 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
12
entrypoint.sh
Normal 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"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue