Is forking nixpkgs the only way of building new packages?

Please forgive me, if this question has been asked before. Also please note, that I started using NixOS as my daily driver a week ago or so.

I’ve looked around the internet on how to build a new package for NixOS. I’ve seen the syntax for a derivation and I would say, that I understand it. However, whereever I looked, I only see derivations in the context of forking or extending nixpkgs in one way or the other.

My current use-case is packaging the hello-theme for KDE, which is a cmake-project. I got it as far as compiling via a nix-shell-environment, but don’t know how to proceed yet.

Forking nixpkgs seems to be a little overkill! I understand, this would make it easier to create a PR and have new packages being added to the NixOS-ecosystem, but for now I would simply like to include my build of this project in my personal config and see, if it’s even working.

Is there a concept different to derivations, that would allow me to do this? Or better yet, can I include a derivation in configuration.nix somehow?

3 Likes

You can also join NUR. It already provide documentation and templates for own repos including CI and binary caching.

Thanks for the tip with NUR!

Can you maybe list the main differences between NUR and nixpkgs? What is NUR intended to solve, that’s not already solved by nixpkgs?

see this part of the readme: GitHub - nix-community/NUR: Nix User Repository: User contributed nix packages [maintainer=@Mic92]

This should be one of the first things to encounter in the documentation.

1 Like

Thanks for that link! This really helps. :slight_smile: Actually just started writing my first package! Thank you!