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