anchor.diff:    destroySh = ./destroy.sh.in;
   
     linkProfile = profile: ''
  -    for i in ${profile}/{etc,bin,lib{,32,64},sbin,share,var}; do
  +    for i in ${profile}/{etc,bin,sbin,share,var}; do
           if [ -x "$i" ]
           then
               ln -s "$i"
  
positive.code:   # the target profile is the actual profile that will be used for the chroot
    setupTargetProfile = ''
      ${linkProfile staticUsrProfileTarget}
      mkdir -m0755 usr
      cd usr
      ${linkProfile staticUsrProfileTarget}
      cd ..
    '';
  
  
negative.code: assert multiPkgs  != null -> targetPkgs != null;
  assert targetPkgs != null -> pkgs       == [];
  
  
  # HOWTO:
  # If pkgs is defined buildFHSChrootEnv will run in legacy mode. This means
  # it will build all pkgs contained in pkgs and basePkgs and then just merge
  # all of their contents together via buildEnv.
  #
  # The new way is to define both targetPkgs and multiPkgs. These two are
  # functions which get a pkgs environment supplied and should then return a list
  # of packages based this environment.
  # For example: targetPkgs = pkgs: [ pkgs.nmap ];
  #
  # All packages (most likeley programs) placed in targetPkgs will only be
  # installed once--matching the hosts architecture (64bit on x86_64 and 32bit on
  # x86). These packages will populate the chroot directory tree.
  #
  # Packages (most likeley libraries) defined in multiPkgs will be installed once
  # on x86 systems and twice on x86_64 systems.
  # On x86 they will just be merge with the packages defined in targetPkgs.
  # On x86_64 they will be added to targetPkgs and in addition their 32bit
  # versions will also be installed. The final directory should look as follows:
  # /lib will include 32bit libraries from multiPkgs
  # /lib32 will link to /lib
  # /lib64 will include 64bit libraries from multiPkgs and targetPkgs
  # /x86 will contain a complete 32bit environment composed by multiPkgs
  
  let
    is64Bit       = system == "x86_64-linux";
    # enable multi builds on x86_64 hosts if pakgs_target/multi are defined
    isMultiBuild  = is64Bit && targetPkgs != null;
    isTargetBuild = !isMultiBuild;
  
    # list of packages (usually programs) which will only be installed for the
    # hosts architecture
  