nixin-web/technical-principles.md

54 lines
4.1 KiB
Markdown
Raw Normal View History

# Technical principles
2024-10-02 08:59:14 +00:00
This page lists the technical principles we adhere to for developing NixiN and the technological choices that we have made.
Most of the principles we list here are known best software development practices that are well documented on the web or in books. So we will not describe them in detail or argument on why we should follow them and they appear here only as title under which we are putting some technological choices
2024-10-04 08:28:12 +00:00
We regularly update this list of technological choices as the project develop
2024-09-30 14:20:26 +00:00
2024-10-02 08:59:14 +00:00
## KISS "Keep it simple, stupid!"
2024-10-04 08:28:12 +00:00
We will keep the system modular and keep the modules simples, following the [Unix philosophy](https://en.wikipedia.org/wiki/Unix_philosophy) and the [KISS principle](https://en.wikipedia.org/wiki/KISS_principle)
2024-09-26 19:44:28 +00:00
## Do not reinvent the wheel
2024-10-04 08:36:17 +00:00
Whenever possible we will use existing software instead of writing our own code. And will favor widely accepted standards instead of inventing our own file format, protocols, languages or frameworks.
2024-10-04 08:28:12 +00:00
- Obviously we will use NixOS as the base operating system
- We will use git for version control of source code and configurations
2024-10-04 08:36:17 +00:00
- For storing passwords and secrets we will use zx2c4 passwordstore coupled with a git forge
- For the forge we will initially use forgejo. At a latter time we may add support for alternative forges that have a more distributed nature, like [Radicle](https://radicle.xyz/), when they become mature enough.
2024-10-04 08:28:12 +00:00
- For deploying NixOS to remote machines we are considering using [krops](https://github.com/krebs/krops). But we are still evaluating it.
2024-10-04 08:36:17 +00:00
- For formatting disks we will favor modern filesystems with snapshotting capability like zfs and btrfs
2024-10-04 08:28:12 +00:00
- ...
2024-09-26 19:44:28 +00:00
2024-09-30 14:20:26 +00:00
## Eat your own dog food
2024-10-02 08:59:14 +00:00
The project is bootstrapped using an infrastructure that is based on Proxmox, Debian and YunoHost for hosting its website and git forge. Currently only the forgejo action runners used for CI/CD are hosted on NixOS servers.
2024-09-30 14:20:26 +00:00
But the goal is to host the whole project using itself as soon as possible. That is using NixOS servers managed with the tools and principles developed within the NixiN project.
2024-09-26 19:44:28 +00:00
2024-10-02 08:59:14 +00:00
## Version control everything
2024-10-04 08:28:12 +00:00
Not only will we version control our source code, but we will integrate version control at the core of NixiN, so that all the user configurations generated when using NixiN will be stored in a version control repository.
2024-10-02 08:59:14 +00:00
2024-09-26 19:44:28 +00:00
## CI/CD
## Focus on user experience
## Prioritize security
2024-10-04 08:36:17 +00:00
- only open ports that are strictly necessary on the public interface. go through a VPN for everything else
2024-10-04 08:28:12 +00:00
- use fail2ban or reaction
- use a passwords manager
- ...
2024-09-26 19:44:28 +00:00
## No premature performance optimization
2024-09-27 07:29:47 +00:00
Use best practices to write efficient code but do not write overly complicated solutions based on a-priori thinking of performance issue.
2024-09-26 19:44:28 +00:00
Only optimize what has been tested to be an issue.
2024-10-04 08:36:17 +00:00
## Do fast prototypes and release cycles.
Even though we think that Rust would be a better language for developing the backend components of the project, we are starting the first version using Go because it is faster to develop with it and easier to find contributors with this languages.
2024-09-26 19:44:28 +00:00
2024-09-30 14:20:26 +00:00
## To flake or not to flake?
2024-10-02 08:59:14 +00:00
There is a bit of controversy around flakes. They bring some interesting convenience when using NixOS and have spawned an extensive ecosystem. But they are not without drawbacks. We have decided to not use flakes for now. But we'll keep our architecture open for the users who want to use them.
## There is only one timezone
Experience has shown that using multiple time-zones for the servers of an infrastructure is a recipe for disaster.
2024-10-04 08:36:17 +00:00
Also, even if using a single time zone, using the timezone of one country for an international project is a source of confusion and headaches for people.
2024-10-02 08:59:14 +00:00
Especially when that timezone is subject to daylight saving changes that are causing the clock to jump 1 hour forward or backward twice a year.
2024-10-04 08:36:17 +00:00
The only sensible choice is to set the servers time to UTC and to translate the timestamps to the user's timezone when displaying them on an interface.
2024-10-02 08:59:14 +00:00
2024-10-04 08:36:17 +00:00
This is strongly opinion based. We may not not all agree on the subject. This is why we will make sure that it is easy for the users to choose their preferred time zone for setting up their servers.