From d98c090fb7ba9a5ddc1da4df77acd49d46f5fdbe Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Mon, 14 Oct 2024 00:21:51 +0100 Subject: [PATCH] assignment: saving current progress for this evening --- _git.tar.gz | 4 ++-- src/skynet/nix.md | 27 ++++++++++++++++++++++++++ src/skynet/nix/firefox_co-existing.png | 3 +++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 src/skynet/nix/firefox_co-existing.png diff --git a/_git.tar.gz b/_git.tar.gz index b1bf13f..bfb994e 100644 --- a/_git.tar.gz +++ b/_git.tar.gz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3df8f69e441454833dabe16025b924632137959cb60aad501a1900e27ce6b555 -size 337666 +oid sha256:26358636ab2431f4688f5a3a8e2c47fd59ad842d840488b4d9577791d192ba64 +size 341053 diff --git a/src/skynet/nix.md b/src/skynet/nix.md index 17fa865..f8d2305 100644 --- a/src/skynet/nix.md +++ b/src/skynet/nix.md @@ -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. +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 \ No newline at end of file diff --git a/src/skynet/nix/firefox_co-existing.png b/src/skynet/nix/firefox_co-existing.png new file mode 100644 index 0000000..f2699d9 --- /dev/null +++ b/src/skynet/nix/firefox_co-existing.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3223a97f158347125132e42050ef77f293bb650d45bb49d8956107368b2a8b14 +size 77103