Skip to content

The nixbuild.net shell

The nixbuild.net shell can be accessed over ssh by running:

ssh beta.nixbuild.net shell

It doesn't matter what user name you connect with, but you need to use an ssh key associated to your account. If you've followed the Getting Started guide, shell access should be working.

readline support

The nixbuild.net shell doesn't yet have support for command history or many other features that you could expect from a proper shell. However, you can use the rlwrap program to mitigate this:

rlwrap ssh beta.nixbuild.net shell

This will make things like Up/Down arrow keys and CTRL-R to work as you would expect.

Commands

The greeting screen showed each time you log in to the shell also includes a list of all top-level commands:

••••••••••••••••••••••••••••
••••••• nixbuild.net •••••••
••••••••••••••••••••••••••••

Welcome to nixbuild.net!

This shell allows you to administer your account
and retrieve information about your nix builds.

Account name: bob
Unbilled CPU hours: 0
Free build time left: 49:59:59

Available shell commands:

  help       Show help
  get        Show all account settings
  set        Set an account settings
  unset      Revert an account setting to default
  list       List entities
  show       Show details about entities
  usage      Show resource usage
  ssh-keys   Manage your public SSH keys

Run 'help COMMAND' for help on individual shell commands.
For help on subcommands run 'COMMAND SUBCOMMAND --help'.
For more documentation, see:
https://docs.nixbuild.net/nixbuild-shell

Check Your Account Usage

To see how much you've been using nixbuild.net, run the usage command:

nixbuild.net> usage

Account never billed, showing total usage

Total resources used
--------------------
Build count       : 51
Successful builds : 51
Wall time         : 5.79 s
CPU time          : 6.26 s

Please note that any free build time used during the period is included in the stats above.

CPU hours billable on next invoice: 0

When you run the usage command with no options, or the -i / --since-last-invoice option, you will see the usage since your last invoice (or total usage if you haven't been billed yet). You will also be shown the CPU hours that you'll be charged for on your next invoice. This is any outstanding non-free build time rounded up to whole hours.

You can also show the current month's usage with the -m option, the last month's usage with the -l option and the total usage with the -t option:

nixbuild.net> usage -h
usage - Show resource usage

Usage: usage [(-t|--total) | (-l|--last-month) | (-m|--this-month) |
               (-i|--since-last-invoice)]

Available options:
  -t,--total               Show total usage
  -l,--last-month          Show last month's usage
  -m,--this-month          Show this month's usage
  -i,--since-last-invoice  Show usage since last invoice (default)
  -h,--help                Show this help text

Configure Settings

You can get and set nixbuild.net settings with the get and set commands.

Show all settings by just running get:

nixbuild.net> get
Account Settings
----------------

cache-build-failures  true
cache-build-timeouts  false
keep-builds-running   false
always-substitute     false
never-substitute      false

Settings overrides from your SSH client environment are not
included above.

Set individual settings with set:

nixbuild.net> set keep-builds-running true

nixbuild.net> get
Account Settings
----------------

cache-build-failures  true
cache-build-timeouts  false
keep-builds-running   true
always-substitute     false
never-substitute      false

Settings overrides from your SSH client environment are not
included above.

You can revert account settings back to default with unset:

nixbuild.net> unset keep-builds-running

Manage SSH Keys

You can list, add and remove ssh keys associated with your account using the ssh-keys command:

ssh-keys - Manage your public SSH keys

Usage: ssh-keys SUBCOMMAND

Available options:
  -h,--help                Show this help text

Available subcommands:
  list                     List SSH keys
  add                      Add a key
  remove                   Remove a key
  get                      Get settings overrides for an SSH key
  set                      Set settings overrides for an SSH key
  unset                    Unset settings overrides for an SSH key

List Builds

Use the command list builds -r to list your currently running builds:

nixbuild.net> list builds -r
70196 2020-08-23 21:05:10Z 3.21 s 1 CPU [In queue]
      /nix/store/ky3fzyaw0hibjpkpyx8s89fhaprxhrba-zlib-1.2.11.drv

70195 2020-08-23 21:05:10Z 3.66 s 1 CPU [In queue]
      /nix/store/k8ir9nqbqhlriqs6r97vi19im5rn9nkd-xz-5.2.5.drv

70194 2020-08-23 21:05:09Z 3.40 s 4 CPUs [Running]
      /nix/store/5k1i3j15dzqkf8rcga0ap7fjk1q7xj9a-perl-5.30.3.drv

70193 2020-08-23 21:05:08Z 4.18 s 2 CPUs [Running]
      /nix/store/7cgb9m0dm9facpzqbyfkz1i0snd2n1y7-gnum4-1.4.18.drv

Remove the -r option to also show historic builds. By default, at most 500 builds are listed, but that can be adjusted with the -l option.