this post was submitted on 11 Mar 2024
442 points (100.0% liked)

196

16244 readers
2506 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] null 56 points 6 months ago (2 children)

Imperative package management detected. Deploying rocks.

[–] JustUseMint@lemmy.world 1 points 6 months ago (1 children)

What exactly is imperative and why does it suck pls and ty

[–] null 1 points 6 months ago* (last edited 6 months ago) (1 children)

So let's say you do a clean install of a Linux distro. You then have to tell the system you want to install this web browser, change this setting, open these firewall ports, enable SSH, etc.

Telling the fresh system to do each of those things is imperative.

In NixOS, you write one big config file (you can split it up) that declares all the packages, settings, ports, etc. Then you run a command that tells the system "This is the end-state I want you to be in. Do whatever you need to do to end up in that state". That's declarative.

It means you can set up a new box by just pointing at at your config and telling it to build it. That means, you don't have to remember what you did to solve that problem that one time -- you've put it into your configuration and now it's solved forever.

Edit to add: the imperative method isn't "bad" necessarily -- we're mostly just goofing around.

[–] JustUseMint@lemmy.world 2 points 6 months ago (1 children)

Holy shit that's cool! Reminds me of a good docker compose yml for a bunch of containers. Thanks for the explanation. Apparently I'm installing nixos wtf

[–] null 1 points 6 months ago

Docker-compose is also declarative, so you're right on the money!

Have fun and ask questions -- it can be a bit overwhelming at first, but when it clicks, it clicks.

[–] paperemail@links.rocks 1 points 6 months ago

Drop tha rocks on tha Packagelowdaaaaa! Make dem Imperatives pay for all dem impuretees!