From 704bb49a85b632a11f7692bb08e9e4b00af84fcc Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 19 Mar 2024 01:21:12 +0100 Subject: [PATCH] Set up CI to automatically update Nixpkgs --- .github/workflows/update.yml | 26 ++++++++++++++++++++++++++ default.nix | 3 +++ 2 files changed, 29 insertions(+) create mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..56e42fa --- /dev/null +++ b/.github/workflows/update.yml @@ -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" diff --git a/default.nix b/default.nix index c62a0df..451d134 100644 --- a/default.nix +++ b/default.nix @@ -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}";