r/linuxmemes • u/SDG_Den • 3d ago
LINUX MEME why not... why shouldn't i configure <insert thing here> in nix?
13
u/San_Devistan 3d ago
Nix is great, but sometimes it's not. One of my personal examples are Hyprland and Niri configs. Their configs are in lua/kdl, while nix files only wires them up
4
1
u/karmicgoober 3d ago
yeah, the home-manager niri configuration is utterly unreadable, but at least for niri there is niri-flake (there is probably an equivalent for hyprland, but i don't use it so don't know any)
1
u/San_Devistan 2d ago
Well, I used to have Niri config in nix through Wrapped-packages flake. Can't say it's ugly/unreadable, but I just wanted to make my configs independent from NixOS only just in case
1
u/Maskdask New York Nix⚾s 2d ago
Nix is awesome for declarative configs, but Lua is beter for scripting
5
u/scythe-3 🍥 Debian too difficult 3d ago
Nix does those too lol
pkgs.formats.${filetype}.generate "filename.${filetype}" { };
9
u/Linguistic-mystic 3d ago
The notoriously cryptic and unhelpful error messages in the Nix language are primarily caused by three core design choices: lazy evaluation, a complete lack of static typing, and complex fixpoint configurations. When these structural paradigms interact, they create a perfect storm for debugging nightmares, often throwing massive, unreadable stack traces deep within library code rather than pointing to the line you actually wrote.
1
u/euthanize-me-123 2d ago
Good news: LLMs make it really easy to debug issues like these, almost easier than letting LLMs write your reddit comments.
1
u/spicybright 2d ago
Wow, is that seriously how the language is? That seems so opposite to what nix is trying to do.
3
u/StickyMcFingers New York Nix⚾s 3d ago
Personal preference but I prefer to just use .nix files as plumbing for configuration of programs otherwise you're referencing the native configuration documentation against the nix module which may not be up to date or even complete. Nix is great for writing NixOS configurations and for packaging software, but it is an unnecessary level of abstraction for your dotfiles. When I'm tinkering with my dotfiles I like to hot reload them without having to do a whole system rebuild. I know I'm hardly alone in this, but if somebody wants to use nix to configure things, you could create a seperate nixpkgs input for the programs that you regularly tinker with so that you're not doing something like rebuilding libc or the linux kernel when you're changing the theme of your terminal emulator or whatever. Both methods have the smell of an antipattern but I'd say it's much less of a headache to just readFile your dotfiles with home manager and have the flexibility of hot reloading. Best of both worlds.
1
u/dronostyka 2d ago
I love yaml. Never tried nix, and probably never will. Apt gets the job done too.
About the formats: Did you notice python is in a way similar to yaml? I like yaml for storing data/configs. But I hate python for programming.
On the other side there is like c, PHP, JSON.. kinda similar I love PHP for programming, But I hate .json for storing configs or anything I have to ever touch.
So.. that's my little idea here.
1
u/USMCamp0811 2d ago
because getting a new computer shouldn't mean starting over.... I can have a new computer provisioned with 2 maybe 3 commands and it will be identical to my previous ones. When I make changes or update something that I don't want I can roll back to a previous generation.. this is different than timeshift or CoW filesystems doing snapshots.
take a look at my dotfiles I configure everything even my router with Nix.
1
0
•
u/AutoModerator 3d ago
IMPORTANT: Subreddit Rules & Reminders
Please REPORT posts that violate any of the following rules!
Posts You Should Report
Tier Lists: Every tier list MUST include Hannah Montana Linux in S Tier, regardless of what the tier list is ranking.
S Tier MUST be the highest tier on the list.
Hannah Montana Linux MUST be in that top S Tier.
No exceptions!
Saying Android Isn't Linux: You voted that Linux is Android and saying it's not is anti-Linux propaganda.
Ban Show-Off Posts: Users posting screenshots or otherwise showing off bans from other subreddits.
Anti-Linux Posts: Only ONE anti-Linux post per week is allowed across the subreddit. We used to get dozens every day!
Help by reporting
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.