Skip to content
DevMeme
6309 of 7590
Refactoring Post #6917 · source on Telegram

A 'Slight Refactoring' on NixOS with Unintended Consequences

Description

A screenshot of a tweet from the user anna (@meowkoteeq). The text of the tweet reads: 'very proud of myself today for doing a slight refactoring on wife's nixos config!!! (she now lost her graphics, wifi and audio drivers)'. The humor comes from the sarcastic pride expressed for a 'refactoring' - an act that is supposed to improve code structure without changing its external behavior - that resulted in a catastrophic failure of the system's most essential hardware drivers. This is a highly relatable scenario for developers and system administrators, especially those familiar with the power and complexity of NixOS, where a small change in the declarative configuration can have system-wide, unintended side effects. The tweet perfectly captures the pain and dark humor of turning a simple maintenance task into a complete system breakage, with the added personal stake of it being a spouse's machine

Comments

28
Anonymous ★ Top Pick Refactoring is like the Hippocratic oath for code: 'First, do not alter external behavior.' This was less of a refactor and more of a successful test of the system's disaster recovery plan
  1. Anonymous ★ Top Pick

    Refactoring is like the Hippocratic oath for code: 'First, do not alter external behavior.' This was less of a refactor and more of a successful test of the system's disaster recovery plan

  2. Anonymous

    Nothing says ‘functional package manager’ like functionally un-packing every single driver on your partner’s laptop

  3. Anonymous

    The beauty of NixOS is that your entire system is declarative and reproducible - which means you can reproducibly break your spouse's graphics, wifi, and audio drivers with perfect determinism across every rebuild

  4. Anonymous

    Ah yes, the NixOS experience: where 'slight refactoring' means you're one misplaced bracket away from a fully declarative brick. At least with NixOS you can rollback to the previous generation - assuming you didn't also refactor the bootloader config. The real tragedy here is that somewhere in that pristine, reproducible configuration.nix, there's probably just a commented-out line for hardware.enableAllFirmware that would have prevented this entire domestic incident

  5. Anonymous

    In NixOS, one tiny refactor that forgets hardware-configuration.nix is the fastest path to rollback‑driven development - assuming the Wi‑Fi you just removed isn’t how you planned to pull the fix

  6. Anonymous

    In NixOS, drop one import during a “slight refactor” and the GC politely uninstalls your GPU, Wi‑Fi, and weekend plans

  7. Anonymous

    NixOS refactor: Proving declarative purity by making the entire desktop declaratively disappear

  8. @Wintercoresystem 1y

    Is nixos better then arch?

    1. @lambda_coolusername 1y

      anything can be better or worse than anything else depending on your use-case <3

      1. @Wintercoresystem 1y

        Duh

    2. @kirisoraa 1y

      is a hammer better than a wrench?

      1. @Wintercoresystem 1y

        Hammer. It has more and better use cases

        1. @kirisoraa 1y

          oh for fucks sake...

        2. @Algoinde 1y

          Counterpoint: you can hammer with a wrench, but you cannot wrench with a hammer

          1. @Wintercoresystem 1y

            You're on point! Then wrench is clearly better tool then hammer

            1. @Phetnoorh 1y

              What if i prefer a wench

        3. @Eshark22 1y

          A good wrench can be used as a hammer if you abuse it enough lol

    3. @megapro17 1y

      you aren't getting immutable image + reproducible builds on arch by default

      1. @Dark_Embrace 1y

        I like sitting on master head anyways. Don't like the feeling when you know there is a new cool feature, but you can't use it before a new release in the next half a year or more.

        1. @megapro17 1y

          How it is related? You can get the latest shit on any distro

          1. @Dark_Embrace 1y

            Reproducibility is not on the menu for me. If I need it I use docker.

        2. @spacenuke 1y

          You should be doing something more productive with your spare time

          1. @Dark_Embrace 1y

            I refuse to live life 😁

      2. @casKd_dev 1y

        call me when you can do proper reversible disk layout changes :3:3:3

      3. @sysoevyarik 1y

        You aren't getting usable pc on both.

  9. @n3oney 1y

    Boot older generation

  10. @spacenuke 1y

    Neither of these things is a hammer or a wrench. They are more like baroque hallucinations, like a caveman who has dreamed of an engine trying to reconstruct it with sticks and rocks

  11. @spacenuke 1y

    There are good ideas in Nix but in reality it’s just a shitty pile of scripts in a language few people use that doesn’t get you anywhere you couldn’t have gotten with Debian and Ansible or whatever you prefer

Use J and K for navigation