Keep your jj clones in one layout, in one place, and in order.
Note
This needs jj. If you don't use jj yet, go learn jj. jj is good. jj is great. I like jj.
ck fork also needs gh, and ck new --template nix. Go cry about it.
ck [query] # jump to a local clone, fuzzy picking if several match
ck get <repo> # clone, or jump to the existing clone
ck list [query] # list local clones
ck rm <repo> # remove a local clone
ck new <repo> # start a new repo in the layout
ck fork # fork origin on GitHub, add it as `contrib`
ck tidy # move repos and fix remotes to match the layout
ck config # show the settings in useInstall packages.<system>.ck anywhere that puts it on XDG_DATA_DIRS, such
as environment.systemPackages or users.users.<name>.packages.
With flakes:
{
inputs.ck.url = "github:manic-systems/ck";
# in a NixOS module
environment.systemPackages = [ inputs.ck.packages.${pkgs.stdenv.hostPlatform.system}.ck ];
}With tack:
tack add ck github:manic-systems/cklet
inputs = import ./.tack;
in
{
# in a NixOS module
environment.systemPackages = [ inputs.ck.packages.${pkgs.stdenv.hostPlatform.system}.ck ];
}The package ships share/nushell/vendor/autoload/ck.nu, which nushell loads by
itself. ck is therefore all you need, nice! It also ships a ck binary with the
same subcommands for scripts, agents (blegh) and other shells. To cd you do need the nushell version, so ck and ck get only print or clone.
Clone the repo and add to your config.nu:
use /path/to/ck/ck *ck reads $XDG_CONFIG_HOME/ck/config.nuon (or $env.CK_CONFIG) over these
defaults:
{
base: "~/git" # root of the layout
host: "github.com" # forge for owner/repo shorthands
owner: null # owner for bare repo shorthands
me: [] # owners whose repos are your forks, for ck tidy; defaults to [owner]
roots: [] # other roots by prefix: [{prefix: "github.com/acme/", root: "~/work"}]
host_aliases: {} # dead SSH host aliases: {github-work: "github.com"}
role_remotes: [origin upstream contrib fork] # remotes ck tidy treats as the project or your fork
}
EUPL-1.2
