summaryrefslogtreecommitdiff
path: root/modules/home/christian.nix
blob: 98112ec87903a403f7bf1ff4677c6a409e067578 (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
{
  config,
  pkgs,
  inputs,
  lib,
  ...
}:
{
  imports = [ ./nvim ];

  options.custom.xmobarBattery = lib.mkEnableOption "xmobar battery widget";
  options.custom.xmobarVpn = lib.mkEnableOption "xmobar VPN indicator";

  config = {
    home.stateVersion = "25.11";

    home.packages = with pkgs; [
      (dmenu.override {
        conf = ./dmenu/config.h;
      })
      ripgrep
      fd
      git
      wget
      xclip
      hexyl
      calibre
      (pkgs.zathuraPkgs.zathuraWrapper.override {
        plugins = with pkgs.zathuraPkgs; [
          zathura_pdf_mupdf
          zathura_djvu
        ];
      })
    ];

    programs.alacritty = {
      enable = true;
      settings = {
        font.size = 8;
        selection.save_to_clipboard = true;
        mouse.bindings = [
          {
            mouse = "Right";
            action = "Paste";
          }
        ];
      };
    };

    programs.bash.enable = true;

    programs.fish = {
      enable = true;
      interactiveShellInit = "set -g fish_greeting";
    };

    programs.zoxide = {
      enable = true;
      enableFishIntegration = true;
    };

    programs.ssh = {
      enable = true;
      enableDefaultConfig = false;
      matchBlocks = {
        "myserver" = {
          hostname = "192.168.0.111";
        };
      };
    };

    programs.git = {
      enable = true;
      settings.user.name = "Christian";
      settings.user.email = "[email protected]";
      settings.init.defaultBranch = "main";
    };

    programs.direnv = {
      enable = true;
      enableBashIntegration = true;
      nix-direnv.enable = true;
      silent = true;
    };

    programs.firefox = {
      enable = true;
      policies = {
        OverrideFirstRunPage = "";
        DisableFirefoxAccounts = true;
        FirefoxHome = {
          SponsoredTopSites = false;
          Stories = false;
        };
      };
      profiles.christian = {
        name = "Christian";
        isDefault = true;
        settings = {
          "browser.aboutConfig.showWarning" = false;
          "extensions.autoDisableScopes" = 0;
          "browser.theme.content-theme" = 0;
          "browser.theme.toolbar-theme" = 0;
        };
        extensions.packages = with inputs.nur.legacyPackages.x86_64-linux.repos.rycee.firefox-addons; [
          ublock-origin
        ];
      };
    };

    programs.xmobar = {
      enable = true;
      extraConfig = ''
        -- vim: set ft=haskell:
        Config
          { font        = "Monospace"
          , borderColor = "#d0d0d0"
          , border      = FullB
          , borderWidth = 1
          , bgColor     = "#222"
          , fgColor     = "grey"
          , position    = TopH 30
          , commands    =
              [ Run XMonadLog
              , Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10
              , Run Network "wlan0" ["-S", "True", "-t", "wlan: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10
              , Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10
              , Run Date "date: <fc=#4eb4fa>%a %d %b %Y %I:%M:%S %p </fc>" "date" 10
              ${lib.optionalString config.custom.xmobarBattery ''
                , Run Battery
                  ["-t", "bat: <leftbar> <left> <watts>",
                   "-L", "10", "-H", "80", "-S", "True",
                   "-l", "red", "-n", "#4eb4fa", "-h", "green",
                   "--",
                   "-L", "-15", "-H", "-5",
                   "-l", "red", "-m", "#4eb4fa", "-h", "green"]
                  600
              ''}
              ${lib.optionalString config.custom.xmobarVpn ''
                , Run Com "sh" ["-c", "ip link show wg0 2>/dev/null | grep -q 'UP' && echo '<fc=green>vpn: on</fc>' || echo '<fc=red>vpn: off</fc>'"] "vpn" 30
              ''}
              ]
          , sepChar     = "%"
          , alignSep    = "}{"
          , template    = "  %XMonadLog%  |  ${lib.optionalString config.custom.xmobarBattery "%battery% | "}${lib.optionalString config.custom.xmobarVpn "%vpn% | "}%cpu% | %memory% | %wlan0%  }{%date%  "
          }
      '';
    };

    programs.home-manager.enable = true;

    xdg.mimeApps = {
      enable = true;
      defaultApplications = {
        "application/pdf" = [ "org.pwmt.zathura.desktop" ];
        "image/vnd.djvu" = [ "org.pwmt.zathura.desktop" ];
        "image/vnd.djvu+multipage" = [ "org.pwmt.zathura.desktop" ];
        "text/html" = [ "firefox.desktop" ];
        "x-scheme-handler/http" = [ "firefox.desktop" ];
        "x-scheme-handler/https" = [ "firefox.desktop" ];
      };
    };
  };
}