[Nix-dev] Managing private Nix packages outside the Nixpkgs tree

Matthias Beyer mail at beyermatthias.de
Sun Jan 18 13:17:10 CET 2015


Hi Eike,

Thanks for your suggestions. I managed to build my own setup, which
works but is a bit bulky by now.

What I do:

    * define what vim-plugins I want to use from upstream (list)
    * define own vim plugins (list, lets call it ownPlugins)
    * Append the lists (lets call it vimPlugins)
    * Override vim
        * Append all plugins to the runtimepath, which means
            * "ownPlugins" is one package, so just append the
              appropriate RTP here
            * Append the appropriate path for each non-ownPlugins vim
              plugin package to the RTP
    * Append vimPlugins list to the systemPackages
    * Append my customized vim to the list of systempackages

I don't know whether the idea "append to the vim runtimepath" is the
thing that slows down vim at startup, but it seems so. It is a
slow machine, thought.

I will post a blog article about my vim setup maybe next week, I'll
notify you as soon as it is online!

On 17-01-2015 18:49:56, Eike wrote:
> AFAICS, its enough to specify your own definitions in
> `nixpkgs.packageOverrides'. This takes the original package collection
> and returns a map with new/overriden packages. I have this setup:
> 
> common.nix (imported in all machine configs):
> nixpkgs = {
>   config = {
>     allowUnfree = true;
>     packageOverrides = import ./pkgs;
>   };
> };
> 
> then ./pkgs/default.nix looks like this:
> pkgs:
> let
>   callPackage = pkgs.lib.callPackageWith(pkgs // custom);
>   custom = {
>     cdparanoiax = callPackage ./cdparanoiax {};
>     ...other packages...
>   };
> in custom

Looks sane to me.

As far as I can see, your `custom` is a Set here. But
`environment.systemPackages` must be a list, so how do you convert
it into a list?

> 
> Since the callPackage function is redefined that way, you can have
> dependencies between your own packages. Then each directory in pkgs is a
> package definition just like it is done in nixpkgs. I can then add
> `pkgs.cdparanoiax' to `environment.systemPackages'.
> 

Awesome! Having dependencies between own packages sounds good to me, I
will try this out! Thanks for pointing out how it works!

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
Url : http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150118/de28df28/attachment.bin 


More information about the nix-dev mailing list