on 19052d8 help sign in
haskell.nix/lib/system-pkgs.nix
33 lines 941 B history raw
1# Cabal packages can depend on operating system packages. However
2# package names vary between distributions - there is no standard.
3#
4# This file augments the nixpkgs package set with extra attributes
5# from the system packages map file.
6#
7# This package set will be used when resolving system package
8# dependencies of package descriptions.
10pkgs:
12let
13 buildEnvMaybe = name: paths:
14 if builtins.length paths == 1
15 then builtins.head paths
16 else pkgs.buildEnv { name = "${name}-env"; inherit paths; };
18 mapPackages = name: ps:
19 if builtins.typeOf ps == "list"
20 then buildEnvMaybe name ps
21 else ps;
23in
24 # Base packages.
25 pkgs
27 # fetchgit should always come from the evalPackages
28 # if it comes from the targetPackages we won't even
29 # be able to execute it.
30 // { fetchgit = pkgs.evalPackages.fetchgit; }
32 # Apply the mapping.
33 // builtins.mapAttrs mapPackages (import ./system-nixpkgs-map.nix pkgs)