Nixpkgs/Automatic Updates: Difference between revisions
m Minor grammar/formatting |
SarahClark (talk | contribs) →nix-update by Mic92: Documented --version-regex including its quirks |
||
| Line 28: | Line 28: | ||
If you want functionality similar to that of unstableGitUpdater but with the additional handlers offered by nix-update, use: | If you want functionality similar to that of unstableGitUpdater but with the additional handlers offered by nix-update, use: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix">passthru.updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };</syntaxhighlight> | ||
passthru.updateScript = nix-update-script { extraArgs = [ "--version= | |||
</syntaxhighlight> | ==== Setting a custom for prefixed releases ==== | ||
<code>nix-updater</code> expects an all-numeric version such as <code>1.2.3</code> and fails when there's a prefix (<code>v1.2.3</code>). When that happens, you'll need to set a custom regex:<syntaxhighlight lang="nix"> | |||
passthru.updateScript = nix-update-script { | |||
extraArgs = [ "--version-regex=v([\\d.]+)" ]; | |||
}; | |||
</syntaxhighlight>Note there's only one capturing group (in parentheses). Due to a quirk in the updater, nesting capturing groups won't give the results you expect. The regex implicitly matches the whole line. | |||
=== Git Updater === | === Git Updater === | ||