Skip to content

Commit

Permalink
CI: write to Cachix
Browse files Browse the repository at this point in the history
This is only a starting point. For this to be more useful, we need to
build for multiple Emacsen. But I want to get a baseline for the size of
the closure first (as well as confirming it works in the first place).
  • Loading branch information
marienz committed May 19, 2024
1 parent b7b1a94 commit a406371
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a406371

Please sign in to comment.