summaryrefslogtreecommitdiff
path: root/home.nix
blob: f62bd4c7c99b97d20934047e380d04eb48e599bf (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{
  config,
  lib,
  nixvim,
  pkgs,
  ...
}: let
  vars = {
    BEMENU_OPTS =
      "--fn 'Hermit 12' --line-height 25 "
      + "--hb #a1b56c --hf #f8f8f8 --nf #b8b8b8 --af #b8b8b8 "
      + "--tf #f8f8f8 --fbf #f8f8f8 --ff #f8f8f8 --cf #f8f8f8 "
      + "--sf #f8f8f8 --scf #f8f8f8 --hp 10";
  };
in {
  home = {
    username = "tom";
    homeDirectory = "/home/tom";
    stateVersion = "23.11";
    packages = with pkgs; [
      acpi
      bemenu
      binutils
      brave
      feh
      file
      firefox
      ghc
      gimp
      haskellPackages.fourmolu
      htop
      jq
      ncdu
      ncmpcpp
      nixvim.packages.x86_64-linux.default
      nmap
      pavucontrol
      python3Packages.ipython
      scrot
      tmux
      tree
      unzip
      vim
      xautolock
      xmobar
    ];
    sessionVariables =
      vars
      // {
        LESS = "-R -F";
        EDITOR = "vim";
      };

    file.".xinitrc".text = ''
      xmonad
    '';
    # todo find better solution for
    # restarting without nixos switch
    file.".config/xmonad/xmonad.hs".source =
      config.lib.file.mkOutOfStoreSymlink
      "${config.home.homeDirectory}/src/nixos/xmonad.hs";
    file.".xmobarrc".source =
      config.lib.file.mkOutOfStoreSymlink
      "${config.home.homeDirectory}/src/nixos/xmobarrc";
  };
  programs = {
    home-manager.enable = true;
    alacritty = {
      enable = true;
      settings = {
        env.TERM = "xterm-256color";
        font = {
          bold.family = "Hermit";
          bold_italic.family = "Hermit";
          italic.family = "Hermit";
          normal.family = "Hermit";
          size = 10;
        };
        keyboard.bindings = [
          {
            key = "=";
            mods = "ALT";
            action = "IncreaseFontSize";
          }
          {
            key = "-";
            mods = "ALT";
            action = "DecreaseFontSize";
          }
        ];
      };
    };
    git = {
      enable = true;
      userName = "tom barrett";
      userEmail = "tom@tombarrett.xyz";
      extraConfig = {
        init.defaultBranch = "master";
        pull.rebase = true;
        push.autoSetupRemote = true;
      };
    };
    gpg.enable = true;
    password-store = {
      enable = true;
      package = pkgs.pass.withExtensions (exts: [exts.pass-otp]);
    };
    zsh = {
      enable = true;
      autosuggestion.enable = true;
      syntaxHighlighting.enable = true;
      autocd = true;
    };
  };
  systemd.user.settings.Manager.DefaultEnvironment = vars;
  xsession.windowManager.xmonad = {
    enable = true;
    enableContribAndExtras = true;
  };
  services = {
    gpg-agent = {
      enable = true;
      enableSshSupport = true;
      pinentryPackage = pkgs.pinentry-bemenu;
      # from gpg --list-secret-keys --with-keygrip ([A] keygrip)
      sshKeys = [""];
    };
  };
  xdg.userDirs = {
    enable = true;
    extraConfig = let
      downloads = "${config.home.homeDirectory}/downloads";
    in {
      XDG_DESKTOP_DIR = downloads;
      XDG_DOCUMENTS_DIR = downloads;
      XDG_DOWNLOAD_DIR = downloads;
      XDG_MISC_DIR = downloads;
      XDG_MUSIC_DIR = downloads;
      XDG_PICTURES_DIR = downloads;
      XDG_PUBLICSHARE_DIR = downloads;
      XDG_TEMPLATES_DIR = downloads;
      XDG_VIDEOS_DIR = downloads;
    };
  };
}