3 ms·
What's the difference between this and just using a default.nix/flake?
by zamalek 4y ago
What's the difference between this and just using a default.nix/flake?
- jitl 4y agoNot needing to have a PhD in Nix
- wingmanjd 4y agoI feel this. I've attempted a few times to try NixOS, and I can't seem to quite grok it for my use case. I sort of wish I could sit someone down and ask "here's what I'm doing now in rpm/deb land across all of these devices (x86, mobile, ARM). How do I do this in Nix in a sustainable way?"
- zamalek 4y agoThinking about it like rpm/deb is where you're getting hung up. Think of it more along the lines of npm, but for your OS (or just your profile in the case of nixpkgs+home-manager). At the most trivial level, you can set up some packages to install [1][2]. You'll generally come out ahead of classical package managers if you do that and nothing else. Nix also acknowledges the configuration issue. Think of this like copying some config files using a dockerfile. You can either use literals[3], or use the nix language to generate the config [4] (provided that someone has created the required projection from nix to config). What this ends up becoming is a single git repo with your entire system setup. My repo gets a bit fancier: I have my home desktop (currently Nixos, but it distrohops a lot), my personal laptop running Ubuntu+intune+nixpkgs for work, and then my work Mac machine (which I am aiming to get rid of). The single repo contains nix configs for all 3, and shares config where appropriate. I really need to write a blog post about Nix in 2023. The main issue with getting started right now is that the installer requires some convincing to use flakes (not to mention that flakes are disabled by default), and you really should be using flakes. [1]: https://gitlab.com/jcdickinson/nix/-/blob/main/system/jono-desktop.nix#L153 https://gitlab.com/jcdickinson/nix/-/blob/main/system/jono-d... [2]: https://gitlab.com/jcdickinson/nix/-/blob/main/home/general.nix#L27 https://gitlab.com/jcdickinson/nix/-/blob/main/home/general.... [3]: https://gitlab.com/jcdickinson/nix/-/blob/main/home/general.nix#L138 https://gitlab.com/jcdickinson/nix/-/blob/main/home/general.... [4]: https://gitlab.com/jcdickinson/nix/-/blob/main/home/dconf.nix https://gitlab.com/jcdickinson/nix/-/blob/main/home/dconf.ni...
- mandelken 4y agoIt's funny how the Devbox docs mention this explicitly: > Don't worry: You can use Devbox without needing to learn the Nix Language.
- Congeec 4y agoAFAIK, a vanilla flake.nix does not help you start/stop services like docker- compose does. You need extra customization. devbox is like a wrapper around nix and docker-compose
- brunoqc 4y agoI wonder if it would just be possible to run a nixos module instead. Like using services.nginx...
- striking 4y agoSystemd isn't exactly packaged for macOS, which I believe is one of the targets for Devbox.
- pxc 4y agoRight! At some point, we could see somethinf like this in the Nix world— call it the Grand Unified Module Systwm— but right now, NixOS modules make NixOS-specific assumptions (e.g., total ownership of /etc., the use of systemd, etc.). Thus, use of such modules in other contexts (e.g., macOS in the case of Nix-Darwin, or Linux without running the whole show in the case of Home Manager) requires a distinct collection of modules. There's been some experimental work towards this end for a long time, once under the banner of a 'service abstraction layer' for NixOS, and more recently Sander van der Burg's 'Nix Process Management Framework'. But right now, none of the mature module systems are 'universal' in the sense of being usable in all of the many environments Nix can run in. If you were going to roll your own solution, imo using the latter of those efforts (nix-processmgmt, probably backed by supervisord) in a flake.nix or shell.nix seems like a sensible way to go. At the same time, I think using devbox to wrap all that config looks like a pretty nice way to go for teams or projects that don't already have much Nix buy-in.
- striking 4y agoI'm currently using s6 directly. It's actually pretty okay. Going to spend some more time with it as we have some more specific wants and needs than teams with less buy-in