home.nix
author Tomas Zeman <tomas@functionals.cz>
Fri, 10 Jul 2020 16:35:43 +0200
changeset 14 30c184da8c38
parent 13 21b163f36071
child 15 070c8c2a6a62
permissions -rw-r--r--
nixpkgs-config.nix: share config.nix for nix-* and home-manager

{ config, pkgs, ... }:

let

  my-nur = import /repos/NixOS/nur-packages {
    inherit pkgs;
  };

in

{
  imports = [
    ./idea.nix
    ./mailcap.nix
    ./sbt.nix
    ./scripts.nix
    ./ssh.nix
    ./priv
  ];

  home.packages = [
    my-nur.guilt
    my-nur.hgeditor
    pkgs.fossil
    pkgs.nix-direnv
    pkgs.quilt
    pkgs.xorg.xwd     # X dump/screenshot
    pkgs.netpbm       # pnmtops
    pkgs.ghostscript
  ];

  nixpkgs.config = import ./nixpkgs-config.nix;

  programs.bash = {
    enable = true;
    enableAutojump = true;
    initExtra = ''
      export LC_CTYPE=cs_CZ.UTF-8
      unset LC_ALL
      eval `dircolors $HOME/.dir_colors`
      eval `keychain --eval --agents ssh,gpg`
      PS1='[\u@\h \W \D{%F %T}]\n\$ '
    '';
    sessionVariables = {
      HGEDITOR="hgeditor";
    };
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  programs.direnv = {
    enable = true;
    enableBashIntegration = true;
    stdlib = ''
      if [ -f ~/.nix-profile/share/nix-direnv/direnvrc ]; then
        source ~/.nix-profile/share/nix-direnv/direnvrc
      fi
    '';
  };

  services.gpg-agent = {
    enable = true;
    pinentryFlavor = "gtk2";
    verbose = true;
  };

  xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;

  # This value determines the Home Manager release that your
  # configuration is compatible with. This helps avoid breakage
  # when a new Home Manager release introduces backwards
  # incompatible changes.
  #
  # You can update Home Manager without changing this value. See
  # the Home Manager release notes for a list of state version
  # changes in each release.
  home.stateVersion = "20.03";
}

# vim: ts=2 sw=2 et