760
you are viewing a single comment's thread
view the rest of the comments
[-] iopq@lemmy.world 4 points 1 week ago

Okay, but when I figure it out on my desktop I just copy paste the exact snippet to my laptop and it just works.

Do you think I can remember the steps I took to fix my issue with Ubuntu? I don't remember what file I modified and where I put some config file.

[-] ne0phyte@feddit.org 2 points 1 week ago* (last edited 1 week ago)

But to be fair, Nix is not the only answer to that. There are lots of tools for just dotfiles but you can also build something using e.g. ansible to manage everything.

All my computers have their config in a git repo. That includes users, packages, services, dotfiles, /etc configs and so on. I used ansible before writing my own tool. I can install Arch from scratch and only need to partition, run one script and then apply my config on first boot using my tool to have my system restored. I know it's not as declarative and absolute/reproducible as Nix, but it works and it's way less painful than my last attempt at giving NixOS a go.

[-] rumba@lemmy.zip 1 points 6 days ago

I'm about neck deep in ancible/salt/chef over the years at work.

They are great tools for simple configurations where multiple people are needed in the kitchen, but they require meticulous curation.

But I buy a new laptop, I slap in my USB vanilla Nix ISO, drop two config files in /etc/nixos call rebuild and I'm done.

Updating my packages to latest is a single command. Adding a package is a single line. And the most powerful thing, nix-shell -p whatever install whatever for that session. I don't even bother putting most stuff into my declaritive configs, nix-shell -p ffmpeg, when I exit it's no longer available.

And if I do something awful to my config and brick it, it's just one grub menu to go back to the previous version.

[-] Laser@feddit.org 1 points 1 week ago

Either my Ansible knowledge is too limited which is entirely possible, or you can't do stuff there that's possible with Nix. Let's stay go with my example that you have something that requires changes in PAM. So you write an Ansible file installing the package (which is distribution-specific, so you're losing one advantage you had over NixOS), enable the service and add your entries to the respective PAM file (e.g. login because you want to enable user authentication against kanidm on your machine). The ordering in these files matter. Sure you have insertbefore and insertafter for lineinfile and blockinfile, but this basically requires you to know the rest of the file in advance… not a problem if your system is always the same, but you don't have the flexibility and composability that Nix offers.

[-] nickwitha_k@lemmy.sdf.org 2 points 1 week ago

I'd say, from my experience with Ansible, that it can absolutely do all of that. Might be able to use a single task for the package install, if the distro supports the generic package module. There's also a pamd module that would likely cover your needs there. If not, it would still be possible with a custom module or some Xinfile fuckery (if it can be fine programmatically, it can be done in Ansible, more niche things may require writing code, however).

It would not be as terse though. Really wish there was a good middle ground.

[-] iopq@lemmy.world 2 points 6 days ago* (last edited 6 days ago)

It can do that, but it gets more complicated because you are doing this is in an imperative way. For example, in Nix it's trivial to change the config and remove something.

In ansible there's no guarantee installing a package and removing it won't have side effects. You could install a DE and decide to switch back, but it already changed some files on your system

[-] nickwitha_k@lemmy.sdf.org 1 points 6 days ago

This is true. It can be done but would require functionality not included in stock Ansible.

this post was submitted on 14 May 2025
760 points (100.0% liked)

linuxmemes

25040 readers
1244 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS