ci(nix): push Nix builds to a Cachix binary cache

Every Nix build of main and of each release tag now goes to
proton-drive-linux.cachix.org, so installing the flake downloads the
client instead of compiling it. The flake names the cache in nixConfig
for nix run and nix shell, and the install guide shows the nix.settings
a NixOS system build needs, since it does not read an input's
nixConfig. A fork's pull request has no token and only pulls.
This commit is contained in:
nvrl committed 2026-10-11 23:02:22 +02:00
1 parent 8b7d7ae87f
commit f6c651b06b
6 files changed
+52 -1

No files matched your search

+7
View File
@@ -38,6 +38,13 @@ jobs:
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
# Pulls from the project's binary cache, and pushes what this run built
# when the token is there; a fork's pull request has none and only pulls.
- uses: cachix/cachix-action@v17
with:
name: proton-drive-linux
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Check the flake - name: Check the flake
run: nix flake check --print-build-logs --no-build run: nix flake check --print-build-logs --no-build
+7
View File
@@ -240,6 +240,13 @@ jobs:
- uses: cachix/install-nix-action@v31 - uses: cachix/install-nix-action@v31
# Pulls from the project's binary cache, and pushes what this run built
# when the token is there; a fork's pull request has none and only pulls.
- uses: cachix/cachix-action@v17
with:
name: proton-drive-linux
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build the flake - name: Build the flake
run: nix build --print-build-logs .#proton-drive-linux run: nix build --print-build-logs .#proton-drive-linux
+6
View File
@@ -11,6 +11,12 @@ scratch (user data in `staging/` and `recovery/` is never touched by this).
## [Unreleased] ## [Unreleased]
### Added
- **A binary cache for the Nix flake.** Every release and every build of `main` is uploaded to
`proton-drive-linux.cachix.org`, so NixOS installs download the client instead of compiling
it. See [Install → Binary cache](INSTALL.md#binary-cache).
([#37](https://github.com/narrrl/proton-drive-linux/issues/37))
## [3.3.0] — 2026-10-11 ## [3.3.0] — 2026-10-11
Schema: **42**, unchanged. Schema: **42**, unchanged.
+2 -1
View File
@@ -154,7 +154,8 @@ Releases are cut from `main` by pushing a `v*` tag. `.github/workflows/release.y
`packaging/PKGBUILD` agree; `packaging/PKGBUILD` agree;
2. runs the quality gates; 2. runs the quality gates;
3. builds the release binaries and packages a `.tar.gz`, a `.deb` and a GPG-signed `.rpm`, and 3. builds the release binaries and packages a `.tar.gz`, a `.deb` and a GPG-signed `.rpm`, and
builds the Nix flake at the tag, which is what a flake input pinned to `vX.Y.Z` gets; builds the Nix flake at the tag, which is what a flake input pinned to `vX.Y.Z` gets, and
pushes it to the `proton-drive-linux` Cachix cache (secret `CACHIX_AUTH_TOKEN`);
4. publishes them as a GitHub release, with the version's section of `docs/CHANGELOG.md` as the 4. publishes them as a GitHub release, with the version's section of `docs/CHANGELOG.md` as the
notes; notes;
5. calls `.github/workflows/aur.yml`, which updates and pushes the AUR recipes and commits them 5. calls `.github/workflows/aur.yml`, which updates and pushes the AUR recipes and commits them
+20
View File
@@ -112,6 +112,26 @@ inputs.proton-drive-linux.url = "github:narrrl/proton-drive-linux/v3.3.0";
Each release tag is built with Nix before the release is published. Each release tag is built with Nix before the release is published.
#### Binary cache
CI uploads every build of `main` and of each release tag to a Cachix binary cache, so Nix can
download the client instead of compiling it. A system build does not read a flake input's cache
settings, so add the cache to your NixOS configuration once:
```nix
nix.settings = {
substituters = [ "https://proton-drive-linux.cachix.org" ];
trusted-public-keys = [
"proton-drive-linux.cachix.org-1:w1+3pXVXyTlqkFGn3dWpUhlaJtyGhSm3X0mFwfa++AA="
];
};
```
The cache holds the build against the `nixpkgs` this flake locks. Setting
`inputs.proton-drive-linux.inputs.nixpkgs.follows = "nixpkgs"` builds against yours instead, which
the cache does not have, so Nix compiles it. `nix run` and `nix shell` ask whether to use the
cache the first time; answer yes, or run `cachix use proton-drive-linux`.
To try it without changing your system, run the app straight from the flake: To try it without changing your system, run the app straight from the flake:
```bash ```bash
+10
View File
@@ -1,6 +1,16 @@
{ {
description = "Unofficial Proton Drive client for Linux: files-on-demand FUSE mount, CLI, GTK4 app and tray"; description = "Unofficial Proton Drive client for Linux: files-on-demand FUSE mount, CLI, GTK4 app and tray";
# CI pushes every build of `main` and of each release tag here, so installing
# downloads the client instead of compiling it. Nix asks before it uses a
# flake's caches unless the user trusts them (docs/INSTALL.md).
nixConfig = {
extra-substituters = [ "https://proton-drive-linux.cachix.org" ];
extra-trusted-public-keys = [
"proton-drive-linux.cachix.org-1:w1+3pXVXyTlqkFGn3dWpUhlaJtyGhSm3X0mFwfa++AA="
];
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = outputs =