OpenBSD + Nix is now a thing

ah thanks, mixed the bsd’s up.

so at least https://github.com/openbsd/ports/blob/f8083bbcde77f23eb0ab33d2fa3d6fa9ac96daf2/sysutils/nix/patches/patch-src_nix-daemon_nix-daemon_cc should be upstreamed. I am looking into boost_context-mt in the next days. I don’t think the other patches should be upstreamed as is.

2 Likes

I would like to see some NixOS/k*BSD built around GitHub - InitWare/InitWare: The InitWare Suite of Middleware allows you to manage services and system resources as logical entities called units. Its main component is a service management ("init") system.. I have some plans on baby steps to get us closer to that.

The best thing folks can do right now is help with cross compilations to new platforms (purer and easier to keep working in CI today than native stuff! And the best way to help with that is poke ones head in https://matrix.to/#/#exotic:nixos.org.

5 Likes

I suspect this is naive since I avoid the module system as much as I can and my knowledge is a little superficial+user-oriented, but whenever I’m doing something like setting up a development shell for a database or web server that has a module, I end up wondering if it would make sense to ~pull more config-generation logic towards the packages in the form of passthru functions and slim down the existing module implementations in nixos/nix-darwin/home-manager (and maybe devenv or others?)

I guess it might make the external module systems too sensitive to the nixpkgs rev, but I could also imagine it making it easier to:

  • deduplicate work
  • get more people invested in refining the config abstractions
  • create more leverage for setting up dev environments
  • make it easier to iterate on the groundwork needed for good BSD/etc. modules by exercising them in dev environments
  • minimize the module work needed to jump from there to the first palatable BSD-based NixOS (and maybe also each Nth? not knowledgeable enough about BSDs to know how much overlap there’d be at this level)
2 Likes

Yeah we should try to share stuff between NixOS and the other module system things. I have yet to fully dive into that so I don’t have many specific suggestions, but Initware in being a systemd fork is supposed to help avoid / shrink down that problem by allowing us to use the same unit files.

4 Likes

Awesome news. I can’t wait for FreeBSD support !

1 Like

Nix is already packaged for FreeBSD: https://cgit.freebsd.org/ports/tree/sysutils/nix

2 Likes

It feels like NixOS modules are generally quite tied to systemd, so I’m not sure how it would work on other OSes than GNU/Linux/systemd…

I believe this was discussed by @7c6f434c and @sander a few years ago at NixCon IIRC. I don’t believe anything came of it, though. It is a good idea.

Parts of a module take care of generating config files for a service. These parts could be moved closer to the package itself.

2 Likes

Yeah, because what I truly want are functions and direct overrides, and a) people want type checking b) we don’t have a systematic type checking solution except the module system that I avoid as far as possible, there is a way to at least suppress the worst things about the module system, but I haven’t figured out a complete integration solution for that. (I haven’t got around to spend much time on it, either; if someone is already good at using the module system and makes a PoC PR, I will happily update the RFC to document the proposed solution in the currently-missing part, and get the things moving again)

2 Likes