3 ms·
Because I don't want to learn another complex DSL just to install some packages. Whether Nix is the promised land or not, Brew works just fine 99% of the time a
by cedws 3y ago
Because I don't want to learn another complex DSL just to install some packages. Whether Nix is the promised land or not, Brew works just fine 99% of the time and I have stuff to do.
- andrei_says_ 3y agoMe, too, and also I already have a bunch of brew packages which I know are well maintained. So, switch to using both? Uninstall brew packages and install nix versions, verifying they are all maintained over there? Sorry, no.
- ar_lan 3y agoNix Darwin supports brew, so this isn't really a reasonable argument. > So, switch to using both? This is an option, yes. Plus, it has the added benefit of you not needing to manage `brew doctor`, `brew cleanup`, etc. yourself. So you're not stuck with weird packages you installed once, never needed again, and forgot to clean up. It's strange that people are so against declarative systems, or even file-based OS configuration. When I get my new Macbook I was up-and-running within a few minutes. I can't imagine maintaining a list of brews I need to re-install just to set up everything + my configs + everything else. Nix Darwin just made this so ridiculously easy. Plus I can share almost all of my configuration with my Linux setups so I have a near-consistent environment whether I'm on Mac or Linux. The overhead of remembering the names for Brew, Apt, Snap, or whatever package managers exist seems like a lot of overhead, and I just value declarative, reproducible systems. Managing my packages on the fly? Sorry, no.
- drbaba 3y ago> It's strange that people are so against declarative systems, or even file-based OS configuration. When I get my new Macbook I was up-and-running within a few minutes. I can't imagine maintaining a list of brews I need to re-install just to set up everything + my configs + everything else. I haven’t had time to try Nix yet, but HomeBrew does have a declarative-ish workflow that I’ve been using for years: Brew Bundle [1] lets you have a plaintext file listing all packages you want installed on your system. Add a line for stuff you want installed, delete a line for stuff you want removed, invoke it the right way and it will install/remove packages until your system matches the list. The initial list can be generated by “brew bundle dump” or something like that. For configuration, I find that a normal dotfile repo cloned into my ~/.config (with a script that maintains symlinks to config files in e.g. ~/Library) works well enough for my use. [1]: https://github.com/Homebrew/homebrew-bundle https://github.com/Homebrew/homebrew-bundle
- pxc 3y agoThis is actually the mechanism behind Nix-Darwin's Homebrew support. In Nix terms, it uses the module system to generate a Brewfile, and then it invokes the brew CLI against that file in the activation script. Nix or no Nix, it's definitely a better way to use Homebrew than ad-hoc, imo!
- eptcyka 3y agoAh, yes, I love it when I need to wait minutes to install a package because brew needs to do some other thing.
- wizerdrobe 3y ago“Minutes” seems an awfully small rebuttal to be quite honest. I’ve never had to install a brew package under duress.
- eptcyka 3y agoWhen I issue a `brew install package` command, I expect it to either install the package or fail installing the package, and not do something else entirely. Sometimes I need to do something quick, nix-shell has never given me any issues with that. Brew has taken 10 minutes before getting to the install process. It's severely annoying.
- SkyPuncher 3y agoBy contrast, other package managers just don’t update thing. You end up so out of sync it becomes a massive pain.
- eptcyka 3y agoI can fix the pain when it comes. Brew is already slow, I don't need it to become slower still.
- turboponyy 3y agoYou don't need to learn the DSL to use Nix as a package manager.
- drbaba 3y agoDo you have a link to where I can read about using Nix as purely a package manager? Or a minimal example showing how a Nix config looks if used in this manner?
- Melonai 3y agoJulia Evans has an article pretty much about what you’re asking for! I think looking at nix-shell for getting some things into PATH temporarily would also be quite useful, although Julia deliberately left it out of the article. It’s just as simple as running `nix-shell -p pkg1 pkg2` if that’s all you want to do with it! https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/ https://jvns.ca/blog/2023/02/28/some-notes-on-using-nix/
- akvadrako 3y agoHe obviously wasn't looking for some random blog. The point is Nix has no polish for people who have things to do.
- turboponyy 3y agoSorry for the late reply! I'm not sure why you think there is any 'config' involved. Perhaps you're conflating Nix the package manager with NixOS? Nix is many things, but it's also just a package manager like any other. For example: nix profile install nixpkgs#vim # installs a package into your environment nix shell nixpkgs#binwalk nixpkgs#vim # drops you into a shell with the given packages nix run nixpkgs#firefox # runs the mainProgram of the given package A couple of things to note: The aforementioned commands are the "experimental" Nix 2.4 CLI commands that integrate with Nix Flakes. They are only experimental in name though, their status of being experimental being sort of a meme at this point. I recommend using these new commands (you can opt in by supplying a command-line flag or by tweaking the package manager config). Packages that are not in active use (e.g. packages that you've referred to in 'nix shell' or 'nix run' invocations that are not installed using 'nix profile') are due for garbage collection. The garbage collection settings can be configured (either through NixOS, home-manager or the package manager's standalone configuration). The garbage collection can also be triggred manually. This makes experimenting with programs that you don't necessarily want to keep a joy. The 'nixpkgs' in the aforementioned invocations is a default input that is set during installation. It refers to the nixpkgs package archive's flake's master branch's latest revision (https://github.com/nixos/nixpkgs https://github.com/nixos/nixpkgs). The available inputs are configurable (again, either through NixOS, home-manager or the package manager's standalone configuration).
- anotherhue 3y ago> Because I don't want to learn another complex DSL just to install some packages. Whether Nix is the promised land or not, Brew works just fine 99% of the time and I have stuff to do. It surely is complex, but I think you're intrinsically devaluing the importance of dependency management. Your important 'stuff to do' is built on top of a lot of software, getting that supply chain right (and reproducible) is at least as important.