1# Misc tips 2 3This page contains stuff that ~~I couldn't be bothered to move to the new format~~ is probably outdated or just short tips. 4 5*previously: tops and bottoms* 6 7## @ (at) syntax 8very simple. 9 10```nix 11args@{a, b, c, ...}: { 12 # args.a and a are the same 13 some = "value"; 14} 15``` 16 17## nginx regex location 18```nix 19{ 20 locations."~ \.php$".extraConfig = '' 21 # balls 22 ''; 23} 24``` 25from [nixos wiki](https://nixos.wiki/wiki/Nginx#LEMP_stack) 26 27## adding a package with an overlay to a package set 28 29for package sets with a scope, you will have to do something like 30```nix 31final: prev: { 32 nimPackages = prev.nimPackages.overrideScope (final': prev': { 33 sha1 = final'.callPackage ./sha1.nix {}; 34 oauth = final'.callPackage ./oauth.nix {}; 35 }); 36} 37``` 38There's an alternative method that i used to use here: 39 40https://github.com/soopyc/nix-on-koumakan/blob/30e65402d22b000a3b5af6c9e5ea48a2b58a54e0/overlays/nim/oauth/default.nix 41 42however i do not think that's the best way lol 43 44## what the hell is an IFD?? 45IFD stands for import from derivation. 46 47*nixos/nixpkgs really need better and significantly less scattered documentation while improving manual readability.* 48 49# Useful links 50 51Builtin stdlib functions search engine: https://noogle.dev/