diff --git a/docs/nix_dev_env.md b/docs/nix_dev_env.md --- a/docs/nix_dev_env.md +++ b/docs/nix_dev_env.md @@ -132,6 +132,12 @@ - [Services deployment](./nix_services_deployment.md) - [Tunnelbroker](./nix_services_deployment.md#tunnelbroker) +## Development Environment workflows + +- [Nix development workflows](./nix_workflows.md) + - [Updating Nixpkgs](./nix_workflows.md#updating-nixpkgs) + - [Pushing development packages to Cachix](./nix_workflows.md#pushing-development-artifacts-to-cachix) + ## Using alternate shells with Nix Alternate shells such as zsh or fish can also be used with Nix. To use an alternate shell, run: diff --git a/docs/nix_workflows.md b/docs/nix_workflows.md new file mode 100644 --- /dev/null +++ b/docs/nix_workflows.md @@ -0,0 +1,33 @@ +# Nix + +## Updating Nixpkgs + +Nixpkgs is the official package repository for Nix. + +The `nixpkgs` input is a reference to the [NixOS/nixpkgs repository](https://github.com/NixOS/nixpkgs/), updating this input will checkout the latest git commit. To update our pin of Nixpkgs: + +``` +nix flake lock --update-input nixpkgs +``` + +## Pushing development artifacts to Cachix + +Cachix is an easy-to-use cache for Nix packages. Instead of having each developer build Comm-specific packages locally, we can populate those packages in a Cachix cache and pull down the prebuilt packages. + +### Authorizing with Cachix + +To configure token authorization for Cachix: + +``` +nix shell nixpkgs#cachix +cachix authtoken +``` + +### Pushing development shell to Cachix + +To build and push development artifacts to Cachix: + +``` +nix build .#devShells.default +cachix push comm ./result +```