Skip to content

Commit fd1420f

Browse files
authored
Add support for pushing to Attic (#1)
* Add support for pushing to Attic * fmt/clippy * Fix attic dependency * Pass ssh private key * Try to inherit secrets * Fix static build * Fix default package * Fix daemonizing * Fix clippy * Update nix.conf * Add --use-attic flag * --use-attic -> --use-flakehub * Handle project not existing * Handle Attic init failure * Skip .chroot paths * Update netrc * Downgrade to Nixpkgs 23.05 to fix static builds * Use rust 1.70 We need 1.70, but 1.69 is the default in Nixpkgs 23.05. * Rename stuff * Use magic-nix-cache-priv * Hack
1 parent 369a0a0 commit fd1420f

File tree

17 files changed

+1745
-110
lines changed

17 files changed

+1745
-110
lines changed

.github/workflows/build.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14+
- uses: webfactory/ssh-agent@v0.7.0
15+
with:
16+
ssh-private-key: ${{ secrets.LOL_DETSYS_CI_SSH_PRIVATE_KEY }}
17+
1418
- uses: DeterminateSystems/nix-installer-action@main
1519

1620
- uses: DeterminateSystems/magic-nix-cache-action@main
@@ -32,6 +36,10 @@ jobs:
3236
steps:
3337
- uses: actions/checkout@v3
3438

39+
- uses: webfactory/ssh-agent@v0.7.0
40+
with:
41+
ssh-private-key: ${{ secrets.LOL_DETSYS_CI_SSH_PRIVATE_KEY }}
42+
3543
- uses: DeterminateSystems/flake-checker-action@main
3644

3745
- uses: DeterminateSystems/nix-installer-action@main
@@ -55,11 +63,15 @@ jobs:
5563
steps:
5664
- uses: actions/checkout@v3
5765

66+
- uses: webfactory/ssh-agent@v0.7.0
67+
with:
68+
ssh-private-key: ${{ secrets.LOL_DETSYS_CI_SSH_PRIVATE_KEY }}
69+
5870
- uses: DeterminateSystems/flake-checker-action@main
5971

6072
- uses: DeterminateSystems/nix-installer-action@main
6173

62-
- uses: DeterminateSystems/magic-nix-cache-action@main
74+
- uses: DeterminateSystems/magic-nix-cache-action-priv@attic-v2
6375

6476
- name: Build package
6577
run: "nix build .# -L --fallback"

.github/workflows/checks.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v3
1313

14+
- uses: webfactory/ssh-agent@v0.7.0
15+
with:
16+
ssh-private-key: ${{ secrets.LOL_DETSYS_CI_SSH_PRIVATE_KEY }}
17+
1418
- name: Install Nix
1519
uses: DeterminateSystems/nix-installer-action@main
1620
- uses: DeterminateSystems/magic-nix-cache-action@main

.github/workflows/release-prs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
jobs:
1212
build:
1313
uses: ./.github/workflows/build.yaml
14+
secrets: inherit
1415

1516
release:
1617
needs: build
@@ -19,7 +20,7 @@ jobs:
1920
# Only intra-repo PRs are allowed to have PR artifacts uploaded
2021
# We only want to trigger once the upload once in the case the upload label is added, not when any label is added
2122
if: |
22-
github.event.pull_request.head.repo.full_name == 'DeterminateSystems/magic-nix-cache'
23+
github.event.pull_request.head.repo.full_name == 'DeterminateSystems/magic-nix-cache-priv'
2324
&& (
2425
(github.event.action == 'labeled' && github.event.label.name == 'upload to s3')
2526
|| (github.event.action != 'labeled' && contains(github.event.pull_request.labels.*.name, 'upload to s3'))

0 commit comments

Comments
 (0)