4 ms·
Great introduction and overview on the theoretic foundations of the nix ecosystem! For people new to it, I am trying to provide a quick glossary of terms here,
by phaer 4y ago
Great introduction and overview on the theoretic foundations of the nix ecosystem!
For people new to it, I am trying to provide a quick glossary of terms here, as I understand them after about 2 years of using nix.
* nix: a language to create derivations and the interpreter/package-manager which provides the implementation of said language. It currently offers two command-line interfaces, the stable on with hyphenated commands like "nix-build", "nix-shell", etc. And the newer, "experimental" one which includes support for nix flakes and so on, without hyphens: nix build, nix shell, nix run, etc.
repo: https://github.com/nixos/nix
docs: https://nixos.org/manual/nix/stable/
* nixpkgs & nixos is a huge mono-repo containing instructions how to fetch the source of tenthousands of software packages and how to build them on supported platforms. It also contains the whole nixos operating system and tooling to support all of that.
repo: https://github.com/NixOS/nixpkgs https://github.com/NixOS/nixpkgs
docs: https://nixos.org/manual/nixpkgs/stable/ https://nixos.org/manual/nixpkgs/stable/
docs nixos: https://nixos.org/manual/nixos/stable/ https://nixos.org/manual/nixos/stable/
This tooling includes higher-level helpers for language-/environment-specific packaging, like "buildGoModule", "buildRustPackage" and so on, as well as e.g. tooling to run integration tests in a whole cluster of inter-connected linux VMs!
Packages which are submitted to nixpkgs must fulfill certain criteria, such as not using "IFD" (input-from-derivation, to simplify: "letting nix evaluate nix-code which was generated by another deriviation/"nix package".
nixpkgs is alive and well with lots of daily contribution and an everlasting effort to keep Hydra, the nix-specific CI/CD system and public binary caches up to date and responsive. Thanks to all maintainers & contributors!
* flakes are an approach to standardize a way to package nix code outside of nixpkgs but to still keep it re-usable. They are still "experimental" as the details are figured out, but nevertheless used in production. There are some frame-works to keep boilerplate low, like "flake-utils", "flake-parts" and others, as well as e.g. deployment tools like "colmena" and "deploy-rs" and re-usable helpers for system-configuration like e.g. https://github.com/nix-community/impermanence https://github.com/nix-community/impermanence
There's lots of other stuff in the community, things like home-manager, direnv + flakes and devshells changed my workflow fundamentally to the better since I've switched. If you got the time and are still interested, join us on matrix or elsewhere :)
https://github.com/nix-community/awesome-nix https://github.com/nix-community/awesome-nix
- eulenteufel 4y agoI'll consider flakes usable for packaging software when they support passing options. The respective issue [0] has been closed unfortunately. Perhaps I am misunderstanding what flakes are meant to be (a more formalized standard way to define nix packages and apps), but a lot packages in nixpkgs have a plethora of parameters that as of now can not really be mapped to a functionality in nix flakes. [0] https://github.com/NixOS/nix/issues/2861 https://github.com/NixOS/nix/issues/2861
- pxc 4y agoDepending on your specific needs, the channelsConfig (modify arguments passed to Nixpkgs) and overlay tooling in flake-utils-plus may be adequate: https://github.com/gytis-ivaskevicius/flake-utils-plus/tree/v1.3.1 https://github.com/gytis-ivaskevicius/flake-utils-plus/tree/... You can take a package from a flake input and call it with other args in your overlays, for example
- eulenteufel 4y agoIt's nice that there is a workaround, but passing build options is not something that should require a library. There should be a well documented standard way to do it.
- pxc 4y agoAgreed. For most early adopters of flakes, flake-utils-plus is the de facto standard solution. It would be good to see something like it built into Nix or Nixpkgs and blessed in the official docs, as the flakes feature approaches completion.
- phaer 4y agoFlake-utils, flake-utils-plus, https://flake.parts/ https://flake.parts/, https://github.com/divnix/std/ https://github.com/divnix/std/ and others :D