Automatically generating deb packages from nixpkgs

To be honest I don’t see why nix could not be (ab)used to do something along this line. Of course if we want the full purity of nix, nix-bundle or alike can’t be avoided… but they will not use the system’s libraries which defeat the purpose of packaging. But I can imagine other solutions.

  • first, why can’t we simply “unpatch” a nix output? We could reset the loader to use /lib, remove the RPATH, remove the wrappers etc… Also, we could use passthru to provive automatically the name of the dependency libraries (like mylib.debian.packages could provide the name of the debian packages to install to install mylib), and/or use a database to know which deb provides which .so file. I guess some quite specific program might fail if they rely too heavily on patching… but I guess for most programs it does make sense.

Otherwise, the existing deb packaging functions might already be good enough, I guess they use $out=/ to install it in a debian-like systen? If the ondy problem is to automatically provide dependency names, passthru should work nicely.

1 Like