]> gitweb.ps.run Git - flake_thinkpad/blob - home.nix
fcf744d0fcbee41d5bbaa258f5db356b94bb56cf
[flake_thinkpad] / home.nix
1 { config, pkgs, lib, wallpaper, ... }:
2
3 let
4   theme = pkgs.qogir-theme.override { tweaks = [ "square" ]; };
5   markdownStyleHeader = pkgs.writeText "style.html" ''
6     <style type="text/css">
7     html{
8       margin:40px auto;
9       max-width:650px;
10       line-height:1.6;
11       font-size:18px;
12       color:#444;
13       background-color:#EEE;
14       padding:0 10px
15     }
16     @media (prefers-color-scheme: dark) {
17     html{
18       color:#CCC;
19       background-color:#333;
20     }
21     }
22     h1,h2,h3{line-height:1.2}
23     </style>
24   '';
25   markdownCaddyfile = pkgs.writeText "Caddyfile" ''
26     :8123
27
28     encode zstd gzip
29     templates
30     file_server browse {
31             root "/"
32             hide ".*"
33     }
34
35     @md <<CEL
36       {file}.endsWith(".md")
37       || {file}.endsWith(".MD")
38       CEL
39
40     header @md Content-Type "text/html; charset=UTF-8"
41     respond @md <<HTML
42             <!DOCTYPE html>
43             <html>
44                     <head>
45                             <title>{{ "{file.base}" }}</title>
46                             <link rel="stylesheet" href="https://sindresorhus.com/github-markdown-css/github-markdown.css">
47                             <style>
48                             .markdown-body {
49                                         box-sizing: border-box;
50                                         min-width: 200px;
51                                         max-width: 980px;
52                                         margin: 0 auto;
53                                         padding: 45px;
54                                 }
55                             </style>
56                     </head>
57                     <body class="markdown-body">
58                     {{
59                     markdown (include "{path}")
60                     }}
61                     </body>
62             </html>
63             HTML 200
64   '';
65 in
66 {
67   # Home Manager needs a bit of information about you and the paths it should
68   # manage.
69   home.username = "ps";
70   home.homeDirectory = "/home/ps";
71
72   services.xcape = {
73     enable = true;
74     mapExpression = {
75       Caps_Lock = "Escape";
76     };
77   };
78
79   xfconf.settings = {
80     xfce4-desktop = {
81       "backdrop/screen0/monitor0/image-path" = "${wallpaper}";
82       "backdrop/screen0/monitor0/image-show" = true;
83       "backdrop/screen0/monitor0/image-style" = 5;
84     };
85   };
86
87   systemd.user.services.markdownCaddy = {
88     Unit = {
89       Description = "Run a web server serving Markdown files.";
90       Wants = [ "network-online.target" ];
91       After = [ "network-online.target" ];
92     };
93     Install = {
94       WantedBy = [ "default.target" ];
95     };
96     Service = {
97       WorkingDirectory = "/";
98       ExecStart = "${pkgs.writeShellScript "markdown-caddy" ''
99         ${pkgs.caddy}/bin/caddy run --config ${markdownCaddyfile} --adapter caddyfile
100       ''}";
101     };
102   };
103   
104   xsession.windowManager.i3 = {
105     enable = true;
106     config = {
107       bars = [];
108       modifier = "Mod4";
109       terminal = "${pkgs.kitty}/bin/kitty";
110       gaps = {
111         inner = 5;
112       };
113       keybindings =
114         let
115           mod = config.xsession.windowManager.i3.config.modifier;
116           i3-next = pkgs.writers.writePython3 "i3-next" {} ''
117             import json
118             from subprocess import check_output
119
120             workspaces = json.loads(check_output(
121               ["${pkgs.i3}/bin/i3-msg",
122                "-t", "get_workspaces"]))
123
124             outputs = {}
125             activeOutput = ""
126             activeWorkspace = -1
127
128             for w in workspaces:
129                 output = w["output"]
130                 workspace = int(w["num"])
131                 if output not in outputs:
132                     outputs[output] = set()
133                 outputs[output].add(workspace)
134                 if w["focused"]:
135                     activeOutput = output
136                     activeWorkspace = workspace
137
138             workspacesSorted = sorted(outputs[activeOutput])
139             activeWorkspaceIndex = workspacesSorted.index(activeWorkspace)
140
141             if activeWorkspaceIndex < len(workspacesSorted) - 1:
142                 print(workspacesSorted[activeWorkspaceIndex + 1])
143             else:
144                 allWorkspaces = set()
145                 for o in outputs.values():
146                     allWorkspaces = allWorkspaces.union(o)
147                 allWorkspacesSorted = sorted(allWorkspaces)
148                 print(allWorkspacesSorted[-1]+1)
149           '';
150   
151           i3-empty = pkgs.writers.writePython3 "i3-empty" {} ''
152             import json
153             from subprocess import check_output
154
155             workspaces = json.loads(check_output(
156               ["${pkgs.i3}/bin/i3-msg",
157                "-t", "get_workspaces"]))
158
159             nextWorkspace = 1
160       
161             for w in workspaces:
162                 wNum = int(w["num"])
163                 if wNum >= nextWorkspace:
164                     nextWorkspace = wNum + 1
165
166             print(nextWorkspace)
167           '';
168           
169           i3-max = pkgs.writers.writePython3 "i3-max" {} ''
170             import json
171             from subprocess import check_output
172
173             workspaces = json.loads(check_output(
174               ["${pkgs.i3}/bin/i3-msg",
175                "-t", "get_workspaces"]))
176
177             result = "MAX"
178       
179             for w in workspaces:
180                 wName = w["name"]
181                 wFocused = w["focused"]
182                 if wName == "MAX" and wFocused:
183                     result = "back_and_forth"
184                     break
185
186             print(f"move window to workspace {result}; workspace {result}")
187           '';
188           i3-move-max = pkgs.writers.writePython3 "i3-move-max" {} ''
189             import json
190             from subprocess import check_output
191
192             workspaces = json.loads(check_output(
193               ["${pkgs.i3}/bin/i3-msg",
194                "-t", "get_workspaces"]))
195
196             result = "MAX"
197       
198             for w in workspaces:
199                 wName = w["name"]
200                 wFocused = w["focused"]
201                 if wName == "MAX" and wFocused:
202                     result = "back_and_forth"
203                     break
204
205             print(f"workspace {result}")
206           '';
207         in lib.mkOptionDefault
208           {
209             # "${mod}+d" = "exec --no-startup-id krunner";
210             # "${mod}+Shift+p" = "exec --no-startup-id set-wallpaper";
211             "${mod}+Shift+Return" = "exec --no-startup-id ${pkgs.kitty}/bin/kitty -d $(${pkgs.xcwd}/bin/xcwd)";
212             "${mod}+BackSpace" = "kill";
213             "${mod}+Prior" = "workspace prev_on_output";
214             "${mod}+Next" = "exec --no-startup-id i3-msg workspace number $(${i3-next})";
215             "${mod}+End" = "exec --no-startup-id i3-msg workspace $(${i3-empty})";
216             "${mod}+Shift+Prior" = "move container to workspace prev_on_output";
217             "${mod}+Shift+Next" = "exec --no-startup-id i3-msg move container to workspace number $(${i3-next})";
218             "${mod}+Shift+End" = "exec --no-startup-id i3-msg move container to workspace $(${i3-empty})";
219             "${mod}+Ctrl+Left" = "move workspace to output left";
220             "${mod}+Ctrl+Right" = "move workspace to output right";
221             "${mod}+y" = "exec --no-startup-id mirror-phone";
222             "${mod}+n" = "exec ${pkgs.kitty}/bin/kitty -d ~/sync/txt $EDITOR .";
223             "${mod}+m" = "exec --no-startup-id i3-msg $(${i3-max})";
224             "${mod}+Shift+m" = "exec --no-startup-id i3-msg $(${i3-move-max})";
225             "${mod}+Shift+p" = "exec --no-startup-id ${pkgs.autorandr}/bin/autorandr --match-edid -c -f";
226           };
227     };
228     extraConfig = ''
229       exec ${pkgs.xfce.xfce4-panel}/bin/xfce4-panel
230       for_window [window_role="pop-up"] floating enable
231       for_window [window_role="task_dialog"] floating enable
232       # for_window [workspace="0"] floating enable
233
234       for_window [class="kitty-popup"] floating enable
235       for_window [class="Xfce4-appfinder"] floating enable
236       for_window [class=".blueman-manager-wrapped"] floating enable
237       for_window [class="yakuake"] floating enable
238       for_window [class="systemsettings"] floating enable
239       for_window [title="win7"] floating enable; border none
240
241       # class                 border  backgr. text    indicator child_border
242       client.focused          #000000bf #000000bf #e6ebef #000000bf   #000000bf
243       client.focused_inactive #00000080 #00000080 #e6ebef #00000080   #00000080
244       client.unfocused        #00000040 #00000040 #e6ebef #00000040   #00000040
245       client.urgent           #2f343a #900000 #e6ebef #900000   #2f343a
246       client.placeholder      #000000 #0c0c0c #e6ebef #000000   #0c0c0c
247
248       focus_follows_mouse no
249       mouse_warping none
250       popup_during_fullscreen all
251     '';
252   };
253
254   services.picom = {
255     enable = true;
256     vSync = true;
257     opacityRules = [
258       "0:_NET_WM_STATE@[*]:a = '_NET_WM_STATE_HIDDEN'"
259     ];
260   };
261
262   programs.git = {
263     userName = "patrick-scho";
264     userEmail = "patrick.schoenberger@posteo.de";
265     includes = [{ contents = {
266         user = {
267           email = "patrick.schoenberger@posteo.de";
268           name = "psch";
269         };
270     };}];
271   };
272
273   programs.bash = {
274     enable = true;
275     historySize = -1;
276     historyFileSize = -1;
277     shellAliases = {  
278       snrs = "sudo nixos-rebuild switch --flake /etc/nixos#default";
279       snrt = "sudo nixos-rebuild test --flake /etc/nixos#default";
280       snrb = "sudo nixos-rebuild boot --flake /etc/nixos#default";
281       senc = "sudo $EDITOR /etc/nixos/configuration.nix";
282       senh = "sudo $EDITOR /etc/nixos/home.nix";
283       senf = "sudo $EDITOR /etc/nixos/flake.nix";
284       flakerun = "nix run --override-input nixpkgs nixpkgs";
285       n = "nvim";
286     };
287   };
288
289   programs.fzf = {
290     enable = true;
291     enableBashIntegration = true;
292   };
293
294   programs.readline = {
295     enable = true;
296     bindings = {
297       "\\e[A" = "history-search-backward";
298       "\\e[B" = "history-search-forward";
299     };
300   };
301
302   programs.kitty = {
303     enable = true;
304     themeFile = "Adapta_Nokto_Maia";
305     settings = {
306       # hide_window_decorations = "yes";
307       background_opacity = "0.98";
308       background_blur = "1";
309       confirm_os_window_close = "0";
310       enable_audio_bell = "no";
311       scrollback_pager_history_size = "1024";
312     };
313   };
314
315   programs.helix = {
316     enable = true;
317     settings = {
318       theme = "base16_terminal";
319       editor.cursor-shape = {
320         insert = "bar";
321         normal = "block";
322         select = "underline";
323       };
324       editor.soft-wrap = {
325         enable = true;
326       };
327       editor.file-picker = {
328         hidden = false;
329       };
330       keys.normal."space" = {
331         "space" = "goto_word";
332       };
333     };
334     languages = {
335       language = [{
336         name = "c";
337         auto-format = true;
338         formatter = { command = "clang-format"; args = ["--style=microsoft"]; };
339       }];
340     };
341   };
342
343   home.file.".config/zls.json".text = ''
344     {
345       "enable_build_on_save": true,
346       "build_on_save_step": "check"
347     }
348   '';
349   
350   programs.neovim = {
351     enable = true;
352     defaultEditor = true;
353     plugins = with pkgs.vimPlugins; [
354       # fzfWrapper
355       # fzf-vim
356       formatter-nvim
357       goyo-vim
358       vim-visual-multi
359       nvim-lspconfig
360       blink-cmp
361       telescope-nvim
362       undotree
363       which-key-nvim
364       guess-indent-nvim
365     ];
366     extraConfig = ''
367       set number
368       set relativenumber
369       set tabstop=4
370       set shiftwidth=4
371       set expandtab
372       set foldmethod=marker
373       set autoindent
374       set smartindent
375       filetype plugin indent on
376       set signcolumn=yes
377
378       colorscheme habamax
379
380       nnoremap <Down> gj
381       nnoremap <Up> gk
382       vnoremap <Down> gj
383       vnoremap <Up> gk
384       inoremap <Down> <C-o>gj
385       inoremap <Up> <C-o>gk
386       tnoremap <Esc> <C-\><C-n>
387       map <Space> <Leader>
388       nnoremap <Esc> :noh<CR>
389       nnoremap <leader>u :UndotreeToggle<CR> :UndotreeFocus<CR>
390       nnoremap <leader>f :Telescope find_files<CR>
391       nnoremap <leader>b :Telescope buffers<CR>
392       nnoremap <leader>e :Telescope diagnostics<CR>
393       nnoremap <leader>g :Telescope live_grep<CR>
394       nnoremap <leader>s :Telescope lsp_document_symbols<CR>
395       nnoremap <leader>r :Telescope lsp_references<CR>
396       nnoremap <leader><S-r> :Telescope lsp_references<CR><C-q>
397       nnoremap <leader>d :Telescope lsp_definitions<CR>
398       noremap <leader>y "+y"<CR>
399       noremap <leader>p "+p"<CR>
400
401       " augroup FormatAutogroup
402       "   autocmd!
403       "   autocmd BufWritePost * FormatWrite
404       " augroup END
405
406       autocmd BufReadPost *
407       \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
408       \ |   exe "normal! g`\""
409       \ | endif
410     '';
411     extraLuaConfig = ''
412       require('lspconfig').zls.setup{}
413       require('lspconfig').clangd.setup{}
414       local util = require('formatter.util')
415       require('formatter').setup {
416         logging = true,
417         log_level = vim.log.levels.WARN,
418         filetype = {
419           c = { require("formatter.filetypes.c").clangformat },
420           cpp = { require("formatter.filetypes.cpp").clangformat },
421           zig = { require("formatter.filetypes.zig").zigfmt },
422         }
423       }
424       require('blink.cmp').setup {
425         keymap = {
426           preset = 'none',
427           
428           ['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
429           ['<C-e>'] = { 'hide', 'fallback' },
430           ['<CR>'] = { 'accept', 'fallback' },
431
432           ['<Tab>'] = { 'select_next', 'fallback_to_mappings' },
433           ['<S-Tab>'] = { 'select_prev', 'fallback_to_mappings' },
434
435           ['<C-p>'] = { 'scroll_documentation_up', 'fallback' },
436           ['<C-n'] = { 'scroll_documentation_down', 'fallback' },
437
438           ['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
439         },
440         completion = {
441           list = { selection = { preselect = false, } },
442         },
443       }
444     '';
445   };
446
447
448   home.file.".config/vis/plugins/vis-lspc" = {
449     source = builtins.fetchGit {
450       url = "https://gitlab.com/muhq/vis-lspc.git";
451       rev = "e184eb6c971abfcd0dc7f836f402aae6c33a8d13";
452     };
453     recursive = true;
454   };
455   home.file.".config/vis/plugins/vis-commentary" = {
456     source = builtins.fetchGit {
457       url = "https://github.com/lutobler/vis-commentary.git";
458       rev = "0e06ed8212c12c6651cb078b822390094b396f08";
459     };
460     recursive = true;
461   };
462   home.file.".config/vis/visrc.lua".text = ''
463       require('vis')
464       require('plugins/vis-commentary')
465       lspc = require('plugins/vis-lspc')
466
467       lspc.menu_cmd = 'vis-menu'
468       lspc.fallback_dirname_as_root = true
469       lspc.ls_map.zig = {name='zls',cmd='zls',roots={'build.zig'}}
470     
471       vis.events.subscribe(vis.events.INIT, function()
472         -- Your global configuration options
473       end)
474
475       vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args
476         -- Your per window configuration options e.g.
477         vis:command('set number on')
478         vis:command('set autoindent')
479         vis:command('set tabwidth 4')
480         vis:command('set expandtab on')
481       end)
482     '';
483
484   programs.emacs = {
485     enable = true;
486     extraConfig = ''
487       (menu-bar-mode 1)
488       (tool-bar-mode 0)
489       (scroll-bar-mode 0)
490       (global-display-line-numbers-mode)
491       (setq-default
492         display-line-numbers-type 'relative
493         make-backup-files nil
494         inhibit-startup-screen t)
495       (load-theme 'tango-dark t)
496     '';
497     extraPackages = epkgs: [
498       epkgs.zig-mode
499       epkgs.lsp-mode
500     ];
501   };
502
503   programs.tmux = {
504     enable = true;
505     escapeTime = 0;
506     extraConfig = ''
507       set-option -g default-terminal screen-256color
508       set -g history-limit 10000
509       set -g base-index 1
510       set-option -g renumber-windows on
511       bind-key -n M-n new-window -c "#{pane_current_path}"
512       bind-key -n M-1 select-window -t :1
513       bind-key -n M-2 select-window -t :2
514       bind-key -n M-3 select-window -t :3
515       bind-key -n M-4 select-window -t :4
516       bind-key -n M-5 select-window -t :5
517       bind-key -n M-6 select-window -t :6
518       bind-key -n M-7 select-window -t :7
519       bind-key -n M-8 select-window -t :8
520       bind-key -n M-9 select-window -t :9
521       bind-key -n M-0 select-window -t :0
522       bind-key -n M-. select-window -n
523       bind-key -n M-, select-window -p
524       bind-key -n M-S-. swap-window -t +1
525       bind-key -n M-S-, swap-window -t -1
526       bind-key -n M-X confirm-before "kill-window"
527       bind-key -n M-v split-window -h -c "#{pane_current_path}"
528       bind-key -n M-b split-window -v -c "#{pane_current_path}"
529       bind-key -n M-R command-prompt -I "" "rename-window '%%'"
530       bind-key -n M-f resize-pane -Z
531       bind-key -n M-h select-pane -L
532       bind-key -n M-l select-pane -R
533       bind-key -n M-k select-pane -U
534       bind-key -n M-j select-pane -D
535       bind-key -n M-Left select-pane -L
536       bind-key -n M-Right select-pane -R
537       bind-key -n M-Up select-pane -U
538       bind-key -n M-Down select-pane -D
539       bind-key -n "M-H" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old'
540       bind-key -n "M-J" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old'
541       bind-key -n "M-K" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old'
542       bind-key -n "M-L" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old'
543       bind-key -n "M-S-Left" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old'
544       bind-key -n "M-S-Down" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old'
545       bind-key -n "M-S-Up" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old'
546       bind-key -n "M-S-Right" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old'
547       bind-key -n M-x confirm-before "kill-pane"
548       bind-key -n M-/ copy-mode
549
550       # Linux system clipboard
551       bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
552       bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "xclip -in -selection clipboard"
553
554       set -g mouse on
555       # set-option -g status-keys vi
556       # set-option -g set-titles on
557       # set-option -g set-titles-string 'tmux - #W'
558       # set -g bell-action any
559       # set-option -g visual-bell off
560       # set-option -g set-clipboard off
561       # setw -g mode-keys vi
562       # setw -g monitor-activity on
563       # set -g visual-activity on
564       # set -g status-style fg=colour15
565       # set -g status-justify centre
566       # set -g status-left ""
567       # set -g status-right ""
568       # set -g status-interval 1
569       # set -g message-style fg=colour0,bg=colour3
570       # setw -g window-status-bell-style fg=colour1
571       # setw -g window-status-current-style fg=yellow,bold
572       # setw -g window-status-style fg=colour250
573       # setw -g window-status-current-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} '
574       # setw -g window-status-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} '
575       # # For older tmux:
576       # #setw -g window-status-format ' #W '
577       # #setw -g window-status-current-format ' #W '
578     '';
579   };
580
581   programs.nushell = {
582     enable = true;
583     # for editing directly to config.nu 
584     extraConfig = ''
585       $env.config = {
586         show_banner: false,
587         completions: {
588           case_sensitive: false # case-sensitive completions
589           quick: true           # set to false to prevent auto-selecting completions
590           partial: true         # set to false to prevent partial filling of the prompt
591           algorithm: "fuzzy"    # prefix or fuzzy
592         }
593         hooks: {
594           command_not_found: { |cmd| (command-not-found $cmd | str trim)  }
595         }
596       } 
597     '';
598     #  shellAliases = {
599     #  vi = "hx";
600     #  vim = "hx";
601     #  nano = "hx";
602     # };
603   };  
604   # programs.carapace = {
605   #   enable = true;
606   #   enableNushellIntegration = true;
607   # };
608
609   # programs.starship = {
610   #   enable = true;
611   #   settings = {
612   #     add_newline = false;
613   #     character = { 
614   #       success_symbol = "[➜](bold green)";
615   #       error_symbol = "[➜](bold red)";
616   #     };
617   #   };
618   # };
619
620   programs.firefox = {
621     enable = true;
622     profiles = {
623       default = {
624         settings = {
625           "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
626           "browser.fullscreen.autohide" = false;
627           "browser.toolbars.bookmarks.visibility" = "never";
628           "browser.tabs.inTitlebar" = 0;
629           "browser.compactmode.show" = true;
630           "browser.uidensity" = 1;
631         };
632         userChrome = ''
633         #TabsToolbar {
634           visibility: collapse !important;
635         }
636         '';
637       };
638       appmode = {
639         id = 1;
640         settings = {
641           "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
642           "browser.fullscreen.autohide" = false;
643           "browser.toolbars.bookmarks.visibility" = "never";
644           "browser.tabs.inTitlebar" = 0;
645           "browser.compactmode.show" = true;
646           "browser.uidensity" = 1;
647         };
648         userChrome = ''
649         #TabsToolbar {
650           visibility: collapse !important;
651         }
652         #nav-bar {
653           visibility: collapse !important;
654         }
655         #navigator-toolbox {
656           border-bottom: none !important;
657         }
658         '';        
659       };
660     };
661   };
662
663   xdg.desktopEntries = {
664     whatsapp = {
665       name = "WhatsApp";
666       genericName = "Messenger";
667       exec = "app web.whatsapp.com";
668       terminal = false;
669       categories = [ "Application" ];
670       icon = pkgs.fetchurl {
671         url = "https://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/2062095_application_chat_communication_logo_whatsapp_icon.svg/1024px-2062095_application_chat_communication_logo_whatsapp_icon.svg.png";
672         sha256 = "sha256-0eE3EEGnWFlpObfraTXMIqJz0Uya/h0hDsUA528qKCY=";
673       };
674     };
675     md = {
676       name = "Markdown";
677       genericName = "Documents";
678       exec = "md-app";
679       terminal = false;
680       categories = [ "Application" ];
681       icon = pkgs.fetchurl {
682         url = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/1024px-Markdown-mark.svg.png";
683         sha256 = "0v161jvmcfxp9lwd86y789430w1vpvxnnm5n2hzgr1kfh03psvb2";
684       };
685     };
686   };
687
688   gtk.enable = true;
689   gtk.theme = {
690     package = theme;
691     name = "Qogir-Dark";
692   };
693   # programs.gnome-shell.theme = {
694   #   package = theme;
695   #   name = "Qogir-Dark";
696   # };
697   # gtk.iconTheme = {
698   #   package = pkgs.vimix-icon-theme;
699   #   name = "vimix-doder-dark";
700   # };
701   home.pointerCursor = {
702     gtk.enable = true;
703     x11.enable = true;
704
705     name = "volantes_light_cursors";
706     size = 24;
707     package = pkgs.volantes-cursors;
708   };
709
710   # This value determines the Home Manager release that your configuration is
711   # compatible with. This helps avoid breakage when a new Home Manager release
712   # introduces backwards incompatible changes.
713   #
714   # You should not change this value, even if you update Home Manager. If you do
715   # want to update the value, then make sure to first check the Home Manager
716   # release notes.
717   home.stateVersion = "24.05"; # Please read the comment before changing.
718
719   # The home.packages option allows you to install Nix packages into your
720   # environment.
721   home.packages = with pkgs; [
722     nixos-icons
723     spotify-player
724     prismlauncher
725     pandoc
726     ghidra
727     gnome-firmware
728     fzf bat delta silver-searcher ripgrep perl universal-ctags
729     rofi
730     # bintools
731     htop
732     unzip
733     rr wrk
734     clang-tools bear
735     linuxPackages_latest.perf
736     texliveFull
737     emscripten
738     caddy
739     python3
740     qogir-icon-theme
741     volantes-cursors
742     xorg.xkill
743     lf nnn yazi
744     feh
745     xarchiver
746     tig lazygit gitui
747     thunderbird
748     aerc
749     libreoffice
750     gimp
751     guvcview
752     arandr
753     vial
754     ncdu
755     gnumake gcc
756     linux-wifi-hotspot
757     esptool picocom
758     wireshark
759     nil
760     bc
761     ffmpeg
762     sc-im visidata
763     localsend
764     vis
765     wineWowPackages.unstableFull winetricks
766     signal-desktop
767
768     # # It is sometimes useful to fine-tune packages, for example, by applying
769     # # overrides. You can do that directly here, just don't forget the
770     # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
771     # # fonts?
772     # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
773
774     # # You can also create simple shell scripts directly inside your
775     # # configuration. For example, this adds a command 'my-hello' to your
776     # # environment:
777     # (pkgs.writeShellScriptBin "my-hello" ''
778     #   echo "Hello, ${config.home.username}!"
779     # '')
780     # $@ - Liste aller Parameter
781     # $* - String aller Parameter
782     # $# - Anzahl aller Parameter
783     # &> - stdout und stderr pipen
784     # '' - Literal
785     # "" - Expanded
786     # 
787     (pkgs.writeShellScriptBin "app" ''
788       ${pkgs.firefox}/bin/firefox -p appmode --new-window "$@"
789     '')
790     (pkgs.writeShellScriptBin "md" ''
791       file=$(mktemp --suffix=.html) && \
792       echo $file && \
793       ${pkgs.pandoc}/bin/pandoc -o $file $1 -s -H ${markdownStyleHeader} && \
794       app $file && \
795       rm $file
796     '')
797     (pkgs.writeShellScriptBin "run" ''
798       (nohup "$@" &>/dev/null &); sleep 0
799     '')
800     (pkgs.writeShellScriptBin "popup" ''
801       ${pkgs.kitty}/bin/kitty -o hide_window_decorations=yes -o background_opacity=0.5 \
802         --class kitty-popup -o remember_window_size=no \
803         -o initial_window_width=120c -o initial_window_height=40c \
804         "$@"
805     '')
806     (pkgs.writeShellScriptBin "fzfdir" ''
807       find "$1" -name "$2" | ${pkgs.fzf}/bin/fzf --layout=reverse
808     '')
809     (pkgs.writeShellScriptBin "md-app" ''
810       #popup bash -c 'file=$(fzfdir "md" "*.md") && run md $file'
811       firefox -p appmode --new-window localhost:8123/home/ps/sync/txt/hsrm
812     '')
813     (pkgs.writeShellScriptBin "run-popup" ''
814       popup bash -c 'file=$(compgen -c | grep -v fzf | sort -u | fzf --layout=reverse --print-query | tail -n 1) && run $file'
815     '')
816     (pkgs.writeShellScriptBin "set-wallpaper" ''
817       ${pkgs.feh}/bin/feh --bg-fill --no-fehbg ${wallpaper}
818     '')
819     (pkgs.writeShellScriptBin "mirror-phone" "IP=$(select-ip) && sudo scrcpy --tcpip=$IP --no-audio -K --kill-adb-on-close")
820     (pkgs.writeShellScriptBin "select-ip" ''
821       FILE=$HOME/.cache/select-ip.txt
822       IP=$( ${pkgs.rofi}/bin/rofi -dmenu -input $FILE -p IP ) || exit 1
823       echo $IP >> $FILE
824       gawk -i inplace 'FNR==1{delete a} !a[$0]++' $FILE
825       echo $IP
826     '')
827     (pkgs.writeShellScriptBin "create-repo" ''
828       ssh psch.dev sudo -u git git init --bare /srv/git/$1
829     '')
830   ];
831
832   # Home Manager is pretty good at managing dotfiles. The primary way to manage
833   # plain files is through 'home.file'.
834   home.file = {
835     # # Building this configuration will create a copy of 'dotfiles/screenrc' in
836     # # the Nix store. Activating the configuration will then make '~/.screenrc' a
837     # # symlink to the Nix store copy.
838     # ".screenrc".source = dotfiles/screenrc;
839
840     # # You can also set the file content immediately.
841     # ".gradle/gradle.properties".text = ''
842     #   org.gradle.console=verbose
843     #   org.gradle.daemon.idletimeout=3600000
844     # '';
845   };
846
847   # Home Manager can also manage your environment variables through
848   # 'home.sessionVariables'. These will be explicitly sourced when using a
849   # shell provided by Home Manager. If you don't want to manage your shell
850   # through Home Manager then you have to manually source 'hm-session-vars.sh'
851   # located at either
852   #
853   #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
854   #
855   # or
856   #
857   #  ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
858   #
859   # or
860   #
861   #  /etc/profiles/per-user/ps/etc/profile.d/hm-session-vars.sh
862   #
863   home.sessionVariables = {
864     # EDITOR = "emacs";
865   };
866
867   # Let Home Manager install and manage itself.
868   programs.home-manager.enable = true;
869 }