codchi module add

Add a module to a code machine.

Synopsis

codchi module add -y|--dont-prompt-N|--no-build -p|--use-nixpkgs-a|--auth -b|--branch -r|--tag-c|--commit -v|--verbose... -q|--quiet... --json -h|--help <MACHINE_NAME> <URL> MODULE_PATHS

Options

  • -y, --dont-prompt
    Dont prompt for confirmation and accept all of Codchis defaults. Usefull for using Codchi in scripts
  • -N, --no-build
    Dont automatically build this machine after this command completes
  • -p, --use-nixpkgs=USE_NIXPKGS
    Whether to use Nixpkgs from the local Codchi installation or the remote URL. See the "Which nixpkgs should I use?" section of codchi init for more details.
    By default Codchi will use remote if defines a nixpkgs input in its flake. Otherwise it will use the local nixpkgs.
    *possible values: *local, remote
  • -a, --auth=AUTH
    Authorisation string for private repositories. Generally, the syntax is <user>:<token> or just <token>.
    GitHub for example has something like ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx whereas GitLab uses oauth2:glpat-xxxxxxxxxxxxxxxxxxxx.
  • -b, --branch=BRANCH
    The git branch to use for the code machine module
  • -r, --tag=TAG
    The git tag to use for the code machine module
  • -c, --commit=COMMIT
    The git commit to use for the code machine module
  • -v, --verbose
    Increase logging verbosity
  • -q, --quiet
    Decrease logging verbosity
  • --json
    Produce output in JSON format, suitable for consumption by another program
  • -h, --help
    Print help (see a summary with -h)
  • <MACHINE_NAME>
    Name of the code machine
  • <URL>
    HTTP(S) URL or file path to the codchi module
  • MODULE_PATHS
    A list of flake paths to the NixOS modules you whish to add. Currently supported: codchiModules. or nixosModules.

Examples

Personal modules

Sometimes you might want to customize a code machine, but don't want to commit it to upstream to the main module of the code machine which is also used by other developers. For example, you might want to use a different editor than the rest of the project's contributors. Fortunately, you can add as many modules to a machine as you like! This is especially handy for sharing your personal configuration between different code machines:

codchi module add <MACHINE_NAME> https://github.com/my/cool/nixconfig nixosModules.vim

Local modules

See the EXTRA section of codchi module for more information. Given you already have a git repository containing a code machine module checked out inside at the path $HOME/my-additional-module. You can add it to the code machine via:

codchi module add <MACHINE_NAME> my-additional-module <MODULE_PATHS...>

Note that the (my-additional-module) is relative to $HOME inside and has no leading ~ or ./. If you leave <MODULE_PATHS...> empty, Codchi will prompt you with a list of available modules, just like with codchi init.