about summary refs log tree commit diff
path: root/modules/nixos/profiles/headful.nix
blob: 6658582ea79848080018cc9cdcfed742c532a976 (plain) (blame)
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
{
  config,
  lib,
  pkgs,
  ...
}:
with lib; let
  cfg = config.nixfiles.modules.profiles.headful;
in {
  config = mkIf cfg.enable {
    nixfiles.modules = {
      chromium.enable = true;
      firefox.enable = true;
      sound.enable = true;

      nullmailer.enable = true;

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

    hm = {
      home.packages = with pkgs; [
        calibre
        element-desktop
        imv
        mumble
        telegram-desktop
        tor-browser-bundle-bin
      ];

      programs = {
        bash.shellAliases.open = "xdg-open";

        thunderbird = {
          enable = true;
          profiles.default = {
            isDefault = true;
            withExternalGnupg = true;
          };
          settings = {
            "app.update.auto" = false;
            "browser.display.document_color_use" = 2;
            "browser.display.use_system_colors" = true;
            "browser.search.region" = "US";
            "browser.search.update" = false;
            "datareporting.healthreport.uploadEnabled" = false;
            "full-screen-api.warning.delay" = 0;
            "full-screen-api.warning.timeout" = 0;
            "general.autoScroll" = true;
            "general.smoothScroll" = true;
            "mail.default_send_format" = 0;
            "mail.tabs.drawInTitlebar" =
              if config.nixfiles.modules.kde.enable
              then 1
              else 0;
            "mailnews.start_page.url" = "about:blank";
            "media.autoplay.blocking_policy" = 2;
            "media.autoplay.default" = 5;
            "media.autoplay.enabled" = false;
            "media.hardwaremediakeys.enabled" = false;
            "network.cookie.cookieBehavior" = 2;
            "places.history.enabled" = false;
            "reader.parse-on-load.enabled" = false;
            "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
          };
        };
      };
    };

    boot = {
      kernelPackages = mkDefault pkgs.linuxPackages_latest;

      kernelParams = [
        # https://wiki.archlinux.org/title/improving_performance#Watchdogs
        "nowatchdog"
        "kernel.nmi_watchdog=0"
        # A security risk I'm willing to take for a reason[1].
        #
        # [1]: https://www.phoronix.com/scan.php?page=article&item=spectre-meltdown-2&num=11
        "mitigations=off"
      ];

      loader = {
        efi.canTouchEfiVariables = true;

        systemd-boot = {
          enable = true;
          configurationLimit = 10;
        };
      };
    };

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

    programs = {
      dconf.enable = true;
      iftop.enable = true;
      mtr.enable = true;
    };

    services = {
      # https://github.com/NixOS/nixpkgs/issues/135888
      upower.enable = true;

      psd.enable = true;
    };

    environment.systemPackages = with pkgs; [lm_sensors];

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

Consider giving Nix/NixOS a try! <3