Atemu,
@Atemu@lemmy.ml avatar

I see nixos and guixos as spending an hour every day, so that you can save minutes every few years.

I see it more like spending an hour every week so that you can save hours to days of annoying and stressful time every few months.

Though there are other benefits rather than just time.

When trying out guixos, I spent like 5 days going through the docs and annoying people on irc, just to accomplish the same thing as copying a file to a non-~ directory in a normal distro

In the beginning when you’re not familiar with things yet, it always takes more time to do something.

I didn’t have that particular use-case yet and I’d have to consult at least one manual to do it correctly but I’d nowadays be able to solve that particular problem with one line of relatively simple code in NixOS. (On Guix, I don’t know how I’d do it though since they don’t use systemd.)
When I started out though? No chance, it’d have taken weeks.

I started off by using the language specific PM to install the dependencies I needed for a project.

Yeah, that’s like mistake #1 for non-FHS-compliant distros. ;)

  • start figuring out how to use guix to emulate FHS inside of a venv

As the person who implemented a variant of this for Nix (buildFHSEnv), it’s rather straight-forward. Though if it didn’t exist, I’d rather try distrobox or other dev container thingies if there was no reasonable nix support for the thing I’m working on.

I mean just look at a small part from the beginning of both files: nix formatted by nixfmt

I mean, that’s just one particular interface. It’s actually quite flexible to do it this way though as it allows you to dumb it down if you don’t like it with a little refactor:


<span style="color:#323232;">{
</span><span style="color:#323232;">  startup = let
</span><span style="color:#323232;">    exec = command: {
</span><span style="color:#323232;">      inherit command;
</span><span style="color:#323232;">    };
</span><span style="color:#323232;">  in [
</span><span style="color:#323232;">    #on launch
</span><span style="color:#323232;">    (exec "emacsclient -a '' -nc --init-directory=~/.config/emacs" // {
</span><span style="color:#323232;">      workspace = "1";
</span><span style="color:#323232;">    })
</span><span style="color:#323232;">    (exec "nitrogen --restore")
</span><span style="color:#323232;">    (exec "~/.screenlayout/shareni.sh")
</span><span style="color:#323232;">    (exec "numlockx on")
</span><span style="color:#323232;">    (exec "volumeicon")
</span><span style="color:#323232;">  ];
</span><span style="color:#323232;">}
</span>

That’s the beauty of IaC (actual code, not that YAML nonsense): Software environment configuration becomes a software engineering problem and we know how to solve those.

In this specific case though, I probably wouldn’t bother with doing that stuff in Nix and would rather just keep the plain i3config text file and set the option glue to just use that file; effectively a glorified stow.

This more complex interface is only truly beneficial if there are parts of your config that vary depending on some other conditions. Some users may have the need to only run a set of commands or have certain launch options on one machine but not another. Trivial to do with lib.optionals and the like using this kind of interface but very hard to do if it was just a list of strings or one large string.

it fucking added defaults like the keybindings I’ve specifically removed from the config so that the only two i3 deals with are opening the terminal and reloading itself

Well, then tell it to not to do that? I don’t know the module in question but any well-designed module has an option for precisely that. If it doesn’t, I’d consider that a bug. Otherwise, lib.mkForce is usually also an option.

Spending a week to configure something simple is worth it in that scenario because it’ll save you from much bigger headaches down the line. The issue is that they solve problems most users simply don’t face, and so the added complexity comes with practically no benefits.

I wholeheartedly disagree. Declarative stateless system configuration a la Nix solves a lot of issues that users face all the time.

Whether the time investment is worth it at present is debatable but there’s a clear path towards yes IMO because a project focused around proper IaC elevates operating systems onto another level because it abstracts and centralises configuration. It takes one person to figure out how to configure a certain thing in a sensible way and they can publish that work as a NixOS module for everyone’s benefit. Most of the work I put into NixOS is upstream because of this.

Right now, it’s absolutely catered towards nerds and other technologically able people like us but imagine what a further abstracted GUI could do for mere mortals.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • fightinggames
  • All magazines