summaryrefslogtreecommitdiff
path: root/home.nix
blob: 6bbe0fb428bcbd6a335baba508e6ae6fe0b959c4 (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
{
  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
      binutils
      bemenu
      feh
      file
      ghc
      gimp
      haskellPackages.fourmolu
      htop
      ncmpcpp
      nixvim.packages.x86_64-linux.default
      tmux
      tree
      vim
      xmobar
    ];
    sessionVariables =
      vars
      // {
        LESS = "-R";
        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 = {
        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";
          }
        ];
      };
    };
    firefox = {
      enable = true;
      profiles.tom = {
        search = {
          default = "DuckDuckGo";
          force = true;
        };
        bookmarks = [
          {
            toolbar = true;
            bookmarks = [
              {
                name = "home-manager";
                url = "https://nix-community.github.io/home-manager/options.xhtml";
              }
              {
                name = "nixpkgs";
                url = "https://search.nixos.org/packages";
              }
            ];
          }
        ];
        settings = {
          "browser.startup.homepage" = "https://duckduckgo.com";
          "browser.newtabpage.enabled" = false;
          "browser.toolbars.bookmarks.visibility" = "always";
          "extensions.activeThemeID" = "firefox-compact-dark@mozilla.org";
          "general.autoScroll" = true;
          "browser.bookmarks.addedImportButton" = true;
          "browser.uiCustomization.state" = {
            "placements" = {
              "widget-overflow-fixed-list" = [];
              "unified-extensions-area" = [];
              "nav-bar" = [
                "back-button"
                "forward-button"
                "stop-reload-button"
                "urlbar-container"
                "downloads-button"
                "unified-extensions-button"
              ];
              "toolbar-menubar" = ["menubar-items"];
              "TabsToolbar" = ["tabbrowser-tabs" "new-tab-button" "alltabs-button"];
              "PersonalToolbar" = ["personal-bookmarks"];
            };
            "seen" = ["save-to-pocket-button" "developer-button"];
            "dirtyAreaCache" = ["nav-bar" "PersonalToolbar" "toolbar-menubar" "TabsToolbar"];
            "currentVersion" = 20;
            "newElementCount" = 3;
          };
          "privacy.sanitize.sanitizeOnShutdown" = true;
          "privacy.clearOnShutdown.cookies" = true;
          "privacy.clearOnShutdown.cache" = true;
          "privacy.clearOnShutdown.downloads" = true;
          "privacy.clearOnShutdown.history" = true;
          "privacy.clearOnShutdown.formData" = true;
          "privacy.clearOnShutdown.offlineApps" = true;
          "privacy.clearOnShutdown.sessions" = true;
          "privacy.clearOnShutdown.siteSettings" = true;
        };
      };
    };
    git = {
      enable = true;
      userName = "tom barrett";
      userEmail = "tom@tombarrett.xyz";
      extraConfig = {
        init.defaultBranch = "master";
      };
    };
    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 = {
    xscreensaver = {
      enable = true;
      settings = {
        mode = "blank";
      };
    };
    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;
    };
  };
}