summaryrefslogtreecommitdiff
path: root/linux.nix
blob: 04c8236cece28e532b74a8959b4317bbb603ad3f (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
{ pkgs, lib, ... }:

let
  solarized-xresources = ./xresources;
  homedir = builtins.getEnv "HOME";
  theme = lib.removeSuffix "\n"
        (builtins.readFile "${homedir}/.local/share/xtheme");
  colors = {
    "dark" = {
      background = "#292b2e";
      foreground = "#b2b2b2";
    };
    "light" = {
      background = "#fbf8ef";
      foreground = "#655370";
    };
  };
in
{
  imports = [ ./common.nix ./email.nix ];
  home.packages = [ pkgs.gnupg pkgs.pinentry ];
  fonts.fontconfig.enableProfileFonts = true;

  xresources = {
    properties = {
      "XTerm*font" = "-*-terminus-medium-r-normal--18-*-*-*-*-*-iso10646-1";
      "XTerm*faceName" = "Terminus";
      "XTerm*faceSize" = "10";
      "XTerm*termName" = "xterm-256color";
      "XTerm*metaSendsEscape" = true;
      "XTerm*utf8" = true;
    };
    extraConfig = builtins.readFile(solarized-xresources + "/Xresources." + theme);
  };

  services = {
    emacs.enable = true;
    network-manager-applet.enable = true;

    polybar = {
      enable = true;
      config = {
        "bar/top" = {
          font-0 = "mononoki:size-10";
          monitor = "\${env:MONITOR:eDP1}";
          monitor-fallback = "HDMI1";
          width = "100%";
          height = "2%";
          radius = 0;
          background = colors."${theme}".background;
          foreground = colors."${theme}".foreground;
          tray-position = "right";
          tray-detached = false;
          tray-maxsize = 16;
          tray-transparent = false;
          tray-background = colors."${theme}".background;
          tray-offset-x = 0;
          tray-offset-y = 0;
          tray-padding = 0;
          tray-scale = 1;
          module-margin = 1;
          modules-left = "ewmh";
          modules-center = "date";
          modules-right = [ "ethernet" "wifi" "battery" "volume" "cpu" ];
        };
        "module/date" = {
          type = "internal/date";
          internal = 5;
          date = "%Y.%m.%d";
          time = "%H.%M";
          label = "%date%..%time%";
        };
        "module/battery" = {
          type = "internal/battery";
          battery = "BAT0";
          adapter = "AC";
          full-at = 99;
        };
        "module/volume" = {
          type = "internal/alsa";
          interval = 5;
          label-volume = "vol: %percentage%% ";
        };
        "module/ewmh" = {
          type = "internal/xworkspaces";
          enable-click = true;
          enable-scroll = false;
        };
        "module/ethernet" = {
          type = "internal/network";
          interface = "enp1s0";
          label-connected = "eth: %upspeed:9%↑ %downspeed%↓ ";
          label-disconnected = "eth down";
        };
        "module/wifi" = {
          type = "internal/network";
          interface = "wlan1";
          label-connected = "wifi up: %upspeed% down: %downspeed%";
          label-disconnected = "wifi down";
        };
        "module/cpu" = {
          type = "internal/cpu";
          label = "cpu: %percentage%%";
        };
        "module/mail" = {
          # doesn't work, can't find "notmuch", idk why
          type = "custom/script";
          exec = "notmuch count tag:inbox and tag:unread";
          label = "mail: %output%";
        };
      };
      script = ''
        #!/usr/bin/env sh
        systemctl --user daemon-reload
        polybar top &
      '';
    };

    taffybar = {
      enable = false;
    };

    redshift = {
      enable = true;
      latitude = "33.044444";
      longitude = "-117.271667";
      temperature = {
        day = 4000;
        night = 3500;
      };
    };

    gpg-agent = {
      enable = true;
      defaultCacheTtl = 72000;
      maxCacheTtl = 7200;
      enableSshSupport = true;
      verbose = true;
      extraConfig = ''
        allow-emacs-pinentry
        #pinentry-program /home/ben/.nix-profile/bin/pinentry-tty
      '';
    };
  };

  xsession = {
    enable = true;
    windowManager = {
      xmonad = {
        enable = true;
        extraPackages = hpkgs: [
          hpkgs.xmonad-contrib
          hpkgs.xmonad-extras
          hpkgs.monad-logger
          #hpkgs.taffybar
        ];
        enableContribAndExtras = true;
        config = ./xmonad.hs;
      };
    };
  };

  programs = {

    firefox = {
      enable = true;
    };

    rofi = {
      enable = true;
    };
  };
}