aboutsummaryrefslogtreecommitdiff
path: root/home-manager/home/homeold.nix
blob: 2e7a9bc2f3e1b81a9d8c7916efa1503f7fedee9b (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
{ config, pkgs, lib, ... }:

{
  home.username = "jerpo";
  home.homeDirectory = "/home/jerpo";
  home.stateVersion = "23.05";
  home.packages = with pkgs; [
    bat
    emacs
    nerdfonts
    pokemon-colorscripts-mac
    kitty
    telegram-desktop
    feh
    rofi
    htop
    ranger
    betterlockscreen
    clipboard-jh
    polybar
    xdragon
    obsidian
    xclip
    lutris
    steam
    mangohud
    gamemode
    vkdt
    transmission-gtk
    rubik
    obsidian
    osu-lazer
    spotify
    figma-linux
    easyeffects
    darktable
    python311Packages.python-lsp-server
    python311Packages.pyls-flake8
    python311Packages.python-lsp-black
  ];
  programs = {
    home-manager.enable = true;
    firefox = {
      enable = true;
      profiles.Betterfox = {
        isDefault = true;
        extensions = with pkgs.nur.repos.rycee.firefox-addons; [
          bitwarden
          ghostery
          switchyomega
          sponsorblock
          return-youtube-dislikes
        ];
        extraConfig = builtins.readFile ./home/programs/firefox/user.js;
        search = {
          engines = {
            "Brave" = {
              urls = [{ template = "https://search.brave.com/search?q={searchTerms}"; }];
              iconUpdateURL = "https://cdn.search.brave.com/serp/v2/_app/immutable/assets/safari-pinned-tab.539899c7.svg";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!br" ];
            };
            "NixOS" = {
              urls = [{ template = "https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query={searchTerms}"; }];
              iconUpdateURL = "https://nixos.org/favicon.png";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!ns" ];
            };
            "HomeManager" = {
              urls = [{ template = "https://mipmip.github.io/home-manager-option-search/?query={searchTerms}"; }];
              iconUpdateURL = "https://github.com/mipmip/home-manager-option-search/blob/main/images/favicon.png";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!hs" ];
            };
            "ai question" = {
              urls = [{ template = "https://iask.ai/?mode=question&q={searchTerms}"; }];
              iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!aq" ];
            };
            "ai forums" = {
              urls = [{ template = "https://iask.ai/?mode=forums&q={searchTerms}"; }];
              iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!af" ];
            };
            "ai wiki" = {
              urls = [{ template = "https://iask.ai/?mode=wiki&q={searchTerms}"; }];
              iconUpdateURL = "https://iask.ai/favicons/favicon-32x32-650bd8771fdea8866630408578e381cc.png?vsn=d";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!aw" ];
            };
            "FastGPT" = {
              urls = [{ template = "https://labs.kagi.com/fastgpt?query={searchTerms}"; }];
              definedAliases = [ "!fq" ];
            };
            "NixWiki" = {
              urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}&go=Go"; }];
              iconUpdateURL = "https://nixos.org/favicon.png";
              updateInterval = 24 * 60 * 60 * 1000;
              definedAliases = [ "!nw" ];
            };
          };
          default = "Brave";
        };
      };
    };
    fish = {
      enable = true;
      interactiveShellInit = ''
        set fish_greeting
        pokemon-colorscripts -r | awk "NR>1 {print}"
        set -gx EDITOR "emacsclient -c -a \"emacs\""
        '';
      plugins = [
        { name = "colored-man-output"; src = pkgs.fishPlugins.colored-man-pages.src; }
        { name = "fzf-fish"; src = pkgs.fishPlugins.fzf-fish.src; }
        { name = "pure"; src = pkgs.fishPlugins.pure.src; }
        { name = "autopair"; src = pkgs.fishPlugins.autopair.src; }
      ];
    };
    kitty = {
      enable = true;
      font.name = "Source Code Pro";
      font.size = 11.3;
      theme = "Rosé Pine Moon";
      shellIntegration.enableFishIntegration = true;
      extraConfig = "cursor_shape underline";
    };
  };
  xsession.windowManager.bspwm = {
    enable = true;
    monitors = {
      "^1" = [
        "α"
        "β"
        "γ"
        "δ"
        "ε"
      ];
      "^2" = [
        "α"
        "β"
        "γ"
        "δ"
        "ε"
      ];
    };
    settings = {
      focused_border_color = "#908caa";
      normal_border_color = "#363a4f";
      presel_feedback_color = "#752f20";
      border_width = 3;
      window_gap = 12;
      focus_follows_pointer = true;
      split_ratio = 0.5;
    };
    startupPrograms = [
      "picom -b"
      "setxkbmap -option grp:alt_shift_toggle,grp:win_space_toggle us,ru"
      "emacs --daemon"
      "feh --bg-fill ~/dotfiles/cat.png"
    ];
  };
  services = {
    sxhkd = {
      enable = true;
      keybindings = {
        # Apps
        "{_,shift} + {_,control} + Print" = "xfce4-screenshooter -{r,f} {_,-c}"; # Screenshooter
        "super + apostrophe" = "betterlockscreen -l"; # Lockscreen
        "super + grave" = "polybar -r"; # Restart polybar
        "super + q" = "kitty"; # Open terminal
        "super + d" = "rofi -show-icons -show drun"; # Open app chooser
        "super + shift + d" = "CM_LAUNCHER=rofi clipmenu";
        "super + b" = "firefox"; # Open browser
        "super + e" = "emacsclient -c -a 'emacs'"; # Open emacs
        "super + shift + o" = "obsidian"; # Open obsidian
        # Bspwm
        "super + Escape" = "pkill -USR1 -x sxhkd"; # Restart sxhkd
        "super + shift + {e,r}" = "bspc {quit,wm -r}"; # Quit/restart bspwm
        "super + {control,shift} + q" = "bspc node -{k,c}"; # Close/kill window
        "super + m" = "bspc desktop -l next"; # Maximise window
        "super + {t,shift + t,v,f}" = "bspc node -t {tiled,pseudo_tiled,floating,fullscreen}"; # Set window state
        "super + {_,shift + }{h,j,k,l}" = "bspc node -{f,s} {west,south,north,east}"; # Focus window in the given direction
        "super + {Left,Down,Up,Right}" = "bspc node -v {-20 0,0 20,0 -20,20 0}"; # Move a floating window
        "super + s : {h,j,k,l}" = ''STEP=20; SELECTION={1,2,3,4};\
          bspc node -z $(echo "left -$STEP 0,bottom 0 $STEP,top 0 -$STEP,right $STEP 0" | cut -d',' -f$SELECTION) ||\
          bspc node -z $(echo "right -$STEP 0,top 0 $STEP,bottom 0 -$STEP,left $STEP 0" | cut -d',' -f$SELECTION)''; # Better window resize
        "super + bracket{left,right}" = "bspc desktop -f {prev,next}.local"; # Focus next/previos desktop
        "super + {_,shift + }{1-9,0}" = "bspc {desktop -f,node -d} $(bspc query -D -m focused | awk 'NR=={1-9,0}')"; # Focus/send window to the given desktop on the focused monitor
        "super + o" = "bspc node -m last -f"; # Send window to the last used monitor
        "super + ctrl + {1-9}" = "bspc node -o 0.{1-9}"; # Preselect the window ratio
        "super + ctrl + space" = "bspc node -p cancel"; # Cansel the preselected ratio
      };
    };
    picom = {
      enable = true;
      settings = {
        fading = true;
        fade-in-step = 0.05;
        fade-out-step = 0.05;
        blur-background = true;
        corner-radius = 8;
        blur = {
          method = "dual_kawase";
          size = 12;
          deviation = false;
          strength = 2;
          kern = "3x3box";
        };
        backend = "glx";
        vsync = true;
        mark = {
          wmwin-focused = true;
          overdir-focused = true;
        };
        detect = {
          rounded-corners = true;
          client-opacity = true;
          transient = true;
        };
        use-ewmh-active-win = true;
        glx-no-stencil = true;
        use-damage = true;
      };
      wintypes = {
        tooltip = {
          fade = true;
          shadow = true;
          full-shadow = false;
          blur = false;
          focus = true;
        };
        dock = {
          shadow = false;
        };
      };
    };
    clipmenu.enable = true;
  };
  gtk = {
    cursorTheme = {
      name = "Bibata-Modern-Ice";
      package = pkgs.bibata-cursors;
    };
    iconTheme = {
      name = "rose-pine-moon";
      package = pkgs.rose-pine-icon-theme;
    };
    theme = {
      name = "rose-pine-moon";
      package = pkgs.rose-pine-gtk-theme;
    };
  };
}