by Kednicma · 6y ago · 0 comments
- app that is binary , so you can't build it from source, but is using dynamic libraries, then you can use autoPatchelfHook to tell nix to patch the binary to swap out the libraries to nix's version
- app that uses a lot of hard coded file system path that you would prefer not to patch them all out, then you can use buildFHSUserEnv to package/run the application/package in full FHS-compatible scenario
but the main point is that, nix is extreme in its approach, and the best approach in my opinion, is to do swapping step by step, ex:
you want to convert a existing project to nix, lets say nodejs
- you add the main deps in the default.nix (nodejs, yarn, high level utility needed to build)
- use sandBox false to allow building the app with yarn/npm in internet accessible(by default nix uses sandBox which disallow internet inside build step, which causes issue like npm install not working, etc)
- confirm working, then start using tool likes yarn2nix, other similar, and convert the packages itself to a usable set of nix packages
though I do agree that nix have the knowledge bias issue, and alot of my learning of nix involve me looking at the nixpkg sources itself and sometime even the nix's code
Guix?
Grafting Python on top of the idiosyncrasies of how Nix does things would be a nightmare of impedance mismatch.
Any official package from Nix belongs to this single repository, making it easy to see what other packages are doing. If I want to see how python packaging is done, I simply search "python" in the nixpkgs repository.
It's also easier to grasp what is going on in nixpkgs than other packaging systems. The Nix expression language offers better readability than say, RPM spec files. Meanwhile the nixpkgs repository includes support for numerous build systems and frameworks. This combined allows you to create packages with minimal effort most of the time.
It's more focused on the result then on how you get there, but that result really impressed me.
yourthing_custom = yourthing.withPackages(ps: [ps.plugin1 ps.plugin2 ] )
Or are you stuck with how to implement it?