Skip to content

Latest commit

 

History

History
215 lines (169 loc) · 9.84 KB

README.md

File metadata and controls

215 lines (169 loc) · 9.84 KB

tensorfiles

flake check FlakeHub cachix flake.lock update

Table of Contents

  1. About
  2. Design choices
  3. Software
    1. Academics
    2. Secrets
  4. Installation
  5. Troubleshooting
    1. Write error: disk full; during nixos-install
  6. Impurities
    1. Currently known impurities
    2. Notes
  7. Resources
  8. Credits & Special thanks
    1. Major help
    2. Additional help

1. About ❄️

tensorfiles represent a set of fully covariant, that is invariant to the chosen coordinate system (they work on every machine), fundamental laws of computing (how to build my fancy flashy terminals) ☁️

img img

Some of the machines/packages present in this repository are also prebuilt in the following binary cache

  nixConfig = {
    extra-substituters = [
      "https://tsandrini.cachix.org"
    ];
    extra-trusted-public-keys = [
      "tsandrini.cachix.org-1:t0AzIUglIqwiY+vz/WRWXrOkDZN8TwY3gk+n+UDt4gw="
    ];
  };

The project is also hosted on FlakeHub.

2. Design choices ⚙️

  • This projects is generated via and uses flake-parts-builder which makes it super easy to share modularity between different projects.
  • Modules are disabled by default. Why you might ask? 🤓 ... Setting myModule.enable = true; can be done from multiple places, moreover we can even assign priorities to these expressions (by utilising lib.mkOverride), however, we can import a given module once and only once ... additional imports will yield errors. This behaviour makes it hard to reason about the dependencies of individual modules, which is why I opted for the behaviour -- import everything and enable only the parts that you need.
  • Use profiles to define and share common configurations packs. Profiles typically don't create and add any new functionality but instead preconfigure stuff.
  • Isolate home manager functionality in such a way so it can be used in non NixOS environments 👥
  • I prefer to only use inputs and system variables instead of the more convenient inputs' and self' of flake-parts due to the code being easier to copy and transfer to older non flake-parts codebases.

3. Software 🖥️

I have a bunch of machines running some nix or directly NixOS with a variety of setups. To discern between them but still use the same base I use nixos/hm modules and their appropriate profiles.

3.1. Academia 👩🏽‍💼

  1. org-roam: This is the heart of everything that I do, TODOs, daily journals, scratchpads, notetaking and personal research wiki. The internal wiki is interlinked with zotero entries as well as anki cards.
  2. zotero: This is my backend for all of my bibliography as well as the individual .pdf files. As of now I keep them up to date between machines using syncthing, but I’ll probably set up a personal cloud when I’ll have spare time.
  3. anki: Since I have the memory of worm I try to keep my long-term memory of different subjects fresh using flashcards. I sync the cards using ankis official cloud.

3.2. Secrets 🔑

For my day to day passwords I use a locally synced keepassxc encrypted database and for the NixOS based secrets I use agenix. I also try to avoid using any globally available pubkeys and rather tend to use machine specific ones instead (for obvious reasons).

Note: plz no pwn xd, if you see any vulnerabilities please, send me a mail at [email protected]

4. Installation 💾

TODO

5. Troubleshooting 😵‍💫

Write error: disk full; during nixos-install

If you get any error of this kind during the installation of this flake you have most likely run out of $TMPDIR space. This is usually due to $TMPDIR being set up as a RAM based tmpfs and thus not having enough RAM for nix store cache during installation.

The most clean & general solution to this would be to create a minimal based installation and then run a nixos-rebuild (and I still might do that) but that kind of defeats the purpose of what I am aiming for which would be to run nixos-install, a single command, and end up with a fully prepared system.

Considering that a quick workaround is to navigate $TMPDIR to a different folder (this might slow the installation process if you redirect it to a spinning disk tmp filesystem, however, assuming you have a decent bandwidth is’s still just by minutes)

mkdir -p /mnt/tmp
USER=$USER TMPDIR="/mnt/tmp" nixos-install --root /mnt --flake .#$HOST

A different solution in case you have more spare RAM would be to remount tmpfs, for example

mount -o remount,size=15G /tmp

6. Impurities 💩

I heavily dislike using the --impure flag, which is unfortunately required in certain use cases, and I go really out of my way to patch stuff and avoid using it.

6.1 Currently known impurities

  • none! 🚀🚀

6.2 Notes

  • shadow-nix and all its forks rely on impure imports of hashes, so I am maintaining my own fork tsandrini/shadow-nix
  • I was previously using devenv, however, it still doesn't work really well in a pure mode, so switched to a simple devshell instead.

7. Resources 📚

The whole nix ecosystem is in its foundations a revolutionary piece of software and once you get the hang of it you feel like you’ve really conquered the art of computer wizardry, however, it’s so different from everything that is the current status quo of compsci and thus needs appropriate extensive documentation/tutorials/etc… which is, however, currently not the case.

Due to this exact reason I’m leaving here a list of resources/flakes that helped me to (somewhat) learn the ways of nix (TODO: maybe write more? manual.org?)

8. Credits & Special thanks

To reiterate the previous Resources section, here are also some explicit shoutouts & thanks to the people from whom I have at some point in time taken some piece of code or have been inspired from. Huge thanks ❤️

8.1 Major help

These are people that are engrained in the nix community and whose work I/we use on a daily basis. I hope they will happily continue to be a part of the nix community and I thank them for all of their contributions.

edolstra -- grahamc -- domenkozar -- Mic92 -- hlissner -- viperML -- roberth -- fufexan -- NobbZ

8.2 Additional help

Additional help with certain specific areas, inspiration or code snippets.

balsoft -- dc-tec -- notusknot