summaryrefslogtreecommitdiff
path: root/modules/nixfiles/profiles/headful.nix
blob: f4d3dc9b263075a4bcf66a2002719502cf96ee89 (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
{
  config,
  lib,
  pkgs,
  this,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.profiles.headful;
in {
  options.nixfiles.modules.profiles.headful.enable =
    mkEnableOption "headful profile" // {default = this.isHeadful;};

  config = mkIf cfg.enable {
    nixfiles.modules = {
      profiles.dev.default.enable = true;

      alacritty.enable = true;
      aria2.enable = true;
      chromium.enable = true;
      emacs.enable = true;
      firefox.enable = true;
      mpv.enable = true;
      openssh.client.enable = true;
      password-store.enable = true;
      sound.enable = true;
      x11.enable = true;

      dwm.enable = mkDefault false;
      gnome.enable = mkDefault false;
      kde.enable = mkDefault true;
      xmonad.enable = mkDefault false;
    };

    hm = {
      home.packages = with pkgs; [
        calibre
        convmv
        dos2unix
        kotatogram-desktop
        nheko
        tor-browser
      ];

      accounts.email = {
        maildirBasePath = "${config.my.home}/mail";

        accounts = let
          mkAccount = attrs:
            mkMerge [
              {
                mbsync = {
                  enable = true;
                  create = "both";
                  expunge = "both";
                  patterns = ["*"];
                };
                msmtp.enable = true;
                mu.enable = true;
              }
              attrs
            ];

          pass = path: "${pkgs.pass}/bin/pass show ${path}";
        in {
          shire = mkAccount {
            address = my.email;
            gpg = {
              inherit (my.pgp) key;
              signByDefault = true;
              encryptByDefault = false;
            };

            primary = true;

            imap.host = "shire.me";
            smtp.host = "shire.me";
            userName = "azahi@shire.me";
            passwordCommand = pass "email/shire.me/azahi";
          };

          yahoo = mkAccount {
            address = "a.gondor@yahoo.com";

            imap.host = "imap.yahoo.com";
            smtp.host = "smtp.yahoo.com";
            userName = "a.gondor@yahoo.com";
            passwordCommand = pass "email/yahoo.com/a.gondor";
          };
        };
      };

      programs = {
        mbsync.enable = true;
        msmtp.enable = true;
        mu.enable = true;
      };
    };

    # There are (arguably) not a lot of reasons to keep mitigations enabled for
    # on machine that is not web-facing. First of all, to completely mitigate
    # any possible Spectre holes one would need to disable Hyperthreading
    # altogether which will essentially put one's computer into the stone age by
    # not being able to to effectively utilise multi-core its multicore
    # capabilities. Secondly, by enabling mitigations, we introduce a plethora
    # of performace overheads[1], which, albeit small, but still contribute to
    # the overall speed of things. This is however still poses a security risk,
    # which I am willing to take.
    #
    # [1]: https://www.phoronix.com/scan.php?page=article&item=spectre-meltdown-2&num=11
    boot.kernelParams = ["mitigations=off"];

    hardware.opengl = {
      enable = true;
      driSupport = true;
    };

    programs = {
      iftop.enable = true;
      mtr.enable = true;
      traceroute.enable = true;

      bash.shellAliases.open = "${pkgs.xdg-utils}/bin/xdg-open";
    };

    services.upower.enable = true;

    environment.systemPackages = with pkgs; [
      arping
      ethtool
      inetutils
      nethogs
      socat
      tcpdump
    ];

    my.extraGroups = ["audio" "video" "input"];
  };
}