Installs a single or multiple packages via nix

    :type pkgs: list(str)
    :param pkgs:
        packages to update
    :param bool attributes:
        Pass the list of packages or single package as attribues, not package names.
        default: False

    :return: Installed packages. Example element: ``gcc-3.3.2``
    :rtype: list(str)

    .. code-block:: bash

        salt '*' nix.install package [package2 ...]
        salt '*' nix.install attributes=True attr.name [attr.name2 ...]

def install(*pkgs, **kwargs):
    '''
    Installs a single or multiple packages via nix

    :type pkgs: list(str)
    :param pkgs:
        packages to update
    :param bool attributes:
        Pass the list of packages or single package as attribues, not package names.
        default: False

    :return: Installed packages. Example element: ``gcc-3.3.2``
    :rtype: list(str)

    .. code-block:: bash

        salt '*' nix.install package [package2 ...]
        salt '*' nix.install attributes=True attr.name [attr.name2 ...]
    '''

    attributes = kwargs.get('attributes', False)

    if not pkgs:
        return "Plese specify a package or packages to upgrade"

    cmd = _quietnix()
    cmd.append('--install')

    if kwargs.get('attributes', False):
        cmd.extend(_zip_flatten('--attr', pkgs))
    else:
        cmd.extend(pkgs)

    out = _run(cmd)

    installs = list(itertools.chain.from_iterable(
        [s.split()[1:] for s in out['stderr'].splitlines()
         if s.startswith('installing')]
        ))

    return [_strip_quotes(s) for s in installs]