I’ve written an application in Haskell and published it on Hackage. It’s called pinboard-notes-backup, and I can run
nix-env -i -A nixpkgs.haskellPackages.pinboard-notes-backup
to install it. That works okay, but I would like to make it a little nicer by
- making it available in the “top-level” namespace (or whatever you call this)
- installing the man page that comes with the project
- installing the bash and zsh completion scripts that can be generated by passing special flags to the program
I’m getting stuck just on step 1. I tried adding the line
pinboard-notes-backup = haskell.lib.justStaticExecutables haskellPackages.pinboard-notes-backup;
to the middle of top-level/all-packages.nix, but if I try to run
nix-env -i -A nixpkgs.pinboard-notes-backup
then I get
error: attribute ‘pinboard-notes-backup’ in selection path ‘nixpkgs.pinboard-notes-backup’ not found
This package is not part of any Stackage snapshots; is that why this formulation in all-packages.nix isn’t working for my package even though it works for others? Assuming I don’t want to add the package to Stackage at the moment, what’s the best way to create a Nix derivation for the program?