nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
7.05k stars 1.82k forks source link

home-manager switch became slow #873

Closed codygman closed 5 years ago

codygman commented 5 years ago

I believe it started happening after I installed xmonad:

~/.config/nixpkgs $ time home-manager switch
There are 91 unread and relevant news items.
Read them by running the command 'home-manager news'.

55.633 secs

My home.nix:

{ config, pkgs, home, ... }:

with import <nixpkgs> {};
with lib;

let
  emacsHEAD = import ./emacs.nix;
in
{

  services = (if stdenv.isDarwin then {} else {

    emacs = {
      # emacs service not available on darwin?
      enable = true;
    };

    syncthing = {
      enable = true;
    };

    redshift = {
      enable = true;
      provider = "manual";
    #   # 33.1212019" N, 97.1827227" W
      latitude = "33.121";
      longitude = "97.1827";
      temperature = {
        day = 6500;
        night = 3800;
      };
    #   brightness = {
    #     day = "0.9";
    #     night = "0.6";
    #   };
    };

    gpg-agent = {
      enable = true;
      defaultCacheTtl = 1800;
      enableSshSupport = true;
    };

  });

  programs = {
  # Let Home Manager install and manage itself.
    home-manager.enable = true;
    emacs = {
      enable = true;
      package = emacsHEAD;
    };

    ssh = {
      enable = true;
      controlPath = "~/.ssh/master-%C";
    };

    git = {
      enable = true;
      userName = "codygman";
      userEmail = "codygman.consulting@gmail.com";
    };
    htop.enable = true;
    firefox.enable = (if stdenv.isDarwin then false else true); # todo install with home-manager
    vim.enable = true;
    jq.enable = true;
    # notmuch = {
    #   enable = true;
    #   hooks = {
    #     preNew = "mbsync --all";
    #   };
    # };
  };

  home.packages = with pkgs; [
    # redshift-plasma-applet # this doesn't really work
    ripgrep
    dmenu

    ghc
    haskellPackages.lens
    haskellPackages.pandoc
    haskellPackages.ghcid
    haskellPackages.hlint
    stack
    cabal2nix
    haskellPackages.brittany
    haskellPackages.hpack
    haskellPackages.cabal-install
  ] ++ (if stdenv.isDarwin then [] else [steam]);

  systemd.user.startServices = (if stdenv.isDarwin then false else true);

  xsession = (if stdenv.isDarwin then {} else {
    enable = (if stdenv.isDarwin then false else true);
    windowManager.xmonad = {
      enable = true;
      enableContribAndExtras = true;
      extraPackages = hpkgs: with hpkgs; [
        xmonad-contrib
        yeganesh
        xmobar
        taffybar
      ];
      config = ~/dotfiles/xmonad/xmonad.hs;
    };
  });

  home.keyboard = (if stdenv.isDarwin then {} else {
    layout = "us";
    options = [
      "ctrl:nocaps"
    ];
  });

  home.sessionVariables = (if stdenv.isDarwin then {} else {
    EDITOR = "emacsclient --create-frame --alternate-editor emacs";
  });
}
codygman commented 5 years ago

Perhaps this was a temporary issue.