mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2025-12-12 02:00:13 +01:00
feat!: add daemon to build & especially cache
This commit is contained in:
parent
bd1cfe94a4
commit
92f3560899
12 changed files with 93 additions and 17 deletions
12
ci-image/Dockerfile
Normal file
12
ci-image/Dockerfile
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
ARG NIX_TAG="latest"
|
||||
|
||||
FROM nixos/nix:$NIX_TAG
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/
|
||||
COPY nix.conf /etc/nix/nix.conf
|
||||
COPY nix.conf /root/.config/nix/nix.conf
|
||||
|
||||
VOLUME "/mnt/nix/daemon-socket"
|
||||
VOLUME "/mnt/nix/store"
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "/usr/local/bin/entrypoint.sh"]
|
||||
7
ci-image/entrypoint.sh
Normal file
7
ci-image/entrypoint.sh
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
cd "$CI_PROJECT_DIR"
|
||||
|
||||
echo "Activating flake's CI shell..."
|
||||
nix develop .#ci --impure --command "bash"
|
||||
4
ci-image/nix.conf
Normal file
4
ci-image/nix.conf
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
experimental-features = nix-command flakes
|
||||
accept-flake-config = true
|
||||
store = unix:///mnt/nix/daemon-socket/socket?real=/mnt/nix/store
|
||||
sandbox = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue