From bf813c3e7b2f0083d1eee128cfcc47f5ad34b301 Mon Sep 17 00:00:00 2001 From: "Trux-Bot[bot]" Date: Wed, 24 Apr 2024 05:50:38 +0000 Subject: [PATCH] deploy: b6e2ee3155daa523ceb839996a68814b49df4e68 --- docs/search/search_index.json | 2 +- docs/sitemap.xml | 52 +++++++++---------- docs/sitemap.xml.gz | Bin 455 -> 456 bytes docs/vm/installing-zfs-impermance/index.html | 2 +- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/docs/search/search_index.json b/docs/search/search_index.json index c5b906a2..1fb8c614 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\u200b\\-_,:!=\\[\\]()\"`/]+|\\.(?!\\d)|&[lg]t;|(?!\\b)(?=[A-Z][a-z])","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"readme.md","text":"

\ud83d\udc4b Welcome to my NixoOS home and homelab configuration. This monorepo is my personal nix/nixos setup for all my devices, specifically my homelab.

This is the end result of a recovering k8s addict - who no longer enjoyed the time and effort I personally found it took to run k8s at home.

"},{"location":"#why","title":"Why?","text":"

Having needed a break from hobby's for some health related reasons, I found coming back to a unpatched cluster a chore, which was left unattented. Then a cheap SSD in my custom VyOS router blew, leading me to just put back in my Unifi Dreammachine router, which broke the custom DNS I was running for my cluster, which caused it issues.

During fixing the DNS issue, a basic software upgrade for the custom k8s OS I was running k8s on broke my cluster for the 6th time running, coupled with using a older version of the script tool I used to manage its machine config yaml, which ended up leading to my 6th k8s disaster recovery ).

Looking at my boring Ubuntu ZFS nas which just ran and ran and ran without needing TLC, and remembering the old days with Ubuntu + Docker Compose being hands-off ), I dove into nix, with the idea of getting back to basics of boring proven tools, with the power of nix's declarative system.

"},{"location":"#goals","title":"Goals","text":"

One of my goals is to bring what I learnt running k8s at home with some of the best homelabbers, into the nix world and see just how much of the practices I learnt I can apply to a nix setup, while focussing on having a solid, reliable, setup that I can leave largely unattended for months without issues cropping up.

The goal of this doc is for me to slow down a bit and jot down how and why I am doing what im doing in a module, and cover how I have approached the faucets of homelabbing, so YOU can understand, steal with pride from my code, and hopefully(?) learn a thing or two.

To teach me a thing or two, contact me or raise a Issue. PR's may or may not be taken as a personal attack - this is my home setup after all.

[CI]: Continuous Integration [PR]: Pull Request [HASS]: Home-assistant [k8s]: Kubernetes [YAML]: Yet Another Markup Language [JSON]: JavaScript Object Notation [ZFS]: Originally 'Zettabyte File System', a COW filesystem. [COW]: Copy on Write

"},{"location":"motd/","title":"Message of the day","text":"

Why not include a nice message of the day for each server I log into?

The below gives some insight into what the servers running, status of zpools, usage, etc. While not show below - thankfully - If a zpool error is found the status gives a full zpool status -x debrief which is particulary eye-catching upon login.

I've also squeezed in a 'reboot required' flag for when the server had detected its running kernel/init/systemd is a different version to what it booted with - useful to know when long running servers require a reboot to pick up new kernel/etc versions.

Message of the day

Code TLDR

/nixos/modules/nixos/system/motd

Write a shell script using nix with a bash motd of your choosing.

let\n  motd = pkgs.writeShellScriptBin \"motd\"\n    ''\n      #! /usr/bin/env bash\n      source /etc/os-release\n      service_status=$(systemctl list-units | grep podman-)\n\n      <- SNIP ->\n      printf \"$BOLDService status$ENDCOLOR\\n\"\n    '';\nin\n

This gets us a shells script we can then directly call into systemPackages - and after that its just a short hop to make this part of the shell init.

Note

Replace with your preferred shell!

environment.systemPackages = [\n    motd\n];\nprograms.fish.interactiveShellInit =  ''\n    motd\n'';\n

[CI]: Continuous Integration [PR]: Pull Request [HASS]: Home-assistant [k8s]: Kubernetes [YAML]: Yet Another Markup Language [JSON]: JavaScript Object Notation [ZFS]: Originally 'Zettabyte File System', a COW filesystem. [COW]: Copy on Write

"},{"location":"tips/","title":"Tips","text":"