**Unified interface is better than features.**<br/>
We will provide the basic features then build up.
We do not want a patchwork of very different software, each of them having their own particularities.
**Online services.** *day-to-day use*<br/>
The web interface should cover online services, providing an unified experience for main usages: mails, calendar, instant messaging, personal website, file sharing, etc.
**A knowable OS.** *simplicity at (almost) all cost*<br/>
Any interested user should be able understand the role of every part of the base system: no compromise.
This means having a very small and consistent set of tools, easy to learn, easy to remember.
**Basic system and network management.** *with the simpliest tools ever*<br/>
We provide a web interface that should handle basic system and network configurations, such as adding users, firewall management, dhcp, DNS, backups, etc.
CLI tools are available to manage your services, they are design to be simple, consistent and reliable.
Static compilation for system tools *(at least)*: there is almost no way to get a borked system with an update (yes, *almost*, people are creative these days).
**Simple to contribute to.** *you can focus on providing recipes for packages, we handle the tooling*<br/>
We want fewer and simpler tools as possible, even for packaging applications and libraries.
BaguetteOS ships [a simple tool to package applications][packaging] and it only requires you to create a very simple recipe for your package.
It handles [slotting](#slotting), compiling, stripping binaries and libraries, splitting the result into different packages (`-man`, `-lib`, `-doc`, etc.) then authenticate them and finally recreate the index.
All that, just by typing `packaging app`, nothing more.
- [CRUX][crux], [alpine][alpine]: simple to understand Linux systems
- [OpenBSD][openbsd]: security, therefore simplicity, no compromise
- [PFSense][pfsense]: system and (even advanced) networking administration, yet through a simple website
- [Plan9][plan9] and [Inferno][inferno]: everything is a file *no seriously guys*
- [suckless][suckless] and [cat-v][cat-v]: simplicity, code readability and reusability
- [morpheus][morpheus]: static compilation for the OS, demystified
## Why not use another system?
This section could be expanded.
**A few reasons why any of the candidate covers it all.**<br/>
1.**we want slotting**<br/>
So we could change the way we install and maintain packages.
2.**we want fast install and start-up on dumb devices**<br/>
Coreutils will be shrinked to bare minimum, thanks to `toybox`.
We won't require a full-feature system with several hundred megabytes of used disk-space.
3.**documentation is important, but not for all installations**<br/>
Your 42nd test install on a virtual machine doesn't need to provide manual for CLI tools you won't use since you do everything through the web interface.
Software and its documentation will be splited: manual pages won't be provided by default.
4.**we want automatic tests, and to allow people to test our system**<br/>
We want easy chroot installs, on any system.
5.**we want to run on tiny ARM boxes, old laptops, top-notch servers**<br/>
So we need to run on any available kernel.
6.**we want to control software distribution releases**<br/>
We don't accept to follow updates from an upstream OS that could break our system at any time.
---
**Now, let's take a look at each candidate.**
**OpenBSD.** *we will get there quick, but focus on linux a bit before*<br/>
We definitevely want to use OpenBSD, currently we just focused on Linux for hardware compatibility reasons (and out of habits) but it's not set in stone.
We love OpenBSD big time, some of us use it daily.
We aim at providing rootfs for running our system under an OpenBSD kernel and environment.<br/>
*(also, snapshots could be great, guys)*
**PFSense.** *network focused*<br/>
Way too focused on networking.
Great system, does the job very well, but won't fit our objectives.
**CRUX and Alpine.** *great source of inspiration*<br/>
We **do** use the CRUX's `rc` script, and as Alpine it is a source of inspiration for package recipes.
However, since we have to change all packages to get slotting, the service manager to have tokenized services, the packaging software to get declarative recipes (...), why even bother use those systems?
**GUIX and coe.** *not simple enough*<br/>
This approach of package management is interesting, having to learn a language to make recipes isn't.
And that sums a lot about this technology.
It's great to have, not to put everywhere.
Every part of BaguetteOS is simple to understand, GUIX is not *enough*.
**Linux kernel**, but we are lurking on the OpenBSD one.<br/>
Linux is compatible with most hardware and software, it is fast and we can easily compile a custom version to remove most of the bloat for server usage.
Still, we don't want to rely on Linux-specific components.
At some point, our system will be kernel-agnostic and will be able to run on any BSD as well.
OpenBSD has `pledge` and `unveil` syscalls, which is an elegant way to provide a guarantee on the software behavior.
**Musl.** *reasonable libc for Linux*<br/>
It has a reasonable amount of features, it is efficient, provides reasonable binary sizes and static compilation.
Musl is simple, reliable and remove all glibc-specific functions.
Others can be added easily, which is useful for compatibility and comparisons, through [slotting](#slotting).
**Bootable system and rootfs available.**<br/>
A bootable system to install in virtual machines or bare metal, a rootfs to use BaguetteOS from any other OS, including non-Linux ones.
**SysV-style init + [CRUX-like /etc/{rc,mdev.conf,...}][baguette-rc]**. *easy to read, easy to adapt*<br/>
The init could come from toybox or another minimalist project.
The [rc script from CRUX][cruxinit] is simple to understand and to adapt to any requirement, so we used it.
We also added some other scripts, like [for profile][baguette-profile] so we can easily manage slotting.
No systemd BS.
**Toybox.** *the megabyte coreutils*<br/>
[Toybox][toybox] combines common unix command line utilities together into a single BSD-licensed executable.
It is designed to be simple even to read, and is standards-compliant.
For the base system, that's all we need.
**ksh and zsh**. *the first for scripts and root, the other for users*<br/>
[Ksh][ksh] is a very stable and reliable shell from AT&T, trusted by the paranoid people of OpenBSD.
That's a safe choice for a base system and the root account.
On the other hand, we do use [zsh][zsh] daily, as for many users, so we may use it for development or build scripts but not in base.
**[Service][service] for service management** *tokenized service description, templating and dumb cli tools for the win*<br/>
[See custom tools.](#custom-tools)
**[Package][package] for package management** *simple, efficient, dead simple code*<br/>
[See custom tools.](#custom-tools)
**OpenSSH.** *as we all know and love*<br/>
This is required for almost all usages, and for debug.
Let's try not to shoot ourselves in the foot.
That's all you need for starters. Web administrative interface will be added to the base when ready.
## Development, build tools, contribution
**Default building tools** *every tool needed to bootstrap*<br/>
Clang (+LLVM) is the default C (and C++) compiler.
[Libarchive][libarchive] is required for tarballs, packages, webhooks from `packaging`, and both [bsdcpio][bsdcpio] and [bsdtar][bsdtar] (sane implementations of `cpio` and `tar`).
autotools are also required (for sysv init and libarchive).
[m4][m4] and [gnu-make][gmake] are required for compatibility reasons.
**Documentation.**<br/>
A full hand-book like the OpenBSD FAQ.
Our software manpages are written with `scdoc` so anyone can contribute.
**[Packaging][packaging] for packaging software and libraries.** *dead simple, intuitive*<br/>
[See custom tools.](#custom-tools)
**Crystal language for system tools.** *syntax and productivity of Ruby, the speed of C*<br/>
It is as simple to learn as a dynamic (oriented object) language, while at the same time being almost as fast as C.
Technically, Crystal is strongly typed which catches errors at compile-time, but with type inference so it is not cumbersome to use.
Applications are compiled in a simple binary, easy to deploy.
There is a good documentation, we used it for long enough to tell.
Technical choices are reasonable and documented.
Finally, Crystal has a large library with all we need for our system components.
There is not much of a drawback here.
Yes, this is a language you have to learn to work with us on a couple of projects (the web interface backend, the service manager, the package manager and packaging) but it increases our productivity like crazy.
We heard about `nim` and a ton of other languages, but this is the one which reach the sweet spot between these parameters:
- productivity (the package manager was mostly done in a few days, [and is just a few hundred lines long][package])
- easy learning (a developper with basic notions of oriented-object can read our code, no black magic here)
- good documentation
- reasonably deployable (no host dependencies)
- execution speed
**Slotting.** *custom file system hierarchy*<br/>
Our FS is not FHS-compliant, partially because of the origin-based slotting.
There is a strict separation between core system and third party software.<br/>
Package covers the basics: install, remove, search and provide informations about a package, and it creates rootfs.
It is used by `packaging` to create low-cost build environments.
Package knows the minimal set of binaries and configuration required to build the target, so it only installs the minimal environment to perform compilation.
This environment is low-cost since we hardlink binaries into the building rootfs, which is inspired by the [proot][proot] tool on OpenBSD.
Package provides slotting by default: no need for custom environments for each software.
Packages format ar simple `tar` archives containing a `meta.spec` file describing all meta-data about the package, and `files.tar.xz` with the files to install.
The database format contains `world`, `installed`, `[package-name]/[slot]/manifest` and `[package-name]/[slot]/meta.spec`.
Package's configuration is a list of repositories, authorized package signing keys and packaging variables (cflags, makeflags, and so on).
**[Packaging][packaging]: to create packages**<br/>
Packaging uses simple, declarative recipe files, here some examples: [hello][recipe-hello], [dhcpcd][recipe-dhcpcd], [alsa-utils][recipe-alsautils].
The only required parameters are `name` and `sources`.
Packaging creates build environments to test packages before validation.
-`service` provides an unified way to configure the system<br/>
It alleviates the need for manual configuration. For example, adding a wordpress service will automatically change the `nginx` configuration, create a new database and a new user in `mariadb` for this specific service.<br/>
If several `nginx` are required, ports will be registered and automatically managed for each instance, no need for user input.<br/>
Behind the scene, it's a simple token system with configuration templating!<br/>
No heavy machinery here, and we'll keep it that way.
-`build.cr` (temporary name): Makefile creation
- create makefiles from simple declarative configuration file
- can replace most build systems
- FIXME: design something using .spec format
-`tap-aggregator`: quality assurance & test results aggregation
-`webhooksd`
- automatic verification of the recipes on new application or library version
- automatic cross-compilation (x86_64, ARM, others will follow)
-`libipc`: an IPC communication library
- currently used for
1. the administration dashboard
2. the web interface for the services
3.`todod` (a kanban) 4. several other tools we use for collaboration
- provides a way to communicate between clients and services
- uses simple unix sockets behind the scene
- transparent remote communications
- clients and services do not need remote communication
- any client can join remote services via any communication protocol
- any service is implicitly accessible from anywhere, anyhow
- C library with Crystal bindings (other languages coming soon)
- we create services, not libraries<br/>
Therefore, languages are irrelevant: you can use any *library* in any language.
## Still in discussion
For the simple users, we want to provide an unified web interface to manage the system and online services.
We currently use `Crystal` to work on service back-ends for a variety of projects, we are satisfied on a technical level and we are productive, it is highly probable we continue using it.
The front-end is still in discussion: we currently use `livescript` and it is way more usable than plain JS, but it is painful to debug.
So, we need a language for both administration dashboard and online services, here some examples we find interesting for the job:
- Purescript
- haskell-like syntax, with a smaller set of notions
- strongly typed, with type inference
- good documentation
- useful compilation errors
- no runtime error
- Elm
- as Purescript but with way fewer documentation
- less generic code
- still very young
- WASM
- seems to be a very young tech, with no real good language or documentation
- Zig has wasm as a Tier 1 support, we should investigate
The usual way to provide software is to maintain a version of a software or a library, package it into a distribution, then provide it as *the* OS version of the software.
In the long run, software and libraries change, which is no big deal since maintainers verify the consistency of the different versions provided by the OS.