Skip to content

Commit

Permalink
Doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nicknovitski committed Oct 21, 2024
1 parent 22132bb commit b1bba31
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 53 deletions.
45 changes: 0 additions & 45 deletions OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,48 +43,3 @@ Default value: not defined
A non-empty string representing the name of the configuration to use in the environment.

Default value: not defined

## Node.js

[https://nodejs.org/en](https://nodejs.org/en)

### javascript.node.corepack-shims

An array of strings which, if `javascript.node.enable` is true, are passed to `corepack enable`, creating [corepack](https://nodejs.org/api/corepack.html) package manager shims.

Currently, supported values are `"yarn"`, `"pnpm"`, and `"npm"`.

Default value: `[]`

### javascript.node.enable

Whether to add the Node.js runtime to the environment.

Default value: false

### javascript.node.env

If set, then the `NODE_ENV` variable is set to this value in the environment. The only valid values are `"production"`, `"development"`, and `"test"`.

Default value: unset

### javascript.node.package

If `javascript.volta.enable` is true, this package is added to the environment. There are [several alternative packages in nixpkgs](https://search.nixos.org/packages?from=0&size=50&sort=relevance&type=packages&query=nodejs-), such as `nodejs-slim` (which lacks npm), or `nodejs_22` (the latest version in the 22.x line).

Default value: `pkgs.nodejs`

## Volta

[The Hassle-Free JavaScript Tool Manager](https://volta.sh/)

### javascript.volta.enable

Whether to add volta to the environment.

Default value: false
### javascript.volta.home

A non-empty string. If `javascript.volta.enable` is true, the `VOLTA_HOME` variable is set to this value in the environment.

Default value: `"$HOME/.volta"`
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# gcloud-nix

A [make-shell](https://github.com/nicknovitski/make-shell) module for the Google Cloud SDK, or `gcloud` CLI tool.
A [make-shell](https://github.com/nicknovitski/make-shell) module for [the Google Cloud SDK](https://cloud.google.com/sdk), or `gcloud`.

## Why?

`make-shell` is a modular interface for making nix derivations intended for use by the `nix develop` command. It has it's own lengthy [WHY document](https://github.com/nicknovitski/make-shell/blob/main/WHY.md).

The Google Cloud SDK nix package has a
I wrote this module to scratch a small itch I had when working on a bunch of projects were all deployed to Google Cloud, especially on Google Kubernetes Engine. Once this module existed I could write a module that defines shared settings, and have project-specific overrides this:
```
# gke.nix
{pkgs, ...}: {
gcloud.enable = true;
gcloud.extra-components = [ "kubectl" "gke-gcloud-auth-plugin" "skaffold" ];
}

This is a module for `make-shell` that lets you
# For each project:
pkgs.make-shell {
imports = [./gke.nix]; # DRY!
# project-specific options
}
I work on projects which attempts to explain how it might be useful, but I thought that creating this repository might also give an indirect explanation.
# For example, a project which also uses pubsub:
pkgs.make-shell ({pkgs, ...}: {
imports = [./gke.nix];
gcloud.extra-components = [ "pubsub-emulator" ]; # merges cleanly with the components in gke.nix!
packages = [ pkgs.openjdk ]; # necessary for the emulator to run
})
```

## Installation

Expand All @@ -30,7 +45,7 @@ Then, add the shell module to your shell's imports. It'll look something like t
```nix
devShells.default = pkgs.make-shell = {
imports = [inputs.gcloud-nix.shellModules.default]; # add option declarations...
javascript.gcloud.enable = true; # ...and definitions!
gcloud.enable = true; # ...and definitions!
}
# or, if you're using flake-parts...
make-shell.imports = [gcloud-nix.shellModules.default]; # shared imports for all `make-shells` attributes
Expand All @@ -39,7 +54,7 @@ make-shells.default = {gcloud.enable = true;};

## Usage

The options this module declares are documented [the OPTIONS.md file](OPTIONS.md). Although if you know even a little nix, I bet you can read the declarations directly from [the module itself](shell-modules/default.nix) directory.
The options which this module declares are documented [the OPTIONS.md file](OPTIONS.md). Although if you know even a little nix, I bet you can read the declarations directly from [the module itself](shell-modules/default.nix).

## Examples

Expand Down
2 changes: 1 addition & 1 deletion shell-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ in
};
properties = mkOption {
default = { };
description = "k";
description = "Configuration properties to set in the shell";
type = types.attrsOf (
types.attrsOf (
types.oneOf [
Expand Down

0 comments on commit b1bba31

Please sign in to comment.