Add a section on Nix, Nixos and related tools #30

Merged
silver merged 11 commits from #29-nix_nixos-assignment into main 2024-10-18 22:26:26 +00:00
3 changed files with 32 additions and 2 deletions
Showing only changes of commit d98c090fb7 - Show all commits

BIN
_git.tar.gz (Stored with Git LFS)

Binary file not shown.

View file

@ -1,7 +1,30 @@
# Nix/NixOS
The [Skynet Cluster][nixos_skynet] is (for the most part) running on a Linux variant called NixOS.
This article aims to introduce you to Nix and Nixos in order to get you up to speed to administer the cluster.
## What it is
### Nix
#### Package Manager
The word Nix refers to two things: a language and a package manager.
These are deeply interlinked together with the language being how the package manager is able to do its job.
Nix grew out of a [PhD by Eelco Dolstra][nix_paper] wherein he proposes a slightly different way to manage dependencies on a system.
For most Linux systems programs make use of other software installed on the computer, for the most part this works fine.
Where issue may arise is if one program needs to update one of these dependencies, specially a minor or major patch where backwards compatibility is not guaranteed.
silver marked this conversation as resolved Outdated
Outdated
Review

specially might be right here not sure, especially or specifically to me sounds better but 🤷

specially might be right here not sure, especially or specifically to me sounds better but 🤷

Ye this was intended to be specifically

Ye this was intended to be ``specifically``
If another program is using this (system wide) dependency then it may run into interface issues when using it.
In a sense updating one program can break another on the system.
The route the Nix package manager takes is it treats each program as a function.
Using teh Nix language a function for that package is created which states what inputs are required, what is needed to turn those inputs into teh program as well as the name for the output.
The output is then saved in a read only location in the format of ``/nix/store/$hash-program-name-version``.
This output can eitehr be used as the input of another program or be used as is by the system/user.
Using this format means that any change in the inputs or the program itself will result in a different output.
This means that multiple versions of the program (some even the same version but different commit) can co-exist on the one system.
An example using different versions of Firefox:
![img.png](nix/firefox_co-existing.png)
#### Language
### Flakes
@ -28,3 +51,7 @@
#### Deployment
[nixos_skynet]: https://forgejo.skynet.ie/Skynet/nixos
[nix_paper]: https://edolstra.github.io/pubs/nspfssd-lisa2004-final.pdf

BIN
src/skynet/nix/firefox_co-existing.png (Stored with Git LFS) Normal file

Binary file not shown.