mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
flake: partition dev dependencies
This removes the need for end-users to manually set `nixvim.inputs.devshell.follows = ""` (etc) We offload evaluation of some of our flake modules into a `dev` partition submodule. - When its not needed, this submodule is not evaluated. - When it is needed, it fetches extra inputs from `flake/dev/flake.nix` as part of evaluating the submodule. See https://flake.parts/options/flake-parts-partitions.html
This commit is contained in:
parent
0ab9947137
commit
6d10fc0c87
16 changed files with 366 additions and 285 deletions
39
.github/workflows/update.yml
vendored
39
.github/workflows/update.yml
vendored
|
@ -6,10 +6,14 @@ on:
|
|||
# Allow manual triggering
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
lock:
|
||||
root_lock:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Update flake.lock
|
||||
description: Update root flake.lock
|
||||
dev_lock:
|
||||
type: boolean
|
||||
default: true
|
||||
description: Update dev flake.lock
|
||||
generate:
|
||||
type: boolean
|
||||
default: true
|
||||
|
@ -100,9 +104,9 @@ jobs:
|
|||
git fetch origin "$pr_branch"
|
||||
git branch --set-upstream-to "origin/$pr_branch"
|
||||
|
||||
- name: Update flake.lock
|
||||
id: flake_lock
|
||||
if: inputs.lock || github.event_name == 'schedule'
|
||||
- name: Update root flake.lock
|
||||
id: root_flake_lock
|
||||
if: inputs.root_lock || github.event_name == 'schedule'
|
||||
run: |
|
||||
old=$(git show --no-patch --format=%h)
|
||||
nix flake update --commit-lock-file
|
||||
|
@ -113,6 +117,22 @@ jobs:
|
|||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Update dev flake.lock
|
||||
id: dev_flake_lock
|
||||
if: inputs.dev_lock || github.event_name == 'schedule'
|
||||
run: |
|
||||
root_nixpkgs=$(nix eval -f . 'inputs.nixpkgs.rev')
|
||||
old=$(git show --no-patch --format=%h)
|
||||
nix flake update --commit-lock-file \
|
||||
--override-input nixpkgs "github:NixOS/nixpkgs/$root_nixpkgs" \
|
||||
--flake './flake/dev'
|
||||
new=$(git show --no-patch --format=%h)
|
||||
if [ "$old" != "$new" ]; then
|
||||
echo "body<<EOF" >> "$GITHUB_OUTPUT"
|
||||
git show --no-patch --format=%b >> "$GITHUB_OUTPUT"
|
||||
echo "EOF" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Update generated files
|
||||
id: generate
|
||||
if: inputs.generate || github.event_name == 'schedule'
|
||||
|
@ -185,9 +205,14 @@ jobs:
|
|||
title: |
|
||||
[${{ github.ref_name }}] Update flake.lock & generated files
|
||||
body: |
|
||||
## Flake lockfile
|
||||
## Root lockfile
|
||||
```
|
||||
${{ steps.flake_lock.outputs.body || 'No changes' }}
|
||||
${{ steps.root_flake_lock.outputs.body || 'No changes' }}
|
||||
```
|
||||
|
||||
## Dev lockfile
|
||||
```
|
||||
${{ steps.dev_flake_lock.outputs.body || 'No changes' }}
|
||||
```
|
||||
|
||||
## Generate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue