Skip to content

Commit 10f6e6a

Browse files
authored
Fix hashes from update + use determinate nix + caching (#2)
1 parent 12029ea commit 10f6e6a

File tree

5 files changed

+24
-14
lines changed

5 files changed

+24
-14
lines changed

.github/workflows/test-build.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Adapted from https://github.com/brianmay/penguin_memories/blob/main/.github/workflows/update_hashes.yml
12
name: Test building Nix packages
23
on:
34
workflow_dispatch:
@@ -9,6 +10,7 @@ on:
910
jobs:
1011
build:
1112
strategy:
13+
fail-fast: false
1214
matrix:
1315
target:
1416
- os: Linux x86_64
@@ -23,9 +25,19 @@ jobs:
2325
steps:
2426
- uses: actions/checkout@v4
2527
- name: Setup Nix
26-
uses: cachix/install-nix-action@v31
28+
uses: DeterminateSystems/determinate-nix-action@v3.13.2
2729
with:
28-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
29-
- run: nix build --impure
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Nix binary cache
32+
uses: nix-community/cache-nix-action@v6.1.3
33+
with:
34+
primary-key: nix-${{ matrix.target.os }}-${{ hashFiles('**/*.nix', 'flake.lock') }}
35+
restore-prefixes-first-match: nix-${{ matrix.target.os }}-
36+
- name: Check Nix flake
37+
run: nix flake check -L --impure
38+
env:
39+
NIXPKGS_ALLOW_UNFREE: 1
40+
- name: Build Nix flake
41+
run: nix build --impure
3042
env:
3143
NIXPKGS_ALLOW_UNFREE: 1

default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Overlay.
22

3-
self: super: {
4-
formal = super.callPackage ./pkgs/formal.nix { };
3+
final: prev: {
4+
formal = prev.callPackage ./pkgs/formal.nix { };
55
}

pkgs/darwin.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@
1010

1111
let
1212
inherit (stdenv.hostPlatform) system;
13-
fetch = hash: fetchurl {
14-
url = "https://static-assets.formalcloud.net/desktop-app/darwin/formal-${version}.pkg";
15-
inherit hash;
16-
};
1713

1814
platforms = [ "aarch64-darwin" "x86_64-darwin" ];
1915
in
2016
stdenv.mkDerivation {
2117
inherit pname version meta;
22-
23-
src = fetch "sha256-OnR3t+/Et9CWuomWZl+KyL/vdO+MOZyhJnyM6WkIVZY=";
18+
src = fetchurl {
19+
url = "https://static-assets.formalcloud.net/desktop-app/darwin/formal-${version}.pkg";
20+
hash = "sha256-Qia9kOzQAWo6fLJHJmVz+aBZqYXnJLDV8ypfb5izNJk=";
21+
};
2422

2523
nativeBuildInputs = [
2624
cpio

pkgs/formal.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
let
1515
pname = "formal";
16-
version = "0.4.1";
16+
version = "0.4.3";
1717
meta = {
1818
description = "Formal Desktop";
1919
homepage = "https://joinformal.com";

pkgs/linux.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ let
1818
};
1919

2020
sources = rec {
21-
aarch64-linux = fetch "arm64" "sha256-GrHTSo0uIx6KzB3xO8tXKLNdBRVf71Awkgniwbvag1w=";
22-
x86_64-linux = fetch "amd64" "sha256-9FwakjTp1MJDl7ioyobgf38ycdwmOYi+KThcD5ZOOhY=";
21+
aarch64-linux = fetch "arm64" "sha256-cVZaIWLS+o+Z+/Wb1YfyIEZPowJaFMZIHTyPpYjguT8=";
22+
x86_64-linux = fetch "amd64" "sha256-4KFugcLbd+jwTTJf2f6FPe/gMKXjcB3GiAODwxKYBqs=";
2323
};
2424
platforms = builtins.attrNames sources;
2525
in

0 commit comments

Comments
 (0)