feat: add nix store volume #6

Merged
patrick merged 5 commits from patrick/nix-caching into master 2023-07-31 20:18:42 -07:00
2 changed files with 7 additions and 3 deletions

View File

@ -1,16 +1,19 @@
steps: steps:
build-docker-image: build-docker-image:
when:
event: push
image: alpine:edge image: alpine:edge
commands: commands:
- apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing - apk add --no-cache git nix --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
- echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf - echo "system-features = nixos-test benchmark big-parallel uid-range kvm" > /etc/nix/nix.conf
- nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker - nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#docker
- cp $(nix build --extra-experimental-features nix-command --extra-experimental-features flakes --print-out-paths .#docker) ./memejoin-rs.tar.gz - cp $(nix build --extra-experimental-features nix-command --extra-experimental-features flakes --print-out-paths .#docker) ./memejoin-rs.tar.gz
volumes:
- ${AGENT_NIX_STORE_PATH}:/nix
publish-image: publish-image:
when: when:
- event: tag event: tag
branch: master
image: docker image: docker
secrets: [ forgejo_token ] secrets: [ forgejo_token ]
commands: commands:
@ -20,3 +23,4 @@ steps:
- 'docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}' - 'docker image push git.spacegirl.nl/${CI_REPO}:${CI_COMMIT_TAG}'
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- ${AGENT_NIX_STORE_PATH}:/nix

View File

@ -8,7 +8,7 @@
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system: flake-utils.lib.eachDefaultSystem (system:
let let
tag = "0.1.4_3-alpha"; tag = "v0.1.4_4-alpha";
overlays = [ (import rust-overlay) ]; overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system overlays; inherit system overlays;