11 ms·
NixOS and the Art of OS Configuration (2018)
- ncmncm 5y agoHas anybody made a NixOS template image for QubesOS? Arguably dom0 of QubesOS really ought to be NixOS, too. Maybe in 4.2? (P.S. Loving this BSaG blog!)
- Stampo00 5y agoI want to use NixOS so bad Or what Arch has become. But I want to believe
- Firehawke 5y agoWhereas I just left Debian-based distros because I'm hitting that exact problem with backported patches not arriving in any reasonable length of time in many packages. There seems to be a real manpower problem over at Debian in terms of maintainers.
- poteznykrolik 5y agoI definitely feel like I'm hearing this about debian and it manifests worry, because I sense if we don't consolidate so many parallel oss volunteer based projects soon, we could lose a lot of valuable work to rot and collapse. but who would even undertake that survey and proposal process. I do wish our line of work would formalize into an international guilds so apprentices help learn to maintain this stuff on their way to becoming "journeymen", somehow.
- AnIdiotOnTheNet 5y agoThe real problem is an application distribution paradigm that relies on unpaid third party maintainers just to get up to date software.
- meribold 5y ago> Or what Arch has become. What has Arch become? I've been using it for 10 years and the only thing I can think of that has changed is the init system.
- trabant00 5y agoI was about to ask the same thing. I think I have more than 10 years and haven't noticed any significant change in Arch, it requires no additional work.
- KingMachiavelli 5y agoIt is still very good for some things like as a desktop OS, has very good Steam/Proton ecosystem, etc. Using Arch as a server can be a headache. Just today I updated a Arch VM running postresql. Postgresql needs to previous version present to do the upgrade. I had actually skipped a version (11 to 13) so Arch no longer had version 11 in the repos and old packages had broken dependencies. I ended up just installing the Nix package manager on the system. I started a shell with Postgres 11 & 12 both present to do one upgrade. Then I used another shell with 12 & 13 to do the final upgrade. It took like 10 minutes vs the hour I had spent trying to rollback packages on Arch.
- jorams 5y agoThis is definitely something Nix is very good at, but it's not a problem with Arch. Staying up to date with upstream is basically the point of the distro, so if you're going to postpone an update for a year you should be using something else.
- pxc 5y agoWhy do Arch users always do this? > We told you Arch would be bad at this does not refute (or even contradict) > Arch is bad at this The cost of Arch's KISS philosophy is a system that is uniquely brittle among Linux distros in a number of ways, and Arch users are totally unwilling to admit this except in the form of blaming users for having bad experiences.
- jegp 5y agoFrom personal experience, using NixOS saves me a lot of time compared to Debian based distros. The initial setup is painful, but after that you are in complete control. Don't need to update? Don't! I had desktop sessions running flawlessly for months without any interruptions. Never seen that before on other distros, really.
- therein 5y agoYeah I had a 680+ day uptime on my NixOS workstation until "GPU fell off the bus".
- bubblethink 5y ago>I want to use NixOS so bad ... But I want to believe It's an operating system, not a disney movie. Not sure what sort of redemption arc you are waiting for. If you are curious, try it. If not, then don't. What's all this business about believing ?
- muixoozie 5y agodid you just copy a reddit comment?
- deleted 5y ago[deleted]
- anandsuresh 5y agoLove to see more adoption of Nix and NixOS. I started my Nix journey a little over a year ago, and I regret not having switched sooner. A package-manager that also ships an operating system that can be customized from the bootloader up, using a purely functional programming language is the perfect configuration management tool! It does have some rough edges, and I did lose some hair figuring things out early on, but it has been getting better with each passing day. Pretty much the entirety of my setup at home is now built by Nix and runs NixOS, including my Macbook Air (runs NixOS on ZFS), and two Mac-Minis that PXE-boot a custom NixOS served by a Raspberry Pi 4 running a custom NixOS configuration that also acts as a firewall connecting wirlessly to my ISP's router. The Mac-Minis also double as build machines which makes for a pretty smooth experience when I'm building anything on my work laptop (a 2020 Macbook Pro running Big Sur) that I dock with my CinemaDisplay, which is wired thru an unmanaged switch to the rest. So far I haven't missed any packages that I could not find in nixpkgs, or customize just the way I wanted to. The community is pretty responsive and quick to merge any pull requests for fixes/upgrades. I would whole-heartedly recommend switching to Nix/NixOS/Nixpkgs.
- SkyMarshal 5y agoSame. I've been meaning to take the time to learn and switch to NixOS for several years now, and finally had some time to do it this past spring. I haven't been this happy and giddy with a new piece of technology since I completely eliminated Windows for Ubuntu back in 2009. There was a learning curve that took several months, but now that I've got everything I had on Ubuntu running smoothly on NixOS, I could never go back. And this for my daily driver, not a server or anything. My favorite part is how it enables rapid experimentation with different build configurations, without any concern about borking the current working build. If the new build breaks something, a single command rolls it back to the prior working build. If the new build crashes the system, just reboot and choose the prior working build in GRUB. When you're logged back in, call the rollback command to point the system back to the working build. This makes learning and testing both Nix itself and your particular system build faster, easier, stress-free, and just downright fun, which is invaluable. Declarative, deterministic, immutable OS builds is a significant step out of the tarpit of software complexity.
- georgewsinger 5y agoSimulaVR (www.simulavr.com) is planning on using NixOS as the basis for its Linux VR distro.
- ducktective 5y agoMeaning they plan to provide a `configuration.nix` to be used in any NixOS?
- b3n 5y agoI recently made the switch to Guix, which is a distro heavily inspired by NixOS. It even has a Nix service[1] which is easily enabled to get the best of both worlds. Highly recommended! [1] https://guix.gnu.org/manual/en/html_node/Miscellaneous-Services.html#index-Nix https://guix.gnu.org/manual/en/html_node/Miscellaneous-Servi...
- HerrMonnezza 5y agoHow do Nix and Guix compare?
- civodul 5y ago(Disclaimer: Guix developer and former NixOS developer here.) The OS configuration of Guix is declarative, like that of NixOS: https://guix.gnu.org/manual/en/html_node/Using-the-Configuration-System.html https://guix.gnu.org/manual/en/html_node/Using-the-Configura... However, it was designed to be more hackable and easy to inspect, which is facilitated by the fact that it's integrated in a general-purpose language. As an example, that allows the `guix system` to verify properties before you deploy a system: that the config does not refer to non-existing file systems, that the initrd doesn't lack modules needed to mount the root file system, that there are no references to undefined system services, etc. Inspectability is best illustrated here: https://notabug.org/civodul/guix-explorer https://notabug.org/civodul/guix-explorer Another big difference is that the relation between services in Guix is explicit, as can be seen above. Conversely, a NixOS service can modify anything in the whole system config, which can make it harder for users to understand how the final config came to be. Side effect (NixOS users will understand): someone writing a Guix service doesn't have to worry about `mkIf` and other contrived constructs, they won't even have to care about fixed points and infinite recursion. :-)
- pxc 5y agoI wish NixOS had a Guix module built in, so any NixOS user could easily enable Guix on their system in the same way. :(
- unsungNovelty 5y agoI literally just gave NixOS a go day before yesterday. The two things I noticed if you want to use NixOS as just a basic desktop setup was.. 1. It is simple and fast to install. People make NixOS feels like black magic. NixOS is easier to install than Arch linux. Just do 3 things. Partition your disk, create the nix configuration file and finally run the command "nixos-install" command. Let me explain with a lil more explanation: a. Partition your disk with parted or cfdisk and mount it (mentioned in docs https://nixos.org/manual/nixos/stable/). b. Generate configuration file which has the biggest myth around it. My god, this is dead simple and could install it in 5-10mins after doing it just ONCE (This obviously excludes time needed to reading up about NixOS to be familiar with it, but trust me it is not hard for a first time installer). You literally run the command "sudo nixos-generate-config" and it generates a config file in .nix format and YOU DONT HAVE TO START FROM SCRATCH AT ALL. And you don't need to know nix programming language. It has all the settings needed in the config file and all you have to do is uncomment the necessary stuff. The sound, grub, wifi etc. c. Then run the command "nixos-install". THAT IS IT. You can even mention the packages you need to install in config file. You have a functional OS for desktop which can take leverage Nix package manager. AND YES! This includes wifi, grub, sound and everything basic. They all are already in the nix config file you generated. Uncomment the necessary settings and boom! 2. The second point was supposed to be that it is a point release and thus have old packages and hence not a rolling release. This was based on the package search that firefox and some other packages are one version behind even on unstable repo 2 days ago. But just as I typed this, I double checked and Firefox 93 is in stable repo (21.05) and so are some of my other packages. I went back to Arch and was gonna ditch nixos due to this. So this is huge. I probably gonna install NixOS on my laptop now. DO correct me if I am wrong on this please. Because this is the only thing that is stopping me from using NixOS.
- kvz 5y agoBeen using Nix at Transloadit to replace our ubuntu + custom compiled based stack and while there has been a learning curve with friction, it has been so worth it. I sleep better knowing all state follows from our declarative nix files, can be changed and reverted with confidence, and we’ve cut down our build and deploy times 100X because we only ever compile something once now thanks to shared build cache between our devs and CI <3
- tifadg1 5y agoHow does Nix approach managing dot files and other application specific files? When I restore from backup, getting the right packages, flatpaks, services running is only a matter of a simple ansible playbook. Biggest annoyance comes from getting all the apps to feel/act the same as they did before. I've resolved this by having known good rc and other files in an Ansible repo and restoring that way. This works very well, but would be keen in knowing if there are better approaches.
- ducktective 5y agoCurrently, Nix way of handling dotfiles is "home-manager". Personally, I'm not convinced to translate all my random dotfiles to the format acceptable by home-manager because I wouldn't be able to use them in a non-nixos distro or a future home-manager replacement itself.
- cmm 5y ago1. home-manager is perfectly usable on any linux distro, that's in fact how the eventual transition to nixos started for me -- by porting my home config (on ubuntu, at the time) to home-manager. in fact I still keep my os-config and home-config repos separate, so my home config should still on non-nixos if the need arises 2. you don't need to "translate" any existing config files, it's perfectly fine to use them as-is.
- tifadg1 5y agoI see. So there's a solution for dot files, if a bit too involved. Currently for a low effort approach when backing up something that I know requires a bit of reparse, I use ansible templates, which basically replaces 1 string with another in a file. So far this always worked. What about application files? I.e. backing-up/restoring firefox. In it's simplest form it's copying ~/.mozilla which I appreciate is no different than copying a dot file. Does nix have a way to restore app artifacts?
- pxc 5y agoImo Home Manager isn't really about dotfiles. It's a NixOS-like module system for configuration unprivileged programs and services. You could use it, for example, to install and configure systemd user services for Emacs to run as a daemon, and for gpg-agent to run and work as your SSH agent. It lets you bundle specific versions of programs (with patches or configuration changes) in a declarative, reproducible way on non-NixOS Linux distributions, and if you incorporate it into your dotfiles it lets them become more reliable and comprehensive in that way. It also includes features for directly managing dotfiles, but if you're happy with your current dotfiles management system, you can leverage Home Manager to portably configure services without using it for directly managing all your dotfiles. > Does nix have a way to restore app artifacts? Not really. The Nix store is read-only, so if your dotfiles are in the Nix store, running applications can't write to them. There's a lot of stuff in ~/.mozilla that Firefox expects to write to during operation. There are aspects of Firefox that you can configure in Nixpkgs, including bundling extensions and setting defaults, but ~/.mozilla is not like ~/.vimrc, so it's not suitable to generation by Nix in the same way.
- beermonster 5y agoIs that the bat from the legendary Bat Book?
- Tomte 5y agoAfter hearing "NixOS has many, many packages, you won't be missing much" for a long time and seeing the package search prompt on the NixOS front page, I decided to try it What are obscure programs few people need or use? Thinking back about my studies in computational linguistics, Praat and Wavesurfer popped into my mind. Both available. Wow. That's seriously impressive.
- ostenning 5y agoHow does KDE play with Nix? I recall KDE shits all over the place with all the different cfg files it has. I had trouble trying to store them in my git repo. Would be awesome to use Nix to bring some sanity to KDE config
- joepie91_ 5y agoMixed. Some things - like the theme switcher - break constantly because KDE has no awareness of NixOS and its configuration management approach, and indeed its configuration setup seems to change all the time. The base setup works fine though, I've only had some core functionality break once, and that was after an upgrade to a new NixOS version - the progress display integration thingem for the file manager was broken.
- capableweb 5y agoI have two experiences with trying KDE, one time with Arch and one time with NixOS. Both times I ended up (trying to) get rid of it again. The Arch experience left me with bunch of trash files and software still installed, my dbus setup is still not the same since then. But with NixOS I simply rolled back to the previous build and everything was fine. The environment itself worked fine on both OSes, but if you're not sure if you'll like it, trying it on NixOS is way safer than anything else.
- pxc 5y agoPlasma is a popular choice of desktop on NixOS, but NixOS doesn't have any special facilities for managing KDE dotfiles.
- tlavoie 5y agoIf I were to look at replacing a Linux distro in-place, would it make sense to try doing most of the configuration in a VM? That is, if I did replicate the more important pieces of my current environment, could I then install NixOS and replicate that state to bare metal with minimum downtime?