News for hackers. Stuff that matters.
Re:What Is Nix? by smabie on Wednesday May 20, 2020 @06:18PM (#23252641)
I have always wanted to try Nix, but not sure how installing software from source outside the package system works. With Arch Linux, it's pretty easy to create an AUR package if it doesn't exist, or simply install it outside the package system. Is it easy to create Nix packages (based on the features of Nix, I'm guessing no)? What about if you don't feel like creating a package?
Re:What Is Nix? by roblabla on Wednesday May 20, 2020 @06:26PM (#23252705)
Creating nix packages is actually pretty easy once you get the hang of it. Maybe a tiny bit more involved than AUR packages since it's a new language and all, but it's not that much more difficult. When I was using nixos on my desktop machine, I made packages for my own personal tools, so it integrated in the system.

It's also very easy to customize a package to suit your needs, and in fact makes for a very nice system to hack on open source projects. You can mostly setup an override in your $HOME to make a package's source come from your local disk, and when you install the package it will compile locally instead of getting a prebuilt binary.

If you don't go through their packaging system... It's really easy to end up in a mess. There are ways to simulate a "normal" linux from within nixos, essentially making a chroot in which the various libraries are in their normal locations (achieved through an overlay filesystem). I believe that's what they do to run the Steam client. I assume (though never tried) you could use this to run other binaries without packaging. But then... what's the point?

Re:What Is Nix? by burke on Wednesday May 20, 2020 @06:24PM (#23252676)
I think it's about as easy as creating AUR packages most of the time, especially after the first one or two. You can create them in a more ad-hoc way than you probably expect. For example, this video shows an example of creating a totally-legitimately-real package: https://www.youtube.com/watch?v=1nU_hR2kod4 -- some of the follow-ups in the channel also show a little more work with that simple derivation ("package" in de-nixified terms)
Re:What Is Nix? by myguidingstar on Thursday May 21, 2020 @07:23AM (#23257093)
you can always find examples to learn from in nixpkgs git repo. If the package can build from source, look at other package with similar dependencies. If the package is binary distribution (eg closed source), follow this guide: https://nixos.wiki/wiki/Packaging/Binaries
Re:What Is Nix? by abathur on Wednesday May 20, 2020 @06:24PM (#23252687)
You can use Nix on your existing OS with no obligation to install all packages with it. On macOS, I use Nix for most things, but I still use homebrew for a few things and occasionally download+install.