+++ date = "2023-09-22T17:48:53+00:00" lastmod = "2023-09-22T17:48:53+00:00" tags = [ "linux", "lists" ] author = "tdro" +++ Some `nix` language gotchas I've experienced while using [NixOS](https://nixos.org/explore) personally: 1. Avoid [`with`](https://nixos.org/manual/nix/stable/language/constructs#with-expressions) expressions unless with the [`inherit`](https://nixos.org/manual/nix/stable/language/constructs#inheriting-attributes) keyword for identifying hidden attributes in scope. 2. Avoid the [`rec`](https://nixos.org/manual/nix/stable/language/constructs#recursive-sets) keyword unless there's tracking/control of infinite set recursion (self naming/references). 3. Avoid importing more than 1 instance of [``](https://github.com/NixOS/nixpkgs#readme) for any evaluation chain unless there's magic compute and "infinite" memory. Tricky is numero three, but crucial for fast feedback regardless of the current thing? I don't poke around as much to know anymore but; [legacy](https://nixos.org/manual/nix/stable/command-ref/main-commands), [flakes](https://nixos.org/manual/nix/stable/command-ref/experimental-commands), [community](https://github.com/nix-community), and possibly others.