Skip to content

Commit b6a5b43

Browse files
Update nix flake inputs structure and add dependency update workflow for rv-nix-tools (#4109)
This pull request adapts the nix flake inputs structure regarding `nixpkgs` and `rv-nix-tools`. In particular, `nixpkgs` is now specified for inputs and transitive inputs by following an explicitly specified revision of `rv-nix-tools`. More thorough reasoning for this change is outlined in documentation added by this PR runtimeverification/rv-nix-tools#14. This change is done to make `nixpkgs` properly updatable by CI. In addition, this pull requests adapts the `update-deps.yml` workflow to also update `rv-nix-tools` that is used to implicitly specify the revision of `nixpkgs`. --- ###### Review checklist The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed. - [x] **Summary.** Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history. - [ ] **Documentation.** Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing. - [ ] **Tests.** Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests. - [ ] **Clean up.** The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes! --------- Co-authored-by: Jost Berthold <[email protected]>
1 parent abd4267 commit b6a5b43

File tree

4 files changed

+56
-9
lines changed

4 files changed

+56
-9
lines changed

.github/workflows/update-deps.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Update Version'
2+
on:
3+
push:
4+
branches:
5+
- '_update-deps/runtimeverification/rv-nix-tools'
6+
workflow_dispatch:
7+
# Stop in progress workflows on the same branch and same workflow to use latest committed code
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
14+
update-versions:
15+
name: 'Update Dependency Versions'
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: 'Check out code'
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: true
22+
token: ${{ secrets.JENKINS_GITHUB_PAT }}
23+
- name: 'Configure GitHub user'
24+
run: |
25+
git config user.name devops
26+
git config user.email [email protected]
27+
- name: 'Install Nix/Cachix'
28+
uses: cachix/install-nix-action@v19
29+
with:
30+
install_url: https://releases.nixos.org/nix/nix-2.13.3/install
31+
extra_nix_config: |
32+
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
33+
- uses: cachix/cachix-action@v12
34+
with:
35+
name: k-framework
36+
authToken: ${{ secrets.CACHIX_PUBLIC_TOKEN }}
37+
- name: 'Update nix flake inputs'
38+
run: |
39+
RV_NIX_TOOLS_VERSION=$(cat deps/rv-nix-tools)
40+
sed -i 's! rv-nix-tools.url = "github:runtimeverification/rv-nix-tools/[a-z0-9\.]*"! rv-nix-tools.url = "github:runtimeverification/rv-nix-tools/'"${RV_NIX_TOOLS_VERSION}"'"!' flake.nix
41+
nix flake update
42+
git add flake.nix flake.lock && git commit -m 'flake.{nix,lock}: update Nix derivations' || true
43+
- name: 'Push updates'
44+
run: git push

deps/rv-nix-tools

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
854d4f05ea78547d46e807b414faad64cea10ae4

flake.lock

Lines changed: 7 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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
description = "K Kore Language Haskell Backend";
33

44
inputs = {
5-
rv-utils.url = "github:runtimeverification/rv-nix-tools";
6-
nixpkgs.follows = "rv-utils/nixpkgs";
5+
rv-nix-tools.url = "github:runtimeverification/rv-nix-tools/854d4f05ea78547d46e807b414faad64cea10ae4";
6+
nixpkgs.follows = "rv-nix-tools/nixpkgs";
7+
78
z3 = {
89
url = "github:Z3Prover/z3/z3-4.13.4";
910
flake = false;
@@ -15,7 +16,7 @@
1516
};
1617
};
1718

18-
outputs = { self, rv-utils, nixpkgs, z3, flake-utils, some-cabal-hashes-lib }:
19+
outputs = { self, rv-nix-tools, nixpkgs, z3, flake-utils, some-cabal-hashes-lib }:
1920
let
2021
z3Overlay = final: prev: {
2122
z3 = prev.z3.overrideAttrs (_: {

0 commit comments

Comments
 (0)