diff --git a/.github/renovate/customManagers.json5 b/.github/renovate/customManagers.json5 index 09c34774..79aa4f20 100644 --- a/.github/renovate/customManagers.json5 +++ b/.github/renovate/customManagers.json5 @@ -2,19 +2,14 @@ "$schema": "https://docs.renovatebot.com/renovate-schema.json", "regexManagers": [ { - "description": "Process various dependencies in YAML files", - "fileMatch": ["\\.ya?ml$"], + "description": ["Process various dependencies in YAML files"], + "fileMatch": [".+\\.ya?ml$",".+\\.nix$"], "matchStrings": [ - // Inline - "\\S+: \"?(?[^\"\\s]+)\"? # ?renovate: depName=(?\\S+)( datasource=(?\\S+))?( versioning=(?\\S+))?( extractVersion=(?\\S+))?", - // Newline - "(?m:^\\s+# ?renovate: depName=(?\\S+)( datasource=(?\\S+))?( versioning=(?\\S+))?( extractVersion=(?\\S+))?\\n[ \\t ]*? \\S+: \"?(?[^\" ]+)\"?$)", - // Old style newline - "(?m:^\\s+# ?renovate: datasource=(?\\S+) depName=(?\\S+)( versioning=(?\\S+))?( versionTemplate=(?\\S+))?\\n[ \\t ]*? \\S+: \"?(?[^\" ]+)\"?$)" + "# renovate: datasource=(?.*?) depName=(?.*?)( versioning=(?.*=?))?( versionTemplate=(?.*=?))?\\n.*(\"?(?[^\"\\n]+=?)\"?)", ], "datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}", "versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}", - "extractVersionTemplate": "{{#if extractVersion}}{{{extractVersion}}}{{else}}^v?(?.*)${{/if}}" + "extractVersionTemplate": "{{#if versionTemplate}}{{{versionTemplate}}}{{else}}{{/if}}" } ] } diff --git a/homes/modules/devops/default.nix b/homes/modules/devops/default.nix index d23a71a7..791608f8 100644 --- a/homes/modules/devops/default.nix +++ b/homes/modules/devops/default.nix @@ -31,6 +31,7 @@ in { minio-client opentofu pulumi-bin + talosctl terraform ]; diff --git a/hosts/odin/default.nix b/hosts/odin/default.nix index 171724f0..f86f8e54 100644 --- a/hosts/odin/default.nix +++ b/hosts/odin/default.nix @@ -24,7 +24,6 @@ brews = [ "postgresql@16" "talhelper" - "talosctl" ]; casks = [ "1password" diff --git a/pkgs/Makefile b/pkgs/Makefile new file mode 100644 index 00000000..6a627b84 --- /dev/null +++ b/pkgs/Makefile @@ -0,0 +1,6 @@ +# Makefile to quickly iterate on building the overlays +build: + nix-build -E 'with import {}; callPackage ./default.nix {}' + +clean: + rm result* diff --git a/pkgs/default.nix b/pkgs/default.nix index b69afae9..e9a974aa 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -1,3 +1,4 @@ {pkgs ? import {}}: rec { tesla-auth = pkgs.callPackage ./tesla-auth.nix {}; + talosctl = pkgs.callPackage ./talosctl.nix {}; } diff --git a/pkgs/talosctl.nix b/pkgs/talosctl.nix new file mode 100644 index 00000000..5eb321b6 --- /dev/null +++ b/pkgs/talosctl.nix @@ -0,0 +1,52 @@ +{ + lib, + buildGo122Module, + fetchFromGitHub, + installShellFiles, +}: +buildGo122Module rec { + pname = "talosctl"; + # renovate: datasource=docker depName=ghcr.io/siderolabs/installer + version = "1.6.6"; + + src = fetchFromGitHub { + owner = "siderolabs"; + repo = "talos"; + rev = "v${version}"; + # hash = lib.fakeHash; + hash = "sha256-94oQe0wmrDU9MDWA1IdHDXu6ECtzQFHPh6dZhOvidUg=="; + }; + + # vendorHash = lib.fakeHash; + vendorHash = "sha256-raBqjLoH7DwA8ZaO1tIR1JRWb27lHusHAwqJ5UQhxt4="; + + ldflags = ["-s" "-w"]; + + # This is needed to deal with workspace issues during the build + overrideModAttrs = _: { + preConfigure = '' + export GOWORK=off + ''; + }; + GOWORK = "off"; + + subPackages = ["cmd/talosctl"]; + + nativeBuildInputs = [installShellFiles]; + + postInstall = '' + installShellCompletion --cmd talosctl \ + --bash <($out/bin/talosctl completion bash) \ + --fish <($out/bin/talosctl completion fish) \ + --zsh <($out/bin/talosctl completion zsh) + ''; + + doCheck = false; # no tests + + meta = with lib; { + description = "A CLI for out-of-band management of Kubernetes nodes created by Talos"; + homepage = "https://www.talos.dev/"; + license = licenses.mpl20; + maintainers = with maintainers; [flokli]; + }; +}