top | item 24628684

(no title)

adsjhdashkj | 5 years ago

Tangent, what's the best way to use Nix-like features in a mainstream distro? Eg, i've been evaluating PopOS recently because i want a Mac equivalent OS. Ie, i don't want driver/config issues.

However one problem i never see solved from any "normal" distros is reproducible systems. Hypothetically if i used Nix as a Desktop my config would be bulletproof. .. but then i'm going through a fair amount of work configuring everything when, as established, i want none of it.

So i (as a user) seem to want some middleground between no effort installations / configurations of my Desktop, with reproducible snapshots/states/configs/something.

You can use Nixpkgs on other distros/OSs, so maybe that is enough. But is there a better way?

discuss

order

MarcScott|5 years ago

I just bit the bullet and use NixOS as my Desktop. There's a bit of work after initial install, to setup your config files the way you want, but after that you're all set. I've had no problems transferring my configs when I change hardware, and end up with an identical environment that I had on my previous computer.

kevincox|5 years ago

I recently switched as well and am very happy. I don't think that re-configuring takes much longer that the average distro would especially because a lot of services you can just say `services.foobar.enable = true` and get a decent default config. You only need to spend your time configuring the things that you are picky about.

And yes, the fact that I can configure all of my systems with a shared set of configs and have consistent and reproducible environments is fantastic.

I wrote up my thoughts about the switch here: https://kevincox.ca/2020/09/06/switching-to-desktop-nixos/

adsjhdashkj|5 years ago

Sidenote, i'm taking the plunge into NixOS, but notably using Flakes.

While i've dabbled in Nix in the past some things felt more odd to me than perhaps they should have. Primarily the fact that it felt like all these configs were spread out and i didn't understand how Nix wanted me to version them.

Flakes (from early tests) seems to make this very clear. As it starts from a repo, so i'm attempting to make all my configs, including Home Manager (of which also feels weird lol) start from the Flakes installation.

Flakes also solves the reproducibility problem that i didn't get why NixOS had. So far it's really neat.

wesnel|5 years ago

Personally, I use NixOS in conjunction with Home Manager[0] to more conveniently use Nix to manage my user-level config. The configuration that I manage with Home Manager includes my Emacs config, my Git config, and my Bash config. Additionally, almost all of the other programs I use on a daily basis are at least installed through it. Since it’s primarily only used for managing some packages, the configuration process was simple compared to setting up NixOS for me.

I would imagine that you could use Home Manager on a non-NixOS system to at least create reproducible configs for the programs you use, although the OS as a whole would of course still be non-reproducible. However, I do not know how well Home Manager works on non-NixOS systems.

As you mention, just using Nix itself can be sufficient to get a reproducible set of packages on your system. I recall reading a blog post about someone who does this on both Ubuntu and MacOS.[1] The way this person does it is interesting because it’s more sophisticated than spawning the occasional ‘nix-shell’ or something. For example, they get the benefit of Nix “generations,” with a new generation being created each time they modify their declarative config files.

[0] https://github.com/nix-community/home-manager [1] https://www.nmattia.com/posts/2018-03-21-nix-reproducible-se...

sterlind|5 years ago

I've found home-manager to be more trouble than it's worth for most things:

* Config files aren't always stored in text (e.g. KDE Plasma, Gnome)

* It's all-or-nothing usually, unless you can find a way to make the home-manager config your "base"

* Changing settings isn't integrated, and requires editing/rebuilding/reopening (e.g. I can't just hit Ctrl+ to increase font size in VS Code, I have to edit a config file, run home-manager switch, then usually reopen)

* Plugins, especially things like extension stores, are a hack and a half. You have to hunt for hashes, then change it every time your old version falls off the CDN.

It's a nice idea, in theory, but it only works in a vacuum.

yjftsjthsd-h|5 years ago

I've been using ansible to configure my laptops for years now; it automatically installs most of the packages that I'm going to want, clones things like my dotfiles into my home directory, etc.

Edit: Oh, and obviously I keep the playbooks+roles in version control.

Ericson2314|5 years ago

Just use NixOS. Our defaults are more like Debian/Fedora than Arch/Gentoo. You're not going to be struggling to hunt down drivers.