diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c65528..f3659db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,6 +66,21 @@ jobs: restore-keys: nix-gitv3-cache- - name: nix flake check run: nix flake check -L --show-trace + - name: Build packages for Cachix + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + run: nix build .#cachix-packages -L + # Intentionally install Cachix late: build artifacts are cached by Magic + # Nix Cache, only the runtime closure of cachix-packages goes to the + # public Cachix cache. + - name: Install Cachix + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + uses: cachix/cachix-action@v14 + with: + name: doom-emacs-unstraightened + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - name: Push to Cachix + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + run: readlink result | cachix push doom-emacs-unstraightened - name: Push changes if: github.event_name == 'schedule' || ( github.event_name == 'workflow_dispatch' && inputs.updateFlakeLock ) run: git push diff --git a/flake.nix b/flake.nix index c09e1ea..741f944 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,15 @@ doomLocalDir = "~/.local/share/nix-doom-unstraightened"; profileName = ""; }).doomEmacs; + # TODO: cache more packages, cache for more Emacsen. + cachix-packages = pkgs.linkFarm "unstraightened-cachix-packages" { + full-emacs29 = (doomFromPackages pkgs { + emacs = pkgs.emacs29; + doomDir = ./doomdirs/minimal; + doomLocalDir = "~/.local/share/nix-doom-unstraightened"; + full = true; + }).doomEmacs; + }; }); overlays.default = final: prev: { doomEmacs = args: (doomFromPackages final args).doomEmacs;