]> gitweb.ps.run Git - flake_thinkpad/blob - home.nix
add kde plasma
[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}+b" = "split toggle; layout tabbed";
223             "${mod}+Shift+m" = "exec --no-startup-id i3-msg $(${i3-move-max})";
224             "${mod}+Shift+p" = "exec --no-startup-id ${pkgs.autorandr}/bin/autorandr --match-edid -c -f";
225           };
226     };
227     extraConfig = ''
228       # exec ${pkgs.xfce.xfce4-panel}/bin/xfce4-panel
229       for_window [window_role="pop-up"] floating enable
230       for_window [window_role="task_dialog"] floating enable
231       # for_window [workspace="0"] floating enable
232
233       for_window [class="kitty-popup"] floating enable
234       for_window [class="Xfce4-appfinder"] 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       for_window [title="Desktop — Plasma"] kill, floating enable, border none
239       for_window [title="Arbeitsfläche — Plasma"] kill, 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 gr :Telescope lsp_references<CR>
390       nnoremap gd :Telescope lsp_definitions<CR>
391       nnoremap <leader>u :UndotreeToggle<CR> :UndotreeFocus<CR>
392       nnoremap <leader>f :Telescope find_files<CR>
393       nnoremap <leader>b :Telescope buffers<CR>
394       nnoremap <leader>e :Telescope diagnostics<CR>
395       nnoremap <leader>g :Telescope live_grep<CR>
396       nnoremap <leader>s :Telescope lsp_document_symbols<CR>
397       nnoremap <leader>r :lua vim.lsp.buf.rename()<CR>
398       nnoremap <leader>n :bnext<CR>
399       nnoremap <leader>m :bprevious<CR>
400       noremap <leader>y "+y<CR>
401       noremap <leader>p "+p<CR>
402       noremap <leader><S-y> "+<S-y><CR>
403       noremap <leader><S-p> "+<S-p><CR>
404
405       " Format on save
406       " augroup FormatAutogroup
407       "   autocmd!
408       "   autocmd BufWritePost * FormatWrite
409       " augroup END
410
411       " enter insert mode when opening terminal
412       autocmd TermOpen * startinsert
413
414       "
415       autocmd BufReadPost *
416       \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit'
417       \ |   exe "normal! g`\""
418       \ | endif
419
420       " Use persistent history.
421       if !isdirectory("/tmp/.vim-undo-dir")
422           call mkdir("/tmp/.vim-undo-dir", "", 0700)
423       endif
424       set undodir=/tmp/.vim-undo-dir
425       set undofile
426     '';
427     extraLuaConfig = ''
428       vim.lsp.enable('zls')
429       vim.lsp.enable('clangd')
430       vim.lsp.config('zuban', {})
431       vim.lsp.enable('zuban')
432       require('guess-indent').setup {}
433       local util = require('formatter.util')
434       local telescope = require('telescope')
435       require('formatter').setup {
436         logging = true,
437         log_level = vim.log.levels.WARN,
438         filetype = {
439           c = { require("formatter.filetypes.c").clangformat },
440           cpp = { require("formatter.filetypes.cpp").clangformat },
441           zig = { require("formatter.filetypes.zig").zigfmt },
442         }
443       }
444       require('blink.cmp').setup {
445         keymap = {
446           preset = 'none',
447           
448           ['<C-space>'] = { 'show', 'show_documentation', 'hide_documentation' },
449           ['<C-e>'] = { 'hide', 'fallback' },
450           ['<CR>'] = { 'accept', 'fallback' },
451
452           ['<Tab>'] = { 'select_next', 'fallback_to_mappings' },
453           ['<S-Tab>'] = { 'select_prev', 'fallback_to_mappings' },
454
455           ['<C-p>'] = { 'scroll_documentation_up', 'fallback' },
456           ['<C-n'] = { 'scroll_documentation_down', 'fallback' },
457
458           ['<C-k>'] = { 'show_signature', 'hide_signature', 'fallback' },
459         },
460         completion = {
461           list = { selection = { preselect = false, } },
462           documentation = {
463             auto_show = true,
464             -- treesitter_highlighting = false,
465           },
466         },
467         signature = { enabled = true },
468       }
469     '';
470   };
471
472
473   home.file.".config/vis/plugins/vis-lspc" = {
474     source = builtins.fetchGit {
475       url = "https://gitlab.com/muhq/vis-lspc.git";
476       rev = "e184eb6c971abfcd0dc7f836f402aae6c33a8d13";
477     };
478     recursive = true;
479   };
480   home.file.".config/vis/plugins/vis-commentary" = {
481     source = builtins.fetchGit {
482       url = "https://github.com/lutobler/vis-commentary.git";
483       rev = "0e06ed8212c12c6651cb078b822390094b396f08";
484     };
485     recursive = true;
486   };
487   home.file.".config/vis/visrc.lua".text = ''
488       require('vis')
489       require('plugins/vis-commentary')
490       lspc = require('plugins/vis-lspc')
491
492       lspc.menu_cmd = 'vis-menu'
493       lspc.fallback_dirname_as_root = true
494       lspc.ls_map.zig = {name='zls',cmd='zls',roots={'build.zig'}}
495     
496       vis.events.subscribe(vis.events.INIT, function()
497         -- Your global configuration options
498       end)
499
500       vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- luacheck: no unused args
501         -- Your per window configuration options e.g.
502         vis:command('set number on')
503         vis:command('set autoindent')
504         vis:command('set tabwidth 4')
505         vis:command('set expandtab on')
506       end)
507     '';
508
509   programs.emacs = {
510     enable = true;
511     extraConfig = ''
512       (menu-bar-mode 1)
513       (tool-bar-mode 0)
514       (scroll-bar-mode 0)
515       (global-display-line-numbers-mode)
516       (setq-default
517         display-line-numbers-type 'relative
518         make-backup-files nil
519         inhibit-startup-screen t)
520       (load-theme 'tango-dark t)
521     '';
522     extraPackages = epkgs: [
523       epkgs.zig-mode
524       epkgs.lsp-mode
525     ];
526   };
527
528   programs.tmux = {
529     enable = true;
530     escapeTime = 0;
531     extraConfig = ''
532       set-option -g default-terminal screen-256color
533       set -g history-limit 10000
534       set -g base-index 1
535       set-option -g renumber-windows on
536       bind-key -n M-n new-window -c "#{pane_current_path}"
537       bind-key -n M-1 select-window -t :1
538       bind-key -n M-2 select-window -t :2
539       bind-key -n M-3 select-window -t :3
540       bind-key -n M-4 select-window -t :4
541       bind-key -n M-5 select-window -t :5
542       bind-key -n M-6 select-window -t :6
543       bind-key -n M-7 select-window -t :7
544       bind-key -n M-8 select-window -t :8
545       bind-key -n M-9 select-window -t :9
546       bind-key -n M-0 select-window -t :0
547       bind-key -n M-. select-window -n
548       bind-key -n M-, select-window -p
549       bind-key -n M-S-. swap-window -t +1
550       bind-key -n M-S-, swap-window -t -1
551       bind-key -n M-X confirm-before "kill-window"
552       bind-key -n M-v split-window -h -c "#{pane_current_path}"
553       bind-key -n M-b split-window -v -c "#{pane_current_path}"
554       bind-key -n M-R command-prompt -I "" "rename-window '%%'"
555       bind-key -n M-f resize-pane -Z
556       bind-key -n M-h select-pane -L
557       bind-key -n M-l select-pane -R
558       bind-key -n M-k select-pane -U
559       bind-key -n M-j select-pane -D
560       bind-key -n M-Left select-pane -L
561       bind-key -n M-Right select-pane -R
562       bind-key -n M-Up select-pane -U
563       bind-key -n M-Down select-pane -D
564       bind-key -n "M-H" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old'
565       bind-key -n "M-J" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old'
566       bind-key -n "M-K" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old'
567       bind-key -n "M-L" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old'
568       bind-key -n "M-S-Left" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -L; tmux swap-pane -t $old'
569       bind-key -n "M-S-Down" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -D; tmux swap-pane -t $old'
570       bind-key -n "M-S-Up" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -U; tmux swap-pane -t $old'
571       bind-key -n "M-S-Right" run-shell 'old=`tmux display -p "#{pane_index}"`; tmux select-pane -R; tmux swap-pane -t $old'
572       bind-key -n M-x confirm-before "kill-pane"
573       bind-key -n M-/ copy-mode
574
575       # Linux system clipboard
576       bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"
577       bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel "xclip -in -selection clipboard"
578
579       set -g mouse on
580       # set-option -g status-keys vi
581       # set-option -g set-titles on
582       # set-option -g set-titles-string 'tmux - #W'
583       # set -g bell-action any
584       # set-option -g visual-bell off
585       # set-option -g set-clipboard off
586       # setw -g mode-keys vi
587       # setw -g monitor-activity on
588       # set -g visual-activity on
589       # set -g status-style fg=colour15
590       # set -g status-justify centre
591       # set -g status-left ""
592       # set -g status-right ""
593       # set -g status-interval 1
594       # set -g message-style fg=colour0,bg=colour3
595       # setw -g window-status-bell-style fg=colour1
596       # setw -g window-status-current-style fg=yellow,bold
597       # setw -g window-status-style fg=colour250
598       # setw -g window-status-current-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} '
599       # setw -g window-status-format ' #{?#{==:#W,#{b:SHELL}},#{b:pane_current_path},#W} '
600       # # For older tmux:
601       # #setw -g window-status-format ' #W '
602       # #setw -g window-status-current-format ' #W '
603     '';
604   };
605
606   programs.nushell = {
607     enable = true;
608     # for editing directly to config.nu 
609     extraConfig = ''
610       $env.config = {
611         show_banner: false,
612         completions: {
613           case_sensitive: false # case-sensitive completions
614           quick: true           # set to false to prevent auto-selecting completions
615           partial: true         # set to false to prevent partial filling of the prompt
616           algorithm: "fuzzy"    # prefix or fuzzy
617         }
618         hooks: {
619           command_not_found: { |cmd| (command-not-found $cmd | str trim)  }
620         }
621       } 
622     '';
623     #  shellAliases = {
624     #  vi = "hx";
625     #  vim = "hx";
626     #  nano = "hx";
627     # };
628   };  
629   # programs.carapace = {
630   #   enable = true;
631   #   enableNushellIntegration = true;
632   # };
633
634   # programs.starship = {
635   #   enable = true;
636   #   settings = {
637   #     add_newline = false;
638   #     character = { 
639   #       success_symbol = "[➜](bold green)";
640   #       error_symbol = "[➜](bold red)";
641   #     };
642   #   };
643   # };
644
645   programs.firefox = {
646     enable = true;
647     profiles = {
648       default = {
649         settings = {
650           "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
651           "browser.fullscreen.autohide" = false;
652           "browser.toolbars.bookmarks.visibility" = "never";
653           "browser.tabs.inTitlebar" = 0;
654           "browser.compactmode.show" = true;
655           "browser.uidensity" = 1;
656         };
657         userChrome = ''
658         #TabsToolbar {
659           visibility: collapse !important;
660         }
661         '';
662       };
663       appmode = {
664         id = 1;
665         settings = {
666           "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
667           "browser.fullscreen.autohide" = false;
668           "browser.toolbars.bookmarks.visibility" = "never";
669           "browser.tabs.inTitlebar" = 0;
670           "browser.compactmode.show" = true;
671           "browser.uidensity" = 1;
672         };
673         userChrome = ''
674         #TabsToolbar {
675           visibility: collapse !important;
676         }
677         #nav-bar {
678           visibility: collapse !important;
679         }
680         #navigator-toolbox {
681           border-bottom: none !important;
682         }
683         '';        
684       };
685     };
686   };
687
688   xdg.desktopEntries = {
689     whatsapp = {
690       name = "WhatsApp";
691       genericName = "Messenger";
692       exec = "app web.whatsapp.com";
693       terminal = false;
694       categories = [ "Application" ];
695       icon = pkgs.fetchurl {
696         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";
697         sha256 = "sha256-0eE3EEGnWFlpObfraTXMIqJz0Uya/h0hDsUA528qKCY=";
698       };
699     };
700     md = {
701       name = "Markdown";
702       genericName = "Documents";
703       exec = "md-app";
704       terminal = false;
705       categories = [ "Application" ];
706       icon = pkgs.fetchurl {
707         url = "https://upload.wikimedia.org/wikipedia/commons/thumb/4/48/Markdown-mark.svg/1024px-Markdown-mark.svg.png";
708         sha256 = "0v161jvmcfxp9lwd86y789430w1vpvxnnm5n2hzgr1kfh03psvb2";
709       };
710     };
711   };
712
713   gtk.enable = true;
714   gtk.theme = {
715     package = theme;
716     name = "Qogir-Dark";
717   };
718   # programs.gnome-shell.theme = {
719   #   package = theme;
720   #   name = "Qogir-Dark";
721   # };
722   # gtk.iconTheme = {
723   #   package = pkgs.vimix-icon-theme;
724   #   name = "vimix-doder-dark";
725   # };
726   home.pointerCursor = {
727     gtk.enable = true;
728     x11.enable = true;
729
730     name = "volantes_light_cursors";
731     size = 24;
732     package = pkgs.volantes-cursors;
733   };
734
735   # This value determines the Home Manager release that your configuration is
736   # compatible with. This helps avoid breakage when a new Home Manager release
737   # introduces backwards incompatible changes.
738   #
739   # You should not change this value, even if you update Home Manager. If you do
740   # want to update the value, then make sure to first check the Home Manager
741   # release notes.
742   home.stateVersion = "24.05"; # Please read the comment before changing.
743
744   # The home.packages option allows you to install Nix packages into your
745   # environment.
746   home.packages = with pkgs; [
747     nixos-icons
748     spotify-player
749     prismlauncher
750     pandoc
751     ghidra
752     gnome-firmware
753     fzf bat delta silver-searcher ripgrep perl universal-ctags
754     rofi
755     # bintools
756     htop
757     unzip
758     rr wrk
759     clang-tools bear
760     linuxPackages_latest.perf
761     texliveFull
762     asciidoctor-with-extensions
763     emscripten
764     caddy
765     python3
766     qogir-icon-theme
767     volantes-cursors
768     xorg.xkill
769     lf nnn yazi
770     feh
771     xarchiver
772     tig lazygit gitui
773     thunderbird
774     aerc
775     libreoffice
776     gimp
777     guvcview
778     arandr
779     vial
780     ncdu
781     gnumake gcc
782     linux-wifi-hotspot
783     esptool picocom
784     wireshark
785     nil
786     bc
787     ffmpeg-full
788     sc-im visidata
789     localsend
790     vis
791     wineWowPackages.unstableFull winetricks
792     signal-desktop
793
794     # # It is sometimes useful to fine-tune packages, for example, by applying
795     # # overrides. You can do that directly here, just don't forget the
796     # # parentheses. Maybe you want to install Nerd Fonts with a limited number of
797     # # fonts?
798     # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
799
800     # # You can also create simple shell scripts directly inside your
801     # # configuration. For example, this adds a command 'my-hello' to your
802     # # environment:
803     # (pkgs.writeShellScriptBin "my-hello" ''
804     #   echo "Hello, ${config.home.username}!"
805     # '')
806     # $@ - Liste aller Parameter
807     # $* - String aller Parameter
808     # $# - Anzahl aller Parameter
809     # &> - stdout und stderr pipen
810     # '' - Literal
811     # "" - Expanded
812     # 
813     (pkgs.writeShellScriptBin "app" ''
814       ${pkgs.firefox}/bin/firefox -p appmode --new-window "$@"
815     '')
816     (pkgs.writeShellScriptBin "md" ''
817       file=$(mktemp --suffix=.html) && \
818       echo $file && \
819       ${pkgs.pandoc}/bin/pandoc -o $file $1 -s -H ${markdownStyleHeader} && \
820       app $file && \
821       rm $file
822     '')
823     (pkgs.writeShellScriptBin "run" ''
824       (nohup "$@" &>/dev/null &); sleep 0
825     '')
826     (pkgs.writeShellScriptBin "popup" ''
827       ${pkgs.kitty}/bin/kitty -o hide_window_decorations=yes -o background_opacity=0.5 \
828         --class kitty-popup -o remember_window_size=no \
829         -o initial_window_width=120c -o initial_window_height=40c \
830         "$@"
831     '')
832     (pkgs.writeShellScriptBin "fzfdir" ''
833       find "$1" -name "$2" | ${pkgs.fzf}/bin/fzf --layout=reverse
834     '')
835     (pkgs.writeShellScriptBin "file-app" ''
836       app localhost:8123
837     '')
838     (pkgs.writeShellScriptBin "run-popup" ''
839       popup bash -c 'file=$(compgen -c | grep -v fzf | sort -u | fzf --layout=reverse --print-query | tail -n 1) && run $file'
840     '')
841     (pkgs.writeShellScriptBin "set-wallpaper" ''
842       ${pkgs.feh}/bin/feh --bg-fill --no-fehbg ${wallpaper}
843     '')
844     (pkgs.writeShellScriptBin "mirror-phone" "IP=$(select-ip) && sudo scrcpy --tcpip=$IP --no-audio -K --kill-adb-on-close")
845     (pkgs.writeShellScriptBin "select-ip" ''
846       FILE=$HOME/.cache/select-ip.txt
847       IP=$( ${pkgs.rofi}/bin/rofi -dmenu -input $FILE -p IP ) || exit 1
848       echo $IP >> $FILE
849       gawk -i inplace 'FNR==1{delete a} !a[$0]++' $FILE
850       echo $IP
851     '')
852     (pkgs.writeShellScriptBin "create-repo" ''
853       ssh psch.dev sudo -u git git init --bare /srv/git/$1
854     '')
855   ];
856
857   # Home Manager is pretty good at managing dotfiles. The primary way to manage
858   # plain files is through 'home.file'.
859   home.file = {
860     # # Building this configuration will create a copy of 'dotfiles/screenrc' in
861     # # the Nix store. Activating the configuration will then make '~/.screenrc' a
862     # # symlink to the Nix store copy.
863     # ".screenrc".source = dotfiles/screenrc;
864
865     # # You can also set the file content immediately.
866     # ".gradle/gradle.properties".text = ''
867     #   org.gradle.console=verbose
868     #   org.gradle.daemon.idletimeout=3600000
869     # '';
870   };
871
872   # Home Manager can also manage your environment variables through
873   # 'home.sessionVariables'. These will be explicitly sourced when using a
874   # shell provided by Home Manager. If you don't want to manage your shell
875   # through Home Manager then you have to manually source 'hm-session-vars.sh'
876   # located at either
877   #
878   #  ~/.nix-profile/etc/profile.d/hm-session-vars.sh
879   #
880   # or
881   #
882   #  ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
883   #
884   # or
885   #
886   #  /etc/profiles/per-user/ps/etc/profile.d/hm-session-vars.sh
887   #
888   home.sessionVariables = {
889     # EDITOR = "emacs";
890   };
891
892   # Let Home Manager install and manage itself.
893   programs.home-manager.enable = true;
894 }