Live data from Hacker News

NixOS and the Art of OS Configuration (2018)

rousette.org.uk

31–40 of 123 posts

Re: NixOS and the Art of OS Configuration (2018)

#32
post #29

How 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 we…

Currently, 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.

I 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?

Re: NixOS and the Art of OS Configuration (2018)

#33
post #29

How 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 we…

Currently, 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.

1. 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.

Re: NixOS and the Art of OS Configuration (2018)

#35
post #24

Earlier quoted context omitted.

You can use the unstable branch for rolling releases closer to how arch works.

Is unstable directly upstream stable version of packages exactly like Arch? Cos that is what I want. Cos in Linux distro context, debian or nixos unstable repo just means it is not yet tested for the specific distro. But in fact the packages itself would be latest stable versions from upstreams. I did read my reading but it is really blurry and hard to find information on how often the packages gets updated. I also w…

Pretty much yes, I also switched from Arch and this works great for me.

I only had issues a couple times with broken packages, then you can either not update at all or remove those packages. It should also be possible to keep the older version of those packages in the nix config but I did not look into it.

Re: NixOS and the Art of OS Configuration (2018)

#36

I 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…

You can override package attributes to update a package if it is not updated, without having to wait for the upstream.

Re: NixOS and the Art of OS Configuration (2018)

#37
post #35

Earlier quoted context omitted.

Is unstable directly upstream stable version of packages exactly like Arch? Cos that is what I want. Cos in Linux distro context, debian or nixos unstable repo just means it is not yet tested for the specific distro. But in fact the packages itself would be latest stable versions from upstreams. I did read my reading but it is really blurry and hard to find information on how often the packages gets updated. I also w…

Pretty much yes, I also switched from Arch and this works great for me. I only had issues a couple times with broken packages, then you can either not update at all or remove those packages. It should also be possible to keep the older version of those packages in the nix config but I did not look into it.

Thank you for confirming tracnar. I really appreciate it.

But if possible can you also elaborate on "pretty much" yes part? What is the catch or what am I missing?

Re: NixOS and the Art of OS Configuration (2018)

#38

Love 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…

#MeToo. I am using two OSX machines and two remote Linux machines for my day-2-day private/work related stuff.

Nix+home-manager allows me to have all productivity tools consistently available across all platforms with minimal effort [1].

Dotfiles/shell config lives in a separate folder [2] and is not managed in nix.

Tangent: Secrets are are encrypted with git-crypt (https://github.com/AGWA/git-crypt) and live in the same repo [3]. I generate GPG keys for every new host I am working on and check in the public keys to the repo as well, then "approve" them from an authorized host using `git-crypt add-gpg-user ... && git push` [4]. This gives strong encryption without managing passwords by hand. [Copy of private key is kept in bitwarden as backup].

Getting the hang of Nix took me a while. I wrote-up my journey to get the latest-gratest emacs installed here [5]. But now I am over the bump, and it's adding value to my workfows. E.g. I switched some projects from docker to nix-shell for lightweight virtual-envs, e.g. [6].

[1] https://github.com/HeinrichHartmann/dotfiles/blob/master/nix...

[2] https://github.com/HeinrichHartmann/dotfiles/tree/master/.sh...

[3] https://github.com/HeinrichHartmann/dotfiles/tree/master/sec...

[4] https://github.com/HeinrichHartmann/dotfiles/tree/master/pub...

[5] https://www.heinrichhartmann.com/posts/2021-08-08-nix-emacs/

[6] https://github.com/HeinrichHartmann/HeinrichHartmann.github....

Re: NixOS and the Art of OS Configuration (2018)

#39
After 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.

Re: NixOS and the Art of OS Configuration (2018)

#40
post #4

Earlier quoted context omitted.

> 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.

It 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 th…

This 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.
Post reply on HN