{ config
, pkgs
, lib
, ...
}:
let
  toml = pkgs.formats.toml { };
in
{
  nixpkgs.config = import ../config.nix;
  nix = {
    enable = true;
    # needed for "standalone" home-manager, conflicts with module
    package = lib.mkDefault pkgs.lix;
  };

  home.packages = with pkgs; [
    cached-nix-shell
    nixd
    nil
    npins
    nix-prefetch-scripts
    nix-init
    nix-update
    nix-tree
    common-updater-scripts
    nixpkgs-fmt
    nixpkgs-lint
    nixpkgs-review
    nix-output-monitor
  ];
  xdg.configFile."nix-init/config.toml".source = toml.generate "config.toml" {
    maintainers = [ "alanpearce" ];
    nixpkgs = "<nixpkgs>";
  };
  programs.emacs.extraPackages = epkgs: (with epkgs; [
    nix-mode
    nix-update
  ]);
  programs.neovim.plugins = with pkgs.vimPlugins; [
    vim-nix
  ];
}