| 14 Mar 2024 |
| NixOS Moderation Botchanged room power levels. | 18:44:24 |
| 16 Mar 2024 |
Pablo Escodebar | fricklerhandwerk: https://github.com/escodebar/life/commits/nix/
I pushed the current iteration. It was fun 🤩 | 15:31:24 |
fricklerhandwerk | I can recommend nix-unit btw, as it also allows catching exceptions. | 15:37:01 |
Pablo Escodebar | I’ll clean up the repo at some point. I’ll push a branch for each programming language I implemented the game in. Previously it was just for an implementation in vue.js | 15:37:18 |
Pablo Escodebar | I am pretty sure there are a couple on non-idiomatic parts. Would love to get some feedback. | 15:38:04 |
Pablo Escodebar | All in all, I’m very happy to have done this (at least twice). Whenever I encounter nix code I’m now capable to read it and understand what is what 🥰 | 15:39:00 |
fricklerhandwerk | I recommend to generally avoid import within files that are not at the very top level, especially of lookup paths like here: https://github.com/escodebar/life/blob/nix/life/rules.nix#L3
Use { lib }: ... - that makes your code a lot more reusable
| 15:42:35 |
fricklerhandwerk | Also, put your top-level files (like flake.nix and default.nix) at the root of the repo, otherwise its a pain to actually call them | 15:43:37 |
fricklerhandwerk | * Also, put your top-level files (like flake.nix and default.nix) at the root of the repo, otherwise its a pain to actually call them without manually cloning your repo | 15:43:45 |
fricklerhandwerk | There's another, yet undocumented best practice: avoid using builtins directly and take the aliases from pkgs.lib. Nix cannot be reliably versioned, but Nixpkgs maintainers put a lot of effort into making library calls cross-version compatible | 15:46:56 |
fricklerhandwerk | Otherwise looks reasonable. I'd factor and name a few things differently, but that comes with experience working on growing code bases. | 15:48:57 |
Pablo Escodebar | Everyone: feel free to make pull requests with improvements and explanations of the improvements so I can further learn the language and the ecosystem 😊😘 | 15:52:35 |