Skip to content

Commit

Permalink
Set up CI to automatically update Nixpkgs
Browse files Browse the repository at this point in the history
  • Loading branch information
infinisil committed Mar 19, 2024
1 parent 0f17d21 commit 704bb49
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 704bb49

Please sign in to comment.