Skip to content

Commit eab0cac

Browse files
authored
Merge pull request #201 from DeterminateSystems/secure-packages
Switch to secure packages
2 parents 3ede4f8 + efd19a7 commit eab0cac

File tree

6 files changed

+51
-30
lines changed

6 files changed

+51
-30
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ jobs:
88
build-artifacts:
99
runs-on: ${{ matrix.systems.runner }}
1010
permissions:
11-
id-token: "write"
12-
contents: "read"
11+
id-token: write
12+
contents: read
1313
env:
1414
ARTIFACT_KEY: flake-checker-${{ matrix.systems.system }}
1515
strategy:
@@ -18,9 +18,6 @@ jobs:
1818
- nix-system: aarch64-darwin
1919
runner: macos-15
2020
system: ARM64-macOS
21-
- nix-system: x86_64-darwin
22-
runner: macos-13
23-
system: X64-macOS
2421
- nix-system: aarch64-linux
2522
runner: ubuntu-24.04-arm
2623
system: ARM64-Linux
@@ -38,9 +35,6 @@ jobs:
3835
uses: DeterminateSystems/flakehub-cache-action@main
3936

4037
- name: Build and cache dev shell for ${{ matrix.systems.nix-system }} on ${{ matrix.systems.runner }}
41-
# We still support this system but caching the dev shell fails due to system support mismatch,
42-
# and we don't really need this cached anyway
43-
if: ${{ matrix.systems.nix-system != 'x86_64-darwin' }}
4438
run: |
4539
nix build -L ".#devShells.${{ matrix.systems.nix-system }}.default"
4640

.github/workflows/ci.yaml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
checks:
1010
name: Nix and Rust checks
1111
runs-on: ubuntu-24.04
12+
permissions:
13+
id-token: write
14+
contents: read
1215
steps:
1316
- uses: actions/checkout@v4
1417
- uses: DeterminateSystems/determinate-nix-action@main
@@ -18,15 +21,18 @@ jobs:
1821
with:
1922
fail-mode: true
2023
- name: Check Nix formatting
21-
run: nix develop -c check-nixpkgs-fmt
24+
run: nix develop -c check-nix-fmt
2225
- name: Check Rust formatting
23-
run: nix develop -c check-rustfmt
26+
run: nix develop -c check-rust-fmt
2427
- name: Clippy
2528
run: nix develop -c cargo clippy
2629

2730
rust-tests:
2831
name: Test Rust
2932
runs-on: ubuntu-24.04
33+
permissions:
34+
id-token: write
35+
contents: read
3036
steps:
3137
- uses: actions/checkout@v4
3238
- uses: DeterminateSystems/determinate-nix-action@main
@@ -37,6 +43,9 @@ jobs:
3743
check-flake-cel-condition:
3844
name: Check flake.lock test (CEL condition)
3945
runs-on: ubuntu-24.04
46+
permissions:
47+
id-token: write
48+
contents: read
4049
steps:
4150
- uses: actions/checkout@v4
4251
- uses: DeterminateSystems/determinate-nix-action@main
@@ -51,6 +60,9 @@ jobs:
5160
check-flake-dirty:
5261
name: Check flake.lock test (dirty 😈)
5362
runs-on: ubuntu-24.04
63+
permissions:
64+
id-token: write
65+
contents: read
5466
steps:
5567
- uses: actions/checkout@v4
5668
- uses: DeterminateSystems/determinate-nix-action@main
@@ -62,6 +74,9 @@ jobs:
6274
check-flake-clean:
6375
name: Check flake.lock test (clean 👼)
6476
runs-on: ubuntu-24.04
77+
permissions:
78+
id-token: write
79+
contents: read
6580
steps:
6681
- uses: actions/checkout@v4
6782
- uses: DeterminateSystems/determinate-nix-action@main
@@ -74,6 +89,9 @@ jobs:
7489
name: Check flake.lock test (dirty 😈 plus fail mode activated)
7590
runs-on: ubuntu-24.04
7691
if: false
92+
permissions:
93+
id-token: write
94+
contents: read
7795
steps:
7896
- uses: actions/checkout@v4
7997
- uses: DeterminateSystems/determinate-nix-action@main

.github/workflows/ref-statuses.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
jobs:
88
check-ref-statuses:
99
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
contents: read
1013
steps:
1114
- uses: actions/checkout@v4
1215

.github/workflows/update-flake-lock.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
jobs:
99
lockfile:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: read
1114
steps:
1215
- uses: actions/checkout@v4
1316
- uses: DeterminateSystems/determinate-nix-action@main

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
inputs = {
3-
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0";
3+
nixpkgs.url = "https://flakehub.com/f/DeterminateSystems/secure/0";
44

55
fenix = {
66
url = "https://flakehub.com/f/nix-community/fenix/0";
@@ -27,7 +27,6 @@
2727
supportedSystems = [
2828
"x86_64-linux"
2929
"aarch64-linux"
30-
"x86_64-darwin"
3130
"aarch64-darwin"
3231
];
3332

@@ -87,7 +86,10 @@
8786
flake-checker = pkgs.naerskLib.buildPackage (
8887
{
8988
name = "flake-checker";
90-
src = self;
89+
src = builtins.path {
90+
name = "flake-checker-src";
91+
path = self;
92+
};
9193
doCheck = true;
9294
nativeBuildInputs = with pkgs; [ ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
9395
}
@@ -110,18 +112,18 @@
110112
{
111113
default =
112114
let
113-
check-nixpkgs-fmt = pkgs.writeShellApplication {
114-
name = "check-nixpkgs-fmt";
115+
check-nix-fmt = pkgs.writeShellApplication {
116+
name = "check-nix-fmt";
115117
runtimeInputs = with pkgs; [
116118
git
117-
nixpkgs-fmt
119+
nixfmt-rfc-style
118120
];
119121
text = ''
120-
nixpkgs-fmt --check "$(git ls-files '*.nix')"
122+
git ls-files '*.nix' | xargs nixfmt --check
121123
'';
122124
};
123-
check-rustfmt = pkgs.writeShellApplication {
124-
name = "check-rustfmt";
125+
check-rust-fmt = pkgs.writeShellApplication {
126+
name = "check-rust-fmt";
125127
runtimeInputs = with pkgs; [ rustToolchain ];
126128
text = "cargo fmt --check";
127129
};
@@ -159,16 +161,15 @@
159161
cargo-watch
160162
rust-analyzer
161163

162-
# Nix
163-
nixpkgs-fmt
164-
165164
# CI checks
166-
check-nixpkgs-fmt
167-
check-rustfmt
165+
check-nix-fmt
166+
check-rust-fmt
168167

169168
# Scripts
170169
get-ref-statuses
171170
update-readme
171+
172+
self.formatter.${system}
172173
];
173174

174175
env = {
@@ -178,5 +179,7 @@
178179
};
179180
}
180181
);
182+
183+
formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-rfc-style);
181184
};
182185
}

0 commit comments

Comments
 (0)