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

let
  solarized-xresources = ./xresources;
  theme = builtins.getEnv "XTHEME";
  colors = {
    "dark" = {
      background = "#292b2e";
      foreground = "#b2b2b2";
    };
    "light" = {
      background = "#fbf8ef";
      foreground = "#655370";
    };
  };
in
{
  imports = [ ./common.nix ./email.nix ];
  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 = 4;
          modules-center = "date";
          modules-right = "battery";
        };
        "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/ewmh" = {
          type = "internal/xworkspaces";
          pin-workspaces = true;
          enable-click = true;
          enable-scroll = false;
        };
      };
      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;
    };
  };
}