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