5 ms·
What a coincidence. I was just asking about NixOS on Mastodon. Reposting (I'm on a mobile, little time to type): " a question on dev environment isolation. Is
by TeMPOraL 5y ago
What a coincidence. I was just asking about NixOS on Mastodon. Reposting (I'm on a mobile, little time to type):
" a question on dev environment isolation. Is either #NixOS or #GUIX usable as an OS for day-to-day use (coding, browsing, occasional gaming)? Or is it better to just use their respective package managers on top of regular Linux? Also, anyone here doing desktop #virtualization? Is there a sense of running a #VM per project? Is that a viable alternative to dual-booing Windows when I want to do some Windows dev or play a game?
I'm planning to overhaul my desktop and am exploring options."
- lillecarl 5y agoI have a Windows VM on a NixOS host for gaming, was really quite convenient to set it up, I set it up on a separate drive to be able to boot native too but I ended up never really doing it, so I will reconfigure my 2 drives as a Zraid and have windows on a Zvol instead. NVIDIA works great, but if I were to buy new hardware I'd go AMD (maybe Intel when the time comes)
- depressedpanda 5y ago> I have a Windows VM on a NixOS host for gaming, was really quite convenient to set it up, I set it up on a separate drive to be able to boot native too I've been planning on doing exactly this, but haven't had the time to figure out the best way of going about it. Is there a good guide/write up you'd recommend? (I already have a Windows 10 install on a separate SSD, but I rarely boot it because I can't stand the OS)
- gallexme 5y agoI use https://github.com/danielfullmer/nixos-nvidia-vgpu https://github.com/danielfullmer/nixos-nvidia-vgpu + https://looking-glass.io/ https://looking-glass.io/ very successfully Can theoretically game on Linux and windows at same time with just a single gpu (2080 ti), mainly use it cause I only have single gpu and I don't want to loose hardware acceleration on Linux, the nixos module both applies a the vgpu unlocker for consumer graphic cards (so u can split a gpu in multiple virtual gpus) https://github.com/DualCoder/vgpu_unlock https://github.com/DualCoder/vgpu_unlock And merges it with the GeForce drivers so the host gpu does not stop having display output And I just passthrough the vgpu and Xbox controllers to the vm with qemu and my main windows nvme disk (windows naturally just works inside and outside a vm for me, dual boot)
- lillecarl 5y agoSo first I did this I did it on manjaro using this archwiki article: https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF When I moved to NixOS I just did a normal NixOS install and applied the same parameters to kernel boot as before and passed the GPU through. I was using looking-glass at first, but my computer is too slow and crappy (memory bandwidth seems to choke) to run 144fps in overwatch. You just pass the entire block device into the VM if you wanna keep your setup, or pass it through with as PCIE if it's an NVMe device. I thought it'd be hard, but you'll be up and running in a day
- smoldesu 5y agoOverwatch is also highly optimized via Wine, if you're looking to play. I'm on 6-year-old hardware (i5 4460, GTX 1050ti) and I have no problem hitting 120+ FPS in-game. https://www.youtube.com/watch?v=voXc1nCD4IA https://www.youtube.com/watch?v=voXc1nCD4IA This video is a pretty good demonstration of how neck-and-neck the performance is these days. Frankly, I feel like it stutters less in Linux, but I might just be imagining things.
- forgotpwd16 5y agoDon't know about Guix System but I've used NixOS as main OS for third year now just fine. Of course for coding you'll need to learn how to create (basically learn Nix, the language) an environment that has the libraries used in the specific project. The last question applies to any distro. Gaming is viable if you've GPU passthrough.
- Narice 5y agoFor dev environment s I would recommend taking a look at devshell: https://github.com/numtide/devshell https://github.com/numtide/devshell
- temp0826 5y agore: vm per project- Hashicorp's Vagrant has been around for over a decade if you want to keep beating that horse.
- TeMPOraL 5y agoI don't mean isolating just the project, but also its development environment, tools for making assets, their dependencies, etc. Possibly persisting runtime state when switching over to a different project. Basically, as if each project had its own dedicated laptop. IIRC, Vagrant was geared for just project isolation, and didn't offer the optimum VM management experience.
- opan 5y agoGuix System is very usable as a main OS if your hardware is compatible. Linux-libre gives some people trouble with their GPU or WiFi. I use a ThinkPad T440p with the WLAN card removed, and everything that remains works fine. If you need blobs for an AMD GPU or WLAN, you likely need to swap out linux-libre for linux in your config. I haven't done this myself, but I know a few people who have done so. Also consider that discussion of non-free bits like this are not allowed in the official IRC and mailing lists, so you'll have to either be on your own or find the semi-secret places where guix users use non-free things. All that aside, I've spent time with NixOS and Guix System both, and much prefer the latter. Nix has more packages, but some of them (which I actually use in everyday life) are broken in odd ways where they work fine in Guix. I also like to use a distro without systemd when possible, and find the guix community feels more alive/active. Getting more Guix users (and packagers) will help narrow the gap as well. There are enough packages that I don't miss too much in daily use, and you can comfortably get all your emacs packages through guix, I just often can't try some new program when I first learn about it.
- catern 5y agoYou may already realize this, but you don't need to run a VM per project if you're using Nix; Nix lets you have as many self-contained development environments as you like, all on one machine without VMs or containers.
- TeMPOraL 5y agoThat was my understanding, but I wasn't sure. Thanks for clarifying.
- suchar 5y agoOver the years, I tested multiple options, and currently, I'm using NixOS declarative containers. It requires more work to create a new environment than with nix-shell, but in my experience, this is not a bottleneck. With some setup, you can even run graphical applications inside containers. I've written more about this and other approaches on my blog: https://msucharski.eu/posts/application-isolation-nixos-containers/ https://msucharski.eu/posts/application-isolation-nixos-cont... if you are interested. It is pretty specific to my needs, so it may not work for you. Regarding the Windows: after playing with GPU-passthrough, I came back to dual-boot. It is more reliable because you are less likely to run into some hardware quirk.
- mindslight 5y agoKind of orthogonal to your questions, but perhaps it helps: NixOS solves OS-level issues. If you don't appreciate that you're having them, or you're solving them by other means, you might not see the appeal. I tried NixOS on three separate occasions before it stuck. My existing setup is based on Debian and templating config files across machines (small heterogeneous network). This system can rebuild any machine from a blank slate, and so the first two times I tried NixOS I didn't see what it could give me - my configuration was already quite declarative and centralized. The third time trying NixOS, I was aiming to make an image for a Raspberry Pi (after a Raspbian apt-get upgrade had borked a system once again). Seeing that I could make a full build from source, cross compiled or emulation compiled, with a few lines in a config file made it all click. It felt reminiscent of the Lisp curse where such a thing isn't well documented, because it's just second nature once you understand the system. I've only felt that level of paradigm changing expressive power a few times, and NixOS was one of them. What is keeping me heading in the NixOS direction is the greater source accessibility. I've run Debian for 20+ years, and I still don't routinely modify existing packages. Whereas with Nix it's second nature because it's essentially a source distribution.
- m45t3r 5y ago> Is either #NixOS or #GUIX usable as an OS for day-to-day use (coding, browsing, occasional gaming)? Yeah, definitively. I use only NixOS on all my machines for about 3 years already. My machines are working so well nowadays that I rarely have to change anything [1], even during major upgrades (between stable versions). I don't fear anymore if a machine could break tomorrow. I know that it will be very easy to restore it to a working state. Last time my working notebook broke I didn't even bother making a backup (except from some data on my Home), just installed my config and it worked exactly it was working before. Also, I don't fear changing my system: if something brokes after the changes, I can just rollback. I use for all those three purposes, mainly coding and browsing, but some light gaming. Steam actually works better on NixOS than any other distro I tested before thanks to the isolation that Nix provides. > a question on dev environment isolation. [...] Or is it better to just use their respective package managers on top of regular Linux? I imagine those are part of the same question. Generally what I recommend for newbies is to start small: yeah, it is fine to continue using your respective package manager, specially if you don't need "native compilation" [2]. After you get more experience with Nix though, I would recommend you to start isolating your development environments. Nix has its own `nix-shell`, that it is kinda bare-bones but works well, and can be very practical once you use something like `nix-direnv` (https://github.com/nix-community/nix-direnv/ https://github.com/nix-community/nix-direnv/). There is also this `devshell` (https://numtide.github.io/devshell/intro.html https://numtide.github.io/devshell/intro.html) project that is interesting. > Also, anyone here doing desktop #virtualization? Is there a sense of running a #VM per project? Is that a viable alternative to dual-booing Windows when I want to do some Windows dev or play a game? I put those two questions together because yes, I ran desktop virtualization on NixOS, and yes, I ran Windows on a VM to play games thanks to PCI-e passthrough (my dedicated GPU is connected directly to the Windows VM so the performance is near native) [3]. Again, I will not recommend you do to this right after starting NixOS since it is one more thing to possible frustrate you, but just so you know that it works and works well, specially because my VM configuration on NixOS is also on my `/etc/configuration.nix` and it is fully reproducible. Coincidentally I was messing with my VM settings yesterday and "broke" my VM multiple times, however I just run one command and restored it to the previous state. However I never bothered to dual-boot NixOS/Windows, because I barely use Windows nowadays so I find rebooting my system just to use Windows bothersome. Probably not your case, so maybe dual-boot makes more sense. This article should help and seems very easy to do (again, disclaimer, not tested because I never needed it): https://nixos.wiki/wiki/Dual_Booting_NixOS_and_Windows https://nixos.wiki/wiki/Dual_Booting_NixOS_and_Windows. About the VM per project, unless you want to do this for some other reason (security maybe?), you don't need to. As I said before, you can use things like `nix-shell` and this will already give isolation enough for development purposes. --- Some closing words: remember, start small! Nix/NixOS is a journey. You will learn eventually what you need. However, if you try too many things at the same time you will feel frustrated. The official documentation is good, however it kinda assumes that you know what we are talking about already, and it is also very big and not well separated in steps, so it feels overwhelming for newbies. To supplant this there are many blog posts, however some of them are out-of-date (it shouldn't be too much of an issue though, since Nix tries really hard to backwards compatible). You will eventually need to learn the minimum of the language to read the source code. It is less difficult than it seems, because while Nix as a language is strange at the first glance, it is a very well designed DSL for the domain. After sometime editing your own configuration you will naturally learn the Nix language, and can start to understand what is happening. For where to start, I recommend trying to replicate your current system in a NixOS install. If you already use another Linux distro try to get the same desktop environment and packages that you already use. If you're coming from Windows/macOS try Gnome or KDE. Just tweak the system until you're happy with the result. Eventually try Home-Manager to manage your Home configuration in the same way as in NixOS (fully declarative), and once you feel happy, you can try Flakes (making you configuration fully reproducible). This process can takes months or even years, but don't bother or rush, just continue your journey. It really pays off in the long run. [1]: well, I am on a "coding spree" right now so I am doing many changes, most to refactor some things that I wasn't happy before; but before this coding spree my configuration didn't change significantly for almost a year. [2]: what I call having to compile C/C++ libraries in an another language like Python (giving it an example here, almost any language has a similar mechanism since C/C++ ecosystem is huge), that generally needs to dynamically link with whatever you have in your system installed. This is possible on Nix/NixOS, and easy once you know what you're doing, but it is different from anything else so it does trip newbies. [3]: if you're interested on this approach, I used this guide when started: https://forum.level1techs.com/t/nixos-vfio-pcie-passthrough/130916 https://forum.level1techs.com/t/nixos-vfio-pcie-passthrough/.... To get it fully reproducible it though, there is no way on NixOS itself yet, however there is a good guide here: https://nixos.wiki/wiki/NixOps/Virtualization#Setting_Up_the_Guests https://nixos.wiki/wiki/NixOps/Virtualization#Setting_Up_the...
- Ericson2314 5y agoI've used it as my daily driver for the last 7 years. I don't really play games that much but you can install Steam, and at that point the distro doesn't matter as much. (Though for a bunch of reasons I think NixOS would be the ideal distro to base SteamOS off of, and Valve & co. are only now closing the gap years later with some still-beta flatpak-esque stuff.) I would say, if you can get excited with messing around with Nix instead of playing video games, you're going to have a better time. Not because you need to (though you might if this is your first time doing Linux), but because the joy lies in being able to understand "what the fuck is actually going on!" for the first time, and getting to that level of understanding will take some time.
- podiki 5y agoI've recently switched (from Arch) to Guix for my new desktop. Works great, though does require some work (I enjoy the tinkering). Depends on what you want of course, and needs you have especially in the non-free or things like JS (Guix does not package, but you can use Nix package manager or other tools I think). Here is the HN post for the article I wrote to see the article (about the hardware) and discussion https://news.ycombinator.com/item?id=28628344 https://news.ycombinator.com/item?id=28628344 I'll have some followups soon on what I like about Guix for this usage and how I set things up, with some tips.
- Apaec 5y ago> #NixOS or #GUIX Two years user of NixOS here, moved after using Arch for about 3 years. Overall I'm really happy with it. I also evaluated Guix when migrating from Arch. My raw and honest opinion about it is that it's just an attempt at open source fragmentation with zero innovation(I'm not impressed by Scheme or Lisps) that uses GNU marketing/branding/philosophy to gain adoption. I decided not to waste any time with it.
- pxc 5y ago> My raw and honest opinion about [Guix/GuixSD] is that it's just an attempt at open source fragmentation with zero innovation(I'm not impressed by Scheme or Lisps) that uses GNU marketing/branding/philosophy to gain adoption. This is an extremely uncharitable take on Guix. I hope it doesn't take root in the Nix community, not least of all because it overlooks areas where Nix could stand to learn from Guix. Guix is ahead of Nix with: • grafts • its excellent subcommand interface • documentation • explicit organization/structure for contributors • the bootstrap story • trusting/signing channels and it also has some interesting differences in choice of abstractions at various levels, like its service system vs. NixOS' modules. Guix's existence doesn't harm Nix users or developers in any way, and there's no need for this kind of hostility or dismissiveness. As a Nix user, I hope Guix flourishes.