Skip to content
TypeScript

docs: add nixpkgs installation instructions (#26750)

jan7b87466731bf
diff --git a/README.md b/README.md
index 36f558a79dc..6f6dab985e1 100644
--- a/README.md
+++ b/README.md
@@ -84,6 +84,16 @@ yay -S t3code-nightly-bin
The AUR packaging is maintained in this repository under [`packaging/aur`](./packaging/aur).
+#### Nix (nixpkgs)
+
+```bash
+nix profile add github:NixOS/nixpkgs/nixos-unstable#t3code
+```
+
+The package is maintained in [nixpkgs](https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/by-name/t3/t3code)
+and includes the desktop app (`t3code-desktop`) and the `t3` command.
+See [Nix installation](./docs/user/install.md#nix-nixpkgs) for NixOS configuration and updates.
+
## Some notes
We are very very early in this project. Expect bugs.
diff --git a/docs/user/install.md b/docs/user/install.md
index 3edf46d80ee..1e1693d0b32 100644
--- a/docs/user/install.md
+++ b/docs/user/install.md
@@ -65,18 +65,41 @@ update it with `git pull` and a rebuild.
Download a release from [GitHub Releases](https://github.com/pingdotgg/t3code/releases),
or use a package manager:
-| Platform | Install |
-| ------------------ | ---------------------------------- |
-| Windows | `winget install T3Tools.T3Code` |
-| macOS | `brew install --cask t3-code` |
-| Debian, Ubuntu | `sudo apt install ./T3-Code-*.deb` |
-| Arch Linux | `yay -S t3code-bin` |
-| Arch Linux nightly | `yay -S t3code-nightly-bin` |
+| Platform | Install |
+| ------------------ | ------------------------------------------------------------ |
+| Windows | `winget install T3Tools.T3Code` |
+| macOS | `brew install --cask t3-code` |
+| Debian, Ubuntu | `sudo apt install ./T3-Code-*.deb` |
+| Arch Linux | `yay -S t3code-bin` |
+| Arch Linux nightly | `yay -S t3code-nightly-bin` |
+| Nix | `nix profile add github:NixOS/nixpkgs/nixos-unstable#t3code` |
The `.deb` updates itself like the other desktop builds. It asks for your
password to install each update. If your desktop has no password prompt, the
update fails. Download the new `.deb` and install it the same way.
+### Nix (nixpkgs)
+
+T3 Code is maintained in [nixpkgs](https://github.com/NixOS/nixpkgs/tree/nixos-unstable/pkgs/by-name/t3/t3code).
+The command above installs from `nixos-unstable` and requires Nix 2.30 or later with
+`nix-command` and `flakes` enabled. Launch the desktop app with `t3code-desktop`;
+the package also includes the `t3` command.
+
+On NixOS, you can instead add the package to your system configuration, using
+a nixpkgs revision that includes `t3code`:
+
+```nix
+environment.systemPackages = [ pkgs.t3code ];
+```
+
+Apply the change with `sudo nixos-rebuild switch`. For Home Manager, add
+`pkgs.t3code` to `home.packages` and run `home-manager switch`.
+
+Update a profile installation with `nix profile upgrade t3code`. For NixOS or
+Home Manager, update your configuration's nixpkgs input or channel and rebuild.
+Nix manages both the desktop app and the bundled
+`t3` command; use Nix to update them instead of the in-app updater or `t3 update`.
+
### The `t3` command
The desktop app includes the `t3` command-line tool. To run it from any