forked from fediversity/fediversity
try store mounted read-only
- `--store` as per https://blog.kotatsu.dev/posts/2023-04-21-woodpecker-nix-caching/ - `--eval-store` as per https://kevincox.ca/2022/01/02/nix-in-docker-caching/ mount store rm kvm bash -> sh
This commit is contained in:
parent
5005c43d51
commit
2817e3c772
11 changed files with 36 additions and 14 deletions
|
|
@ -8,12 +8,14 @@ when:
|
|||
steps:
|
||||
- name: build
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- |
|
||||
mkdir -p ~/.ssh
|
||||
echo "$CD_SSH_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
- nix-shell --run 'eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_ed25519 && ssh-agent -s && SHELL=$(which bash) nixops4 apply -v default'
|
||||
- nix-shell --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --run 'eval "$(ssh-agent -s)" && ssh-add ~/.ssh/id_ed25519 && ssh-agent -s && SHELL=$(which sh) nixops4 apply -v default'
|
||||
environment:
|
||||
CD_SSH_KEY:
|
||||
from_secret: cd_ssh_key
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ when:
|
|||
steps:
|
||||
- name: check-data-model
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix-shell --run 'nix-unit ./deployment/data-model-test.nix'
|
||||
- nix-shell --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --run 'nix-unit ./deployment/data-model-test.nix'
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ when:
|
|||
steps:
|
||||
- name: check-deployment-basic
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-basic -L
|
||||
- nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-basic -L
|
||||
devices:
|
||||
- /dev/kvm:/dev/kvm
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ when:
|
|||
steps:
|
||||
- name: check-deployment-cli
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-cli -L
|
||||
- nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-cli -L
|
||||
devices:
|
||||
- /dev/kvm:/dev/kvm
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@ when:
|
|||
steps:
|
||||
- name: check-deployment-panel
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-panel -L
|
||||
- nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.deployment-panel -L
|
||||
devices:
|
||||
- /dev/kvm:/dev/kvm
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ when:
|
|||
steps:
|
||||
- name: check-mastodon
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.test-mastodon-service -L
|
||||
- nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.test-mastodon-service -L
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ when:
|
|||
steps:
|
||||
- name: check-panel
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix-build -A tests.panel
|
||||
- nix-build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt -A tests.panel
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ when:
|
|||
steps:
|
||||
- name: check-peertube
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.test-peertube-service -L
|
||||
- nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.test-peertube-service -L
|
||||
|
|
|
|||
|
|
@ -9,5 +9,7 @@ when:
|
|||
steps:
|
||||
- name: check-pre-commit
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix-build -A tests
|
||||
- nix-build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt -A tests
|
||||
|
|
|
|||
|
|
@ -14,20 +14,22 @@ when:
|
|||
steps:
|
||||
- name: check-resources
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- echo ==================== [ VM Options ] ====================
|
||||
- |
|
||||
set -euC
|
||||
machines=$(nix eval --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).vmOptions)')
|
||||
machines=$(nix eval --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).vmOptions)')
|
||||
for machine in $machines; do
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~: $machine :~~~~~~~~~~~~~~~~~~~~~
|
||||
nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.vmOptions-$machine
|
||||
nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.vmOptions-$machine
|
||||
done
|
||||
- echo ==================== [ NixOS Configurations ] ====================
|
||||
- |
|
||||
set -euC
|
||||
machines=$(nix eval --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).nixosConfigurations)')
|
||||
machines=$(nix eval --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' --impure --raw --expr 'with builtins; toString (attrNames (getFlake (toString ./.)).nixosConfigurations)')
|
||||
for machine in $machines; do
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~: $machine :~~~~~~~~~~~~~~~~~~~~~
|
||||
nix build --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.nixosConfigurations-$machine
|
||||
nix build --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --extra-experimental-features 'nix-command flakes' .#checks.x86_64-linux.nixosConfigurations-$machine
|
||||
done
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@ when:
|
|||
steps:
|
||||
- name: lockfile
|
||||
image: nixos/nix
|
||||
volumes:
|
||||
- /nix:/mnt/nix:ro
|
||||
commands:
|
||||
- nix-shell --run "npins --verbose update"
|
||||
- nix-shell --eval-store local --store unix:///mnt/nix/var/nix/daemon-socket/socket?root=/mnt --run "npins --verbose update"
|
||||
# - name: Create PR
|
||||
# uses: https://github.com/KiaraGrouwstra/gitea-create-pull-request@f9f80aa5134bc5c03c38f5aaa95053492885b397
|
||||
# with:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue