Skip to content

Commit

Permalink
Set up CI to automatically update Nixpkgs (#12)
Browse files Browse the repository at this point in the history
Yet untested; let's see it work or fail.
  • Loading branch information
philiptaron committed Mar 19, 2024
2 parents c021f18 + 704bb49 commit 7bc21c7
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Update Nixpkgs pin
on:
workflow_dispatch: # Allows triggering manually
schedule:
- cron: '47 14 * * *' # runs every day at 14:47 UTC (chosen somewhat randomly)

jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: cachix/install-nix-action@v26

- name: update
run: |
nix-build -A pkgs.npins
result/bin/npins update nixpkgs
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automated Nixpkgs update"
branch: auto-nixpkgs-update
title: "Automated Nixpkgs update"
body: "Update the pinned Nixpkgs automatically"
3 changes: 3 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ build // {

inherit build;

# Used by CI and good for debugging
inherit pkgs;

shell = pkgs.mkShell {
env.NIX_CHECK_BY_NAME_EXPR_PATH = toString runtimeExprPath;
env.NIX_PATH = "test-nixpkgs=${toString testNixpkgsPath}:test-nixpkgs/lib=${toString nixpkgsLibPath}";
Expand Down

0 comments on commit 7bc21c7

Please sign in to comment.