summaryrefslogtreecommitdiff
path: root/modules/home-manager/personal/environment.nix
blob: fba926626aa2dace0d9f26ee808afc925c04b112 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  config,
  lib,
  pkgs,
  ...
}@inputs:
{
  personal.home.wallpaper = lib.mkDefault (
    inputs.osConfig.stylix.image
      or (pkgs.personal.static.wallpapers.nga-1973-68-1.override { gravity = "north"; })
  );

  programs.bash = {
    enable = lib.mkDefault true;
  };

  home = {
    shellAliases = {
      amimullvad = "curl -Ls https://am.i.mullvad.net/connected";
      rm = "rm -f";
      ssh = "TERM=xterm-256color ssh";
      edit = "$EDITOR";
    };
    sessionVariables = {
      CDPATH = "~";
      DO_NOT_TRACK = "1";
    };
    packages =
      lib.optional (inputs.osConfig.programs.starship.enable or false) pkgs.nerd-fonts.fira-code
      ++ (with pkgs; [
        coreutils
        moreutils
      ]);
  };

  programs.bash.bashrcExtra = ''
    function set_win_title(){
      echo -ne "\033]0;$(whoami)@$(hostname):$(dirs)\a"
    }
    starship_precmd_user_func="set_win_title"
  '';

  services.gpg-agent = {
    enableBashIntegration = lib.mkDefault config.programs.bash.enable;
    pinentry.package = lib.mkDefault (if config.personal.gui.enable then pkgs.pinentry-qt else null);
    grabKeyboardAndMouse = lib.mkDefault false; # insecure, but necessary with keepass auto-type
  };
}