From bb66ae9870f7c9d921de5176b688764d18d27b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 27 Aug 2025 06:23:05 +0000 Subject: [PATCH] work: +chronoctl --- flake.nix | 3 ++- pkgs/chronoctl.nix | 43 +++++++++++++++++++++++++++++++++++++++++ shared/work/default.nix | 1 + 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 pkgs/chronoctl.nix diff --git a/flake.nix b/flake.nix index 3227cd8..10688ac 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,7 @@ nicer = super.callPackage ./pkgs/nicer.nix { }; tmuxbash = super.callPackage ./pkgs/tmuxbash.nix { }; vanta-agent = super.callPackage ./pkgs/vanta-agent.nix { }; + chronoctl = super.callPackage ./pkgs/chronoctl.nix { }; pkgs-unstable = import nixpkgs-unstable { inherit (super) system; @@ -323,7 +324,7 @@ in { packages.x86_64-linux = { - inherit (pkgs) weather gamja; + inherit (pkgs) weather gamja chronoctl; }; } ); diff --git a/pkgs/chronoctl.nix b/pkgs/chronoctl.nix new file mode 100644 index 0000000..9a85d78 --- /dev/null +++ b/pkgs/chronoctl.nix @@ -0,0 +1,43 @@ +{ + stdenv, + fetchurl, +}: + +let + version = "0.71.0"; + sources = { + x86_64-linux = { + url = "https://storage.googleapis.com/chronosphere-release/${version}/chronoctl-linux-amd64"; + # nix store prefetch-file --hash-type sha256 https://storage.googleapis.com/chronosphere-release/0.71.0/chronoctl-linux-amd64 + hash = "sha256-SE7wuSRh3lwx7IBzqMsV3hy4DeHLfbs60uHhhIsLZMs="; + }; + + aarch64-linux = { + url = "https://storage.googleapis.com/chronosphere-release/${version}/chronoctl-linux-arm64"; + # Replace with the real hash (SRI). For a quick prefetch: + # nix store prefetch-file --hash-type sha256 https://storage.googleapis.com/chronosphere-release/0.71.0/chronoctl-linux-arm64 + hash = "sha256-iM9fLvpRdpvnxN+Rto1zh5BhwwEkLSuhPzODYd2TtJo="; + }; + }; + + srcInfo = + sources.${stdenv.hostPlatform.system} + or (throw "chronoctl: unsupported system ${stdenv.hostPlatform.system}"); +in + +stdenv.mkDerivation { + pname = "chronoctl"; + inherit version; + + src = fetchurl { + inherit (srcInfo) url hash; + }; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + install -Dm755 "$src" "$out/bin/chronoctl" + runHook postInstall + ''; +} diff --git a/shared/work/default.nix b/shared/work/default.nix index 8bcdae5..f16a157 100644 --- a/shared/work/default.nix +++ b/shared/work/default.nix @@ -13,6 +13,7 @@ mysql80 kubectl kubectx + chronoctl terraform github-cli claude-code