Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
/.vscode
/.zed
*~

# direnv
.direnv/

# nix
/result
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Reference [the documentation](https://docs.temporal.io/cli) for detailed install
### Install via download

1. Download the version for your OS and architecture:
- [Linux amd64](https://temporal.download/cli/archive/latest?platform=linux&arch=amd64)
- [Linux arm64](https://temporal.download/cli/archive/latest?platform=linux&arch=arm64)
- [macOS amd64](https://temporal.download/cli/archive/latest?platform=darwin&arch=amd64)
- [macOS arm64](https://temporal.download/cli/archive/latest?platform=darwin&arch=arm64) (Apple silicon)
- [Windows amd64](https://temporal.download/cli/archive/latest?platform=windows&arch=amd64)
- [Linux amd64](https://temporal.download/cli/archive/latest?platform=linux&arch=amd64)
- [Linux arm64](https://temporal.download/cli/archive/latest?platform=linux&arch=arm64)
- [macOS amd64](https://temporal.download/cli/archive/latest?platform=darwin&arch=amd64)
- [macOS arm64](https://temporal.download/cli/archive/latest?platform=darwin&arch=arm64) (Apple silicon)
- [Windows amd64](https://temporal.download/cli/archive/latest?platform=windows&arch=amd64)
2. Extract the downloaded archive.
3. Add the `temporal` binary to your `PATH` (`temporal.exe` for Windows).

Expand All @@ -31,6 +31,27 @@ Reference [the documentation](https://docs.temporal.io/cli) for detailed install

The executable will be at `temporal` (`temporal.exe` for Windows).

### Build with Nix

1. [Install Nix](https://docs.determinate.systems/getting-started/individuals#install)
2. Clone repository
3. Switch to cloned directory, and run `nix build`

The executable will be at `result/bin/temporal`.

### Nix Development Environment

1. [Install Nix](https://docs.determinate.systems/getting-started/individuals#install)
2. Clone repository
3. Switch to cloned directory, and run `nix develop`

Go and related tools will be made available in this shell. This can be further automated by direnv:

1. Install direnv: `nix profile add nixpkgs#direnv`
2. Run `direnv allow` in the project directory

Now every time you enter the project directory, all the tools will be available.

## Usage

Reference [the documentation](https://docs.temporal.io/cli) for detailed usage information.
Expand Down
26 changes: 26 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
description = "Temporal Server";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
};

outputs =
inputs:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
forEachSupportedSystem =
f:
inputs.nixpkgs.lib.genAttrs supportedSystems (
system:
f {
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(import ./nix/go-override.nix) # https://github.com/NixOS/nixpkgs/pull/414434/files
];
};
}
);
in
{
packages = forEachSupportedSystem (
{ pkgs }:
let
inherit (pkgs) lib;
in
{
default = pkgs.temporal-cli.overrideAttrs {
version = "1.3.0";
src = lib.cleanSource ./.;
vendorHash = "sha256-AO6djBGm4cUZ1p1h3AMskNnJSxV0OSyOkvTLrpiVw8g=";
};
}
);

devShells = forEachSupportedSystem (
{ pkgs }:
{
default = pkgs.mkShellNoCC {
packages = with pkgs; [
go
gotools
golangci-lint
];
};
}
);
};
}
10 changes: 10 additions & 0 deletions nix/go-override.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
self: super: rec {
go_1_24 = super.go_1_24.overrideAttrs (old: rec {
version = "1.24.4";
src = super.fetchurl {
url = "https://go.dev/dl/go${version}.src.tar.gz";
hash = "sha256-WoaoOjH5+oFJC4xUIKw4T9PZWj5x+6Zlx7P5XR3+8rQ=";
};
});
go = go_1_24;
}