Refactor direnv and nix launch

This commit is contained in:
Tom Foster 2024-04-23 13:50:35 +01:00 committed by GitHub
parent 2a71457203
commit 3de3aead23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -55,17 +55,23 @@ jobs:
echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf
echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf
- name: Populate `/nix/store` and activate `direnv` - name: Install and activate `direnv`
run: |
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
- name: Populate `/nix/store`
run: | run: |
nix develop --command true nix develop --command true
nix-env -f "<nixpkgs>" -iA direnv -iA nix-direnv
touch $HOME/.direnvrc
source $HOME/.direnvrc
direnv allow direnv allow
- name: Perform continuous integration
run: |
direnv exec . engage
- name: Build static targets - name: Build static targets
run: | run: |
/bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl .#static-x86_64-unknown-linux-musl-jemalloc .#static-aarch64-unknown-linux-musl .#static-aarch64-unknown-linux-musl-jemalloc bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl .#static-x86_64-unknown-linux-musl-jemalloc .#static-aarch64-unknown-linux-musl .#static-aarch64-unknown-linux-musl-jemalloc
- name: Organise and prepare static outputs - name: Organise and prepare static outputs
run: | run: |
@ -139,7 +145,7 @@ jobs:
- name: Build OCI image targets - name: Build OCI image targets
run: | run: |
/bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc
- name: Organise OCI image outputs - name: Organise OCI image outputs
run: | run: |