diff --git a/README.md b/README.md index e846a9cd..8226023e 100644 --- a/README.md +++ b/README.md @@ -15,25 +15,23 @@ Codchi is a tool that manages your project's development environment in a reprod ## Getting Started -Read [What is Codchi?](https://codchi.dev/docs/start/intro.html) for an introduction to Codchi, or directly go to [Installation](https://codchi.dev/docs/start/installation.html). +Read [What is Codchi?](https://codchi.dev/introduction/what-is-codchi) for an introduction to Codchi, or directly go to [Installation](https://codchi.dev/introduction/installation). ## Contributing -Make sure to read [Internals](https://codchi.dev/docs/contrib/internals.html) to understand how Codchi works under the hood. +Make sure to read [Internals](https://codchi.dev/contrib/internals) to understand how Codchi works under the hood. ## Support -Codchi is a fully open-source project building on open foundations like NixOS modules. There is no vendor lock-in or open-core model. Codchi is funded through its use at aformatik as well as through professional support, training, and consulting services. +Codchi is a fully open source project built on open foundations such as NixOS modules. We actively avoid vendor lock-in. Codchi is financed by its use at aformatik as well as by professional support, training and consulting services. ### Community Support -For community support, we encourage users to engage through our GitHub page: - -- **Feature Requests & Issues**: Report bugs, suggest new features, or ask questions via [GitHub Issues](https://github.com/aformatik/codchi/issues). +Report bugs, suggest new features, or ask questions via [GitHub Issues](https://github.com/aformatik/codchi/issues). ### Professional Support -For professional support, please contact [aformatik](https://aformatik.de/kontakt): +For professional support, please contact [aformatik](https://www.aformatik.de/kontakt): - **Feature Requests & Issues**: We offer dedicated assistance for feature requests, bug fixes, and troubleshooting. - **Training and Consulting**: Need help building a tailored *code machine* for your organization? We provide specialized training and consulting services to help you leverage Codchi to its full potential in your environment. diff --git a/codchi/src/cli.rs b/codchi/src/cli.rs index 29e7c944..527b0c7f 100644 --- a/codchi/src/cli.rs +++ b/codchi/src/cli.rs @@ -36,9 +36,9 @@ type DefaultLogLevel = InfoLevel; about = "Codchi is a tool that manages your project's development environment in a reproducible and easy-to-use way. Setting up a development environment should be as easy as a `git clone`! -- [What is Codchi?](https://codchi.dev/docs/start/intro) -- [Configuring Codchi](https://codchi.dev/docs/start/config) -- [Codchi Module Configuration](https://codchi.dev/docs/config/overview) +- [What is Codchi?](https://codchi.dev/introduction/what-is-codchi) +- [Configuring Codchi](https://codchi.dev/introduction/config) +- [Codchi Module Configuration](https://codchi.dev/config/overview) The default subcommand is `codchi status`.", after_long_help = r#" @@ -436,9 +436,9 @@ codchi gc --all --delete-old long_about = r#" See the following docs on how to register the completions with your shell: -- [Windows](https://codchi.dev/docs/start/installation.html#shell-completions) -- [Linux](https://codchi.dev/docs/start/installation.html#shell-completions-1) -- [NixOS](https://codchi.dev/docs/start/installation.html#shell-completions-2) +- [Windows](https://codchi.dev/introduction/installation#shell-completions) +- [Linux](https://codchi.dev/introduction/installation#shell-completions-1) +- [NixOS](https://codchi.dev/introduction/installation#shell-completions-2) "# )] Completion { diff --git a/codchi/src/module.rs b/codchi/src/module.rs index 669731e6..782fd50f 100644 --- a/codchi/src/module.rs +++ b/codchi/src/module.rs @@ -404,7 +404,7 @@ pub fn fetch_modules( } else if Driver::store().cmd().has_nixpkgs_input(&nix_url)? { log::warn!( "Using nixpkgs from '{}'! You may override this with '--use-nixpkgs'. See \ - for \ + for \ more information.", flake_url.pretty_print() ); @@ -537,7 +537,7 @@ fn inquire_module_url( bail!( "Local paths can only be used *after* the code machine was created and the \ remote repository was checked out locally. For further information see \ - ." + ." ) } let home = &consts::user::DEFAULT_HOME.0; diff --git a/codchi/src/platform/cmd/nix.rs b/codchi/src/platform/cmd/nix.rs index 41e925e0..297fd4a5 100644 --- a/codchi/src/platform/cmd/nix.rs +++ b/codchi/src/platform/cmd/nix.rs @@ -16,7 +16,7 @@ pub enum Error { #[error("SSL peer certificate or SSH remote key was not OK.")] InvalidRemoteSSLOrSSH, - #[error("Couldn't access repository. If the repository is private you need to provide the correct credentials. If it's a local repository, make sure it is checked out locally in the machine at the provided path. See on how to access private repositories.")] + #[error("Couldn't access repository. If the repository is private you need to provide the correct credentials. If it's a local repository, make sure it is checked out locally in the machine at the provided path. See `codchi init --help` on how to access private repositories.")] InvalidURLOrCredentials, #[error("There is a file missing (maybe its wasn't added to git): {0}")] diff --git a/codchi/src/platform/linux/mod.rs b/codchi/src/platform/linux/mod.rs index b55746ac..52c3ffbd 100644 --- a/codchi/src/platform/linux/mod.rs +++ b/codchi/src/platform/linux/mod.rs @@ -33,7 +33,7 @@ impl Store for StoreImpl { fn start_or_init_container() -> Result { let status = lxd::container::get_platform_status(consts::CONTAINER_STORE_NAME).context( "Failed to run LXD. It seems like LXD is not installed or set up correctly! \ -Please see for setup instructions!", +Please see for setup instructions!", )?; trace!("LXD store container status: {status:#?}"); diff --git a/codchi/src/platform/windows/wsl.rs b/codchi/src/platform/windows/wsl.rs index e12c8c1f..2907a884 100644 --- a/codchi/src/platform/windows/wsl.rs +++ b/codchi/src/platform/windows/wsl.rs @@ -44,7 +44,7 @@ pub fn get_api() -> Result<&'static Library> { static WSLAPI: OnceLock = OnceLock::new(); WSLAPI.get_or_try_init(Library::new).context( "Failed to load wslapi.dll. This usually means the Windows feature 'Windows Subsystem for \ - Linux' is not active. Please see \ + Linux' is not active. Please see \ for the installation instructions.", ) } @@ -67,7 +67,7 @@ pub fn get_wsl_version() -> Result { .filter(|version| Version::from(version).is_some()) .ok_or(anyhow!( "Failed to parse WSL's version from output '{version_line:?}'. \ - Please see \ + Please see \ for the installation instructions." )) } @@ -200,7 +200,7 @@ including all running programs. Is this OK?", log::warn!( "WSL distro {name} was NOT set to sparse. \ You can do this manually with `wsl.exe --manage {name} --set-sparse true`. \ -See for more information." +See for more information." ); return Ok(()); } diff --git a/docs/content/3.config/2.secrets.md b/docs/content/3.config/2.secrets.md index fef7b726..49f5fcd0 100644 --- a/docs/content/3.config/2.secrets.md +++ b/docs/content/3.config/2.secrets.md @@ -76,7 +76,7 @@ Jul 09 09:38:52 nixos my-secret-service-start[173]: Got secret CODCHI_TEST=My Se Jul 09 09:38:52 nixos systemd[1]: my-secret-service.service: Deactivated successfully. ``` -Refer to the [NixOS Options Reference](/docs/options.html#codchisecretsenv) for more details. +Refer to the [NixOS Options Reference](/config/codchi-specific-nixos-options#codchisecretsenv) for more details. ## Modifying secrets diff --git a/docs/content/3.config/3.misc.md b/docs/content/3.config/3.misc.md index b9fba559..a165aad8 100644 --- a/docs/content/3.config/3.misc.md +++ b/docs/content/3.config/3.misc.md @@ -9,11 +9,11 @@ When opening a shell into a code machine, the user is greeted with the following To get started with Codchi, read the docs at . If you encounter problems please open an issue at . ``` -To customize this, for example to give the user instructions on how to procceed further, there is [`codchi.welcome.text`](/docs/options.html#codchiwelcometext) and [`codchi.welcome.extraText`](/docs/options.html#codchiwelcomeextratext). +To customize this, for example to give the user instructions on how to procceed further, there is [`codchi.welcome.text`](./99.Codchi specific NixOS Options.md#codchiwelcometext) and [`codchi.welcome.extraText`](./99.Codchi specific NixOS Options.md#codchiwelcomeextratext). ## Docker -Docker works normally in Codchi, but the user `codchi` has to be added to the corresponding group in order to not require `sudo`. Codchi provides the convenience option [`codchi.docker.enable`](/docs/options.html#codchidockerenable) for this. +Docker works normally in Codchi, but the user `codchi` has to be added to the corresponding group in order to not require `sudo`. Codchi provides the convenience option [`codchi.docker.enable`](./99.Codchi specific NixOS Options.md#codchidockerenable) for this. ```nix { pkgs, ... }: { diff --git a/docs/content/3.config/4.devenv.md b/docs/content/3.config/4.devenv.md index 58bbda63..144d3af1 100644 --- a/docs/content/3.config/4.devenv.md +++ b/docs/content/3.config/4.devenv.md @@ -15,7 +15,7 @@ Because a code machine is just a NixOS machine with flakes enabled, even a empty nix-direnv.enable = true; }; - # See on how to add an editor + # See on how to add an editor } ``` @@ -39,6 +39,6 @@ As described in [the intro](../1.introduction/0.what-is-codchi.md#when-should-i- # Or see on how to install flox ]; - # See on how to add an editor + # See on how to add an editor } ``` diff --git a/docs/content/3.config/6.environments/javascript.md b/docs/content/3.config/6.environments/javascript.md index e84b4f26..11ea2ea9 100644 --- a/docs/content/3.config/6.environments/javascript.md +++ b/docs/content/3.config/6.environments/javascript.md @@ -37,7 +37,7 @@ Try it out with `codchi init https://github.com/aformatik/codchi nixosMod # pkgs.nodePackages.prettier # Editor: - # See for more info + # See for more info pkgs.vscodium # Or, if you have problems with manually installed plugins: # pkgs.vscodium-fhs diff --git a/docs/content/3.config/6.environments/jvm.md b/docs/content/3.config/6.environments/jvm.md index 60ab7342..fb6a8e25 100644 --- a/docs/content/3.config/6.environments/jvm.md +++ b/docs/content/3.config/6.environments/jvm.md @@ -7,7 +7,7 @@ Try it out with `codchi init https://github.com/aformatik/codchi nixosMod ## General, Java & Kotlin -IntelliJ wants to download JDKs automatically, but they don't work on NixOS. Therefore you need to enable `programs.java` which sets `$JAVA_HOME` to the default JDK (OpenJDK) which IntelliJ can use. If multiple JDKs are needed, use [`programs.java.packages`](/docs/options.html#programsjavapackages) (an option added by Codchi) which installes them in `~/.jdks`. +IntelliJ wants to download JDKs automatically, but they don't work on NixOS. Therefore you need to enable `programs.java` which sets `$JAVA_HOME` to the default JDK (OpenJDK) which IntelliJ can use. If multiple JDKs are needed, use [`programs.java.packages`](../99.Codchi specific NixOS Options.md#programsjavapackages) (an option added by Codchi) which installes them in `~/.jdks`. ```nix { pkgs, ... }: { diff --git a/docs/content/3.config/6.environments/python.md b/docs/content/3.config/6.environments/python.md index 26fde955..44c8819c 100644 --- a/docs/content/3.config/6.environments/python.md +++ b/docs/content/3.config/6.environments/python.md @@ -13,7 +13,7 @@ Try it out with `codchi init https://github.com/aformatik/codchi nixosMod pkgs.python39Packages.virtualenv # Editor: - # See for more info + # See for more info pkgs.jetbrains.pycharm-community # Or VSCode(ium) (pkgs.vscode-with-extensions.override { diff --git a/docs/content/4.contrib/internals.md b/docs/content/4.contrib/internals.md index b59ac76a..eb57f1b0 100644 --- a/docs/content/4.contrib/internals.md +++ b/docs/content/4.contrib/internals.md @@ -1,12 +1,12 @@ # Internals -This page describes the internals of Codchi. For an overview of what Codchi is read [What is Codchi?](..//start/intro.md). +This page describes the internals of Codchi. For an overview of what Codchi is read [What is Codchi?](../1.introduction/0.what-is-codchi.md) ## Overview Technically Codchi is just a "driver" for any NixOS module, such as: ```nix -{ +{ } ``` That is just an empty NixOS module. To build this into a bootable machine without Codchi, you need to provide the hardware configuration (e.g. file system layout, boot loader, kernel, kernel module & options, desktop environment, ...). This can vary a lot from machine to machine, although virtual machines alleviate some of this. @@ -18,23 +18,22 @@ codchi exec empty-machine -- uname -a > Linux nixos 6.6.32 #1-NixOS SMP PREEMPT_DYNAMIC Sat May 25 14:22:56 UTC 2024 x86_64 GNU/Linux ``` -This works because Codchi provides the hardware configuration, the drivers (i.e. WSL, LXD and so on), as well as host integration such as GUI and sound support, file system sharing between code machine and host, and much more: +This works because Codchi provides the hardware configuration, the drivers (i.e. WSL, LXD and so on), as well as host integration such as GUI and sound support, file system sharing between code machine and host, and much more. -![Codchi architecture diagram](/architecture.png) - -The goal is to provide an easy to use NixOS driver for different platforms, where everything hardware related just works. +The goal is to provide an easy to use NixOS driver for different platforms (currently Windows & Linux), where everything hardware related just works. ## Capabilities -These are the capabilities provided by Codchi. Every new driver must at least fully implement the "must" section. +These are the capabilities provided by Codchi. Every new driver must at least fully implement the "must" items. | Category | Capability | Must / Should | Windows + WSL | Linux + LXD | | ------------- | -------------- | -------------- | -------------- | -------------- | | Architecture | Each code machine on a host uses a shared store accessible via `nix-daemon` | Must | ✅ | ✅ | +| Architecture | The file system of each code machine on a host can be accessed by the store for local NixOS configuration | Must | ✅ | ✅ | | Run full NixOS | SystemD working properly | Must | ✅ | ✅ | | Run full NixOS | Proper login shell, i.e. `codchi exec` creates a proper login shell with `$DISPLAY` set. This is essential for the environment variables to be set correctly and for everything to start up correctly, including XDG autostart entries | Must | ✅ | ❔ | | Host Integration | GUI & Sound: `codchi exec -- nix run nixpkgs#xorg.xeyes` must open xeyes on the host's desktop. X11 and wayland apps (with sound) must work. | Must | ✅ | ❔ | @@ -54,189 +53,92 @@ These are the capabilities provided by Codchi. Every new driver must at least fu - 📝 = Planned - ❌ = Not implemented -## Drivers - - -### WSL - -### LXD -### VM Export - -## Guidelines - -- reliable & reproducible -- fast -- easy to use -- Building on "standards" (NixOS modules) - - - diff --git a/docs/nuxt.config.ts b/docs/nuxt.config.ts index ebbf33fb..0efb4583 100755 --- a/docs/nuxt.config.ts +++ b/docs/nuxt.config.ts @@ -1,13 +1,10 @@ export default defineNuxtConfig({ // https://github.com/nuxt-themes/docus - router: { - base: '/', - }, extends: ['@nuxt-themes/docus'], devtools: { enabled: true }, content: { highlight: { - preload: ["nix", "toml"], + preload: ["nix", "toml", "ps1"], }, }, @@ -16,6 +13,6 @@ export default defineNuxtConfig({ // https://github.com/nuxt-modules/plausible // '@nuxtjs/plausible' ], - ssr: true, + // ssr: true, compatibilityDate: '2024-10-24' }) diff --git a/docs/public/driver.svg b/docs/public/driver.svg new file mode 100644 index 00000000..84896183 --- /dev/null +++ b/docs/public/driver.svg @@ -0,0 +1,4 @@ + + + +
Virtualized (WSL / LXD)
Host (native)
Codchi
Code Machine
Shared file system
Code Machine
Shared /nix/store
codchistore
OS
Hardware
User
\ No newline at end of file