Hacker News new | ask | show | jobs
by dbeley 1084 days ago
It's just impossible to have the same level of configuration with your own custom script, NixOS goes way beyond: its configuration capabilities goes from your bootloader to user-level Firefox add-ons, and you have niceties like reproductability and rollbacks.
1 comments

what? none of that is impossible for me to configure with a shell script? i install my userChrome.css to firefox with it, and i havent tried the addons aspect because my firefox account syncs them for me. since i run zfs i should get rollbacks too without learning a new language and packaging theory for guix
It’s possible as in you have a Turing-complete set of tools. You would basically have to recreate something like Nix for it to properly work, and would only end up with a much worse version of it, without the huge amount of work that goes into it (both the core, but especially the “wide ranging software support” part).
a set of tools that wont fade away, its much harder to believe that about nixlang than its for bash/dash/sh

i dont have to recreate nix to get easy customized installs, my installer script doesnt need to know or do anything about derivations, monads, flakes, etc. it just uses packages from my distro and pulls in my .config directory. what else does nix do that my script should do? the software my script installs is probably more supported than it would be on nix because its on ubuntu, one of the more commonly supported distros.

> monads

Nixlang doesn't have a type system sufficient to encode monads, so you don't have to worry about it ;)

> tools that wont fade away, its much harder to believe that about nixlang than its for bash/dash/sh

Bash has been around for over 34 years, which is very respectable. But Nixlang has also already been here for more than 20.

> the software my script installs is probably more supported than it would be on nix because its on ubuntu, one of the more commonly supported distros

wat? Nix runs on Ubuntu just fine...

It doesn’t have to go away when your alternative won’t work correctly in the first place and will collapse under its weight.
How do you install the userChrome.CSS automatically? As far as I know it needs to be placed in a folder containing a hash that's only generated at firefox first launch.

At some point if you want to configure everything with your own shell script it will be a nightmare to maintain, NixOS is easy to learn in comparison.

i just glob over *.default and *.default-release `mkdir -p chrome` and move it there then check if my user.js has the setting that enables legacy userchrome (via grep, (useless) cat, and pipe), and if not add it. wouldnt guix do something similar if it managed my userChrome.css?

i am not sold on the maintainability delta between my script and a guix one, but i only use a text editor, a terminal emulator and two web browsers for 90% of my use, so maybe im just too small scale to run into the maintainability issue it's trying to solve. the main struggle i have is in making the config files, and guix would only add another layer to that.

easy to learn might be a valid consideration for me if i didn't already feel comfortable with scripts of the normal non guix variety, but the devil i know does fine.

NixOS is overriding the profile name by using your username so the name is not auto-generated anymore (NixOS hates that) so it knows the user profile will always be at ~/.mozilla/firefox/USERNAME. It automatically creates a ~ /.mozilla/firefox/profiles.ini with a custom profile.
That's a nice small benefit that seems dwarfed by the increase of complexity, but maybe I am blind to my death of a million paper cuts that I've grown used to.

Maybe I'll update my script to use named instead of randomly generated profiles, though.

What does it do for multiple profiles?

You can specify as many profiles as you want, you have a property called firefox.profiles that can be an array and you would declare as many settings you would want in it. They still need to be names though (either through a variable like an username or a name you would set yourself).
It’s increasine in complexity when you are writing shell scripts, it is not when you have a proper system in place that provides a sane abstraction/interface for defining such configurations.
You can generate the metadata in ~/.mozilla/firefox (installs.ini, profiles.ini) to have whatever profile dirs you want. Only if you let FF generate them itself will they have the unknown random names.