new regex parser for managing container versions with renovate

This commit is contained in:
Joseph Hanson 2024-07-27 14:18:12 -05:00
parent cc2e8bb5df
commit 0855f8f133
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
3 changed files with 44 additions and 16 deletions

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }: { lib, config, ... }:
with lib; with lib;
let let
cfg = config.mySystem.services.onepassword-connect; cfg = config.mySystem.services.onepassword-connect;
@ -6,6 +6,16 @@ in
{ {
options.mySystem.services.onepassword-connect = { options.mySystem.services.onepassword-connect = {
enable = mkEnableOption "onepassword-connect"; enable = mkEnableOption "onepassword-connect";
apiVersion = lib.mkOption {
type = lib.types.str;
# renovate: depName=docker.io/1password/connect-api datasource=docker
default = "1.7.2";
};
syncVersion = lib.mkOption {
type = lib.types.str;
# renovate: depName=docker.io/1password/connect-sync datasource=docker
default = "1.7.2";
};
credentialsFile = lib.mkOption { credentialsFile = lib.mkOption {
type = lib.types.path; type = lib.types.path;
}; };
@ -25,7 +35,7 @@ in
# Enable onepassword-connect containers. # Enable onepassword-connect containers.
virtualisation.oci-containers.containers = { virtualisation.oci-containers.containers = {
onepassword-connect-api = { onepassword-connect-api = {
image = "docker.io/1password/connect-api:1.7.2"; image = "docker.io/1password/connect-api:${cfg.apiVersion}";
autoStart = true; autoStart = true;
ports = [ "8080:8080" ]; ports = [ "8080:8080" ];
volumes = [ volumes = [
@ -35,7 +45,7 @@ in
}; };
onepassword-connect-sync = { onepassword-connect-sync = {
image = "docker.io/1password/connect-sync:1.7.2"; image = "docker.io/1password/connect-sync:${cfg.syncVersion}";
autoStart = true; autoStart = true;
ports = [ "8081:8080" ]; ports = [ "8081:8080" ];
volumes = [ volumes = [

View file

@ -1,13 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"nix": {
"enabled": true
},
"lockFileMaintenance": {
"enabled": true,
"extends": ["schedule:daily"]
}
}

31
renovate.json5 Normal file
View file

@ -0,0 +1,31 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
],
"nix": {
"enabled": true
},
"lockFileMaintenance": {
"enabled": true,
"extends": [
"schedule:daily"
]
},
"customManagers": [
{
"customType": "regex",
"description": "Process various dependencies in nix files",
"fileMatch": [
"\\.nix$"
],
"matchStrings": [
// Newline
"(?m:^[ \\t]*?# ?renovate: depName=(?<depName>\\S+)( datasource=(?<datasource>\\S+))?( versioning=(?<versioning>\\S+))?( extractVersion=(?<extractVersion>\\S+))?\\n[ \\t ]*?\\S+ = \"?(?<currentValue>[^\" ]+?)\";?$)"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
"extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^(?<version>.*)${{/if}}",
},
],
}