~ruther/nixos-config

ref: 6904cf1761334d033556f106c82d79b48e6657f4 nixos-config/home/modules/profiles/base.nix -rw-r--r-- 6.8 KiB
6904cf17 — Frantisek Bohacek refactor: modularize the configuration 1 year, 1 day ago
                                                                                
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
{ inputs, config, lib, pkgs, ... }:

let
  nur = import inputs.nur {
    nurpkgs = import inputs.nixpkgs { inherit (pkgs) system; };
    inherit pkgs;
  };
in {
  options = {
    profiles.base = {
      enable = lib.mkOption {
        type = lib.types.bool;
        default = true;
      };
    };
  };

  config = lib.mkIf config.profiles.base.enable {
    home-config.startup.apps = [ (lib.getExe pkgs.firefox) ];

    programs = {

    dircolors = {
      enable = true;
      settings = {
        OTHER_WRITABLE = "01;35"; # Make ntfs colors readable
      };
    };

    kitty = {
      enable = true;
      font = {
        name = "FiraCode Nerd Font";
        size = 12;
      };
      theme = "Chalk";
    };

    alacritty = {
      enable = true;
      settings = {
        font = {
          normal.family = "FiraCode Nerd Font";
          bold = { style = "Bold"; };
          size = 12;
        };
        # offset = {                            # Positioning
        #   x = -1;
        #   y = 0;
        # };
      };
    };

      starship = {
        enable = true;
      };

      zsh = {
        enable = true;
        autosuggestion.enable = true;
        syntaxHighlighting.enable = true;
        enableCompletion = true;
        history.size = 100000;

        oh-my-zsh = {                               # Extra plugins for zsh
        enable = true;
        plugins = [ "git" ];
        };

        initExtra = ''
            function loc {
            nix-locate --top-level -w /bin/$1
            }
            function exa-nixpkgs-derivation {
            nix run nixpkgs#eza -- --tree $(nix build nixpkgs#$1 --print-out-paths --out-link /tmp/$1)
            }

            # source /etc/set-environment
        '';
      };

      firefox = {
        enable = true;
        package = pkgs.firefox.override {
          nativeMessagingHosts = [
            pkgs.tridactyl-native
          ];
        };
        profiles = {
          default = {
            id = 0;
            name = "Default";
            isDefault = true;

            userChrome = ''
                #navigator-toolbox { font-family:Ubuntu !important }
            '';

            extensions = with nur.repos.rycee.firefox-addons; [
              # Basic
              proton-pass                # Password manager
              darkreader                 # Dark pages
              ublock-origin              # Ad block
              tridactyl                  # Vim-like keybindings

              # Containers
              multi-account-containers

              # Site specific
              # social fixer for facebook

              # UI
              text-contrast-for-dark-themes

              # Utility
              istilldontcareaboutcookies
              h264ify
              youtube-shorts-block

              # Privacy
              link-cleaner
              clearurls
              decentraleyes
              privacy-badger
              skip-redirect

              # Paywalls
              # bypass-paywalls-clean
            ];

            settings = {
              "beacon.enabled" = false;
              "browser.contentblocking.category" = "strict";

              "browser.newtabpage.enabled" = false; # Blank new tab page.
              "browser.startup.page" = 3; # Resume last session.
              "browser.tabs.closeWindowWithLastTab" = false;

              "browser.download.dir" = "${config.home.homeDirectory}/download";
              "browser.toolbars.bookmarks.visibility" = "newtab";
              "signon.rememberSignons" = false;
              "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
              "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;

              "layout.css.prefers-color-scheme.content-override" = 2;
              "browser.uidensity" = 1; # Dense.
              "extensions.unifiedExtensions.enabled" = false; # Disable extensions symbol in bar
              "layout.css.devPixelsPerPx" = 1; # Default zoom?

              "media.ffmpeg.vaapi.enabled" = true;
              "gfx.webrender.all" = true;

              "network.IDN_show_punycode" = true;

              "permissions.default.shortcuts" = 3; # Don't steal my shortcuts!

              "toolkit.legacyUserProfileCustomizations.stylesheets" = true;

              # Privacy
              "browser.search.hiddenOneOffs" =
                "Google,Yahoo,Bing,Amazon.com,Twitter";
                "browser.send_pings" = false;
                "dom.battery.enabled" = false;
                "dom.security.https_only_mode" = true;
                "network.dns.disablePrefetch" = true;
                "geo.enabled" = false;
                "browser.urlbar.speculativeConnect.enabled" = false; # Do not resolve dns before clicking
                "network.prefetch-next" = false;
                "media.video_stats.enabled" = false;

                "network.http.referer.XOriginPolicy" = 2;
                "network.http.referer.XOriginTrimmingPolicy" = 2;
                "network.http.referer.trimmingPolicy" = 1;

                "privacy.donottrackheader.enabled" = true;
                "privacy.donottrackheader.value" = 1;
                "privacy.firstparty.isolate" = true;

                # Fully disable Pocket. See
                # https://www.reddit.com/r/linux/comments/zabm2a.
                "extensions.pocket.enabled" = false;
                "extensions.pocket.api" = "0.0.0.0";
                "extensions.pocket.loggedOutVariant" = "";
                "extensions.pocket.oAuthConsumerKey" = "";
                "extensions.pocket.onSaveRecs" = false;
                "extensions.pocket.onSaveRecs.locales" = "";
                "extensions.pocket.showHome" = false;
                "extensions.pocket.site" = "0.0.0.0";
                "browser.newtabpage.activity-stream.pocketCta" = "";
                "browser.newtabpage.activity-stream.section.highlights.includePocket" =
                  false;
                  "services.sync.prefs.sync.browser.newtabpage.activity-stream.section.highlights.includePocket" =
                    false;
            };
          };
        };
      };

      # Email
      thunderbird = {
        enable = true;
        profiles = {
          default = {
            isDefault = true;
          };
        };
      };
    };

    accounts.email = {
      accounts = {
        ctu = {
          primary = true;
          thunderbird = {
            enable = true;
          };
          address = "bohacfr2@fel.cvut.cz";
          userName = "bohacfr2";
          realName = "František Boháček";
          imap = {
            host = "imap.fel.cvut.cz";
            port = 993;
          };
          smtp = {
            host = "smtpx.fel.cvut.cz";
            port = 465;
            tls = {
              enable = true;
            };
          };
        };
      };
    };
  };
}
Do not follow this link