codchi clone

Clone a project and initialize its code machine using the cloned module.

Synopsis

codchi clone --depth --single-branch--recurse-submodules --shallow-submodules-d|--dir -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

Description

This command unifies the following commands:

codchi init <MACHINE_NAME> <URL>
codchi exec <MACHINE_NAME> git clone <URL> <TARGET_DIR>
codchi module set <MACHINE_NAME> <MODULE_NAME> --url <TARGET_DIR>

See the documentation of each command for more information.

Options

  • --depth=DEPTH
    Same as git clone --depth
  • --single-branch
    Same as git clone --single-branch
  • --recurse-submodules
    Same as git clone --recurse-submodules
  • --shallow-submodules
    Same as git clone --shallow-submodules
  • -d, --dir=DIR
    The target directory, relative to $HOME, for the git repo. If left empty this will chosen by git
  • -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 to the git repository
  • MODULE_PATHS
    A list of flake paths to the Codchi modules you whish to add. Currently supported: codchiModules. or nixosModules.. If not sure which modules are available, leave this empty. Codchi will prompt you with a list of possible options.
    With --dont-prompt this argument is required.

Examples

Install and clone the Codchi repo / machine:

codchi clone <MACHINE_NAME> https://github.com/aformatik/codchi nixosModules.codchi
codchi exec <MACHINE_NAME>
cd codchi/codchi
cargo build