[Nix-dev] Managing private Nix packages outside the Nixpkgs tree
Sander van der Burg
svanderburg at gmail.com
Mon Jan 19 17:48:57 CET 2015
Hi,
Sorry for my late answer. I was a bit busy the last few days. Looks like
Elke's suggestion leads you in the right way. Anyway, if you want to refer
to a custom package registry from a NixOS configuration, you could simply
write a config like this:
{pkgs, ...}:
let
customPkgs = import /home/sander/custom-packages.nix {};
{
boot.loader.grub = ....
services.openssh.enable = true;
environment.systemPackages = [
customPkgs.mc
];
}
The above NixOS configuration uses the mc package from my private custom
Nix expression, as shown in the blog post.
On Sun, Jan 18, 2015 at 12:17 PM, Matthias Beyer <mail at beyermatthias.de>
wrote:
> 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.
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150119/7dfa374a/attachment-0001.html
More information about the nix-dev
mailing list