Skip to content

Nix support

Problem to solve

Nix users should be able to use nitrile.

Proposal

Overview:

  • Packages are stored in /nix/store
  • clm artifacts are stored in nitrile-packages/nix-x64 / -x86

To do:

The library problem

Library source files are now in nitrile-packages and ABC and object code is generated in the same directory. In Nix, libraries are stored in read-only /nix/store instead.

  • Add clm option to generate ABC and object code in a single directory (nitrile-packages/nix-x64) -- probably already implemented with the CLEANABCPATH environment variable, but would be neater with command line options (clean-nc/base/clm!10 fixes CLEANABCPATH and renames it to CLM_ARTIFACTS_PATH)
  • In Nitrile, recognize Nix and adapt include paths to the appropriate directories in /nix/store In Nix expressions, call Nitrile with an option to set the appropriate include paths for Clean code (see also #16 (closed))
The CLEANLIB problem

There is only one path in CLEANLIB, but the binaries are spread out over many packages. This is currently fixed with nitrile-packages/TARGET/.home, but that's a hack. Goal: move these binaries to bin and use PATH instead of CLEANLIB.

  • ASAP, CLEANLIB should be added to PATH in Nitrile
  • clm should look first in PATH and then in CLEANLIB
  • In Nitrile 0.3, deprecate exe directories and expect binaries to be in bin (warning when the package includes exe directories)
  • In Nitrile 0.4, error when the package includes an exe directory
  • Eventually, don't set CLEANLIB any more in Nitrile and don't add exe directories to PATH
After bootstrapping
  • Add information to nitrile-metadata.json in packages: (1) commit hash; (2) path to nitrile.yml. This would make it possible to build from source; see #15 (comment 836094598).
Full integration

Documentation

Other considerations

  • If the registry URL needs to be hard-coded in more places now, this may be a good moment to buy a domain name.
Edited by Camil Staps