!oeFELgatfbdiAEkJAY:nixos.org

Nix Zürich

125 Members
https://zurich.nix.ug/ - Next ZHF event 23-24 November 202429 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
14 Mar 2024
@mjolnir:nixos.orgNixOS Moderation Botchanged room power levels.18:44:24
16 Mar 2024
@oldaq:matrix.orgPablo Escodebar

fricklerhandwerk: https://github.com/escodebar/life/commits/nix/

I pushed the current iteration. It was fun 🤩

15:31:24
@fricklerhandwerk:matrix.orgfricklerhandwerk I can recommend nix-unit btw, as it also allows catching exceptions. 15:37:01
@oldaq:matrix.orgPablo EscodebarI’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.js15:37:18
@oldaq:matrix.orgPablo EscodebarI am pretty sure there are a couple on non-idiomatic parts. Would love to get some feedback.15:38:04
@oldaq:matrix.orgPablo EscodebarAll 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:matrix.orgfricklerhandwerk

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:matrix.orgfricklerhandwerk 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:matrix.orgfricklerhandwerk * 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:matrix.orgfricklerhandwerk 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:matrix.orgfricklerhandwerkOtherwise looks reasonable. I'd factor and name a few things differently, but that comes with experience working on growing code bases.15:48:57
@oldaq:matrix.orgPablo EscodebarEveryone: 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

Show newer messages


Back to Room ListRoom Version: 10