5 ms·
What do experienced nix-ers tend to do when they need to use software that's not up to date or available in nixpkgs? Are you guys knowledgeable enough to packag
by jpe90 5y ago
What do experienced nix-ers tend to do when they need to use software that's not up to date or available in nixpkgs? Are you guys knowledgeable enough to package everything yourselves, or do you just use buildFHSUserEnv until someone else works out the kinks? I didn't get a chance to figure out how to do the latter, but I'm curious because I've struggled as a new user.
- reasonabl_human 5y agoWe nixify all in-house development packages at work, it isn’t that bad once you get the hang of it, and comes with an awesome amount of ‘just works’ when integrating packages on custom devices down the road.
- pimeys 5y agoI fork the repo, update the package in my fork, add the fork as a flake to my inputs and test my changes. When I'm happy, I create a pull request to the main repo. I started using NixOS in all my machines last winter, and slowly decided it is for me when I understood the basics. It was a rough start for me, but I have a few decades of linux knowledge, that helped me past the starting point. You can read my config and see how to create overlays from different sources. E.g. if your fork updates vim, your overlay overwrites vim in the definition. Then referring to pkgs.vim points to your fork. See flake.nix in the repo. https://github.com/pimeys/nixos https://github.com/pimeys/nixos
- kaba0 5y agoI would just add that more often than not it is as easy as changing the version string in the somePackage/default.nix file and changing the corresponding hash of the source. Of course if the build changes in the new version or it depends on some new lib it can become a bit more difficult, but with a bit of experience it is not that hard to solve.
- pimeys 5y agoAnd to get the hash of some file you download, you can do `nix-prefetch-url https://us.download.nvidia.com/XFree86/Linux-x86_64/460.80/NVIDIA-Linux-x86_64-460.80.run https://us.download.nvidia.com/XFree86/Linux-x86_64/460.80/N...` that'll cache the file for you and give the sha256. Remember to add `--unpack` if the file is an archive.
- gdown 5y agoAs a side note, thank you for posting this. I've been trying to get flakes set up on my system and this is more readable than the other dotfiles I've looked through.
- pimeys 5y agoYou're welcome. It is still not perfect, and I hit my head to the wall enough when writing that. hlissner is my biggest influence here, but I simplified their code a lot so I can understand it better for now. My nix-fu is still not that high level. Next thing I want to learn is how to package a complex js/rust package into a flake setup. I have the whole next friday to that.
- kevincox 5y agoI typically try to package it and push it upstream. It usually isn't much work and it helps others. That being said it is rare that something I want isn't in nixpkgs. After all by some metrics nixpkgs-unstable is the most up to date package repository, and only slightly smaller than the AUR https://repology.org/repositories/graphs https://repology.org/repositories/graphs In some cases I do settle for using `steam-run` or `buildFHSUserEnv` but I don't think I am using those for anything right now.
- Mic92 5y agoI run [nix-update](https://github.com/Mic92/nix-update/ https://github.com/Mic92/nix-update/) to update stuff. If you want to package something new, first identify the programming language/buildsystem the project is using and than look for a similar project in nixpkgs.