Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would be more like

function main(pkgs: Map String Package = (import(sys.path("nixpkgs"))({}))){ }

I'm not sure if it's better at this point...



Except not everything in nixpkgs is a package! It's closer to a standard library that just happens to include a lot of packages.


In fact, a derivation is not even a type. AFAIK it is only informally defined as an attribute set with an attribute type with the value derivation:

https://github.com/NixOS/nixpkgs/blob/2cd8c35c1fdfdb773df7ec...

I am pretty sure that instantiating a derivation probably requires more attributes. But in the end they are just attribute sets (which is one of the types in Nix besides strings, lists, etc.).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: