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 innitrile-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 theCLEANABCPATH
environment variable, but would be neater with command line options (clean-nc/base/clm!10 fixesCLEANABCPATH
and renames it toCLM_ARTIFACTS_PATH
) -
In Nitrile, recognize Nix and adapt include paths to the appropriate directories inIn Nix expressions, call Nitrile with an option to set the appropriate include paths for Clean code (see also #16 (closed))/nix/store
CLEANLIB
problem
The 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 toPATH
in Nitrile -
clm
should look first inPATH
and then inCLEANLIB
-
In Nitrile 0.3, deprecate exe
directories and expect binaries to be inbin
(warning when the package includesexe
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 toPATH
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
-
Automatically generate nix expressions for all packages in the registry (https://gitlab.com/ErinvanderVeen/nitrile.nix) -
Automatically publish these expressions
Documentation
-
Installation instructions on https://clean-lang.org/about.html -
Usage instructions in the Nitrile docs
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