From 3f600ab07dbad3b6dd7655587ddea158b19aea71 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 26 Aug 2023 23:42:21 +0200 Subject: Refactor(treewide): Abbreviate path names --- .gitattributes | 8 +- flake.nix | 2 +- flake/default.nix | 2 +- flake/packages/default.nix | 2 +- hm/default.nix | 60 ++ hm/soispha/conf/alacritty/alacritty.yml | 1003 ++++++++++++++++++++ hm/soispha/conf/alacritty/default.nix | 6 + hm/soispha/conf/btop/default.nix | 5 + hm/soispha/conf/dconf/default.nix | 9 + hm/soispha/conf/default.nix | 38 + hm/soispha/conf/direnv/default.nix | 6 + .../conf/firefox/config/bookmarks/default.nix | 26 + .../conf/firefox/config/chrome/userChrome.css | 41 + .../conf/firefox/config/extensions/extensions.json | 51 + hm/soispha/conf/firefox/config/prefs/default.nix | 23 + hm/soispha/conf/firefox/config/prefs/override.js | 191 ++++ .../conf/firefox/config/search/engines/default.nix | 59 ++ hm/soispha/conf/firefox/default.nix | 71 ++ .../conf/firefox/functions/bookmarks/default.nix | 49 + .../conf/firefox/functions/extensions/default.nix | 25 + .../firefox/functions/extensions/video-pauser.nix | 30 + hm/soispha/conf/firefox/scripts/unzip_mozlz4.py | 43 + hm/soispha/conf/firefox/scripts/update_extensions | 22 + hm/soispha/conf/gammastep/default.nix | 29 + hm/soispha/conf/git/default.nix | 90 ++ hm/soispha/conf/git/git_ignore.git | 4 + hm/soispha/conf/git/git_template.git | 66 ++ hm/soispha/conf/gpg/agent-program | 2 + hm/soispha/conf/gpg/default.nix | 65 ++ hm/soispha/conf/gpg/keys/key_1 | Bin 0 -> 754 bytes hm/soispha/conf/gpg/keys/key_2 | Bin 0 -> 717 bytes hm/soispha/conf/gpg/keys/key_3 | Bin 0 -> 51304 bytes hm/soispha/conf/grades/config.yaml | 68 ++ hm/soispha/conf/grades/default.nix | 3 + hm/soispha/conf/gtk/default.nix | 58 ++ hm/soispha/conf/himalaya/default.nix | 8 + hm/soispha/conf/iamb/config.json | 9 + hm/soispha/conf/iamb/default.nix | 3 + hm/soispha/conf/keepassxc/default.nix | 7 + hm/soispha/conf/keepassxc/keepassxc.ini | 58 ++ hm/soispha/conf/latexindent/default.nix | 8 + hm/soispha/conf/latexindent/indentconfig.yaml | 2 + hm/soispha/conf/latexindent/mysettings.yaml | 672 +++++++++++++ hm/soispha/conf/less/default.nix | 15 + hm/soispha/conf/lf/colors | 190 ++++ hm/soispha/conf/lf/commands/default.nix | 241 +++++ hm/soispha/conf/lf/commands/scripts/archive | 54 ++ hm/soispha/conf/lf/commands/scripts/broot_jump | 16 + hm/soispha/conf/lf/commands/scripts/chmod | 13 + hm/soispha/conf/lf/commands/scripts/clear_trash | 8 + hm/soispha/conf/lf/commands/scripts/dl_file | 33 + hm/soispha/conf/lf/commands/scripts/dragon | 11 + .../conf/lf/commands/scripts/dragon_individual | 11 + hm/soispha/conf/lf/commands/scripts/dragon_stay | 11 + hm/soispha/conf/lf/commands/scripts/fzf_jump | 16 + .../conf/lf/commands/scripts/go_project_root | 13 + hm/soispha/conf/lf/commands/scripts/mk_dir | 24 + hm/soispha/conf/lf/commands/scripts/mk_file | 24 + .../conf/lf/commands/scripts/mk_file_and_edit | 25 + hm/soispha/conf/lf/commands/scripts/mk_ln | 36 + hm/soispha/conf/lf/commands/scripts/mk_scr_default | 31 + hm/soispha/conf/lf/commands/scripts/mk_scr_temp | 31 + hm/soispha/conf/lf/commands/scripts/open | 11 + hm/soispha/conf/lf/commands/scripts/open_config | 7 + hm/soispha/conf/lf/commands/scripts/restore_trash | 7 + hm/soispha/conf/lf/commands/scripts/set_wall_paper | 10 + hm/soispha/conf/lf/commands/scripts/stripspace | 31 + hm/soispha/conf/lf/commands/scripts/trash | 26 + hm/soispha/conf/lf/commands/scripts/unarchive | 22 + hm/soispha/conf/lf/default.nix | 53 ++ hm/soispha/conf/lf/icons | 357 +++++++ hm/soispha/conf/lf/keybindings/default.nix | 127 +++ hm/soispha/conf/mail/default.nix | 64 ++ hm/soispha/conf/mail/non_public_accounts.nix | Bin 0 -> 1002 bytes hm/soispha/conf/mako/default.nix | 44 + hm/soispha/conf/mbsync/default.nix | 17 + hm/soispha/conf/mpd/default.nix | 39 + hm/soispha/conf/mpd/mpdconf.example | 418 ++++++++ hm/soispha/conf/mpv/default.nix | 10 + hm/soispha/conf/mumble/Mumble.conf | 67 ++ hm/soispha/conf/mumble/default.nix | 3 + hm/soispha/conf/neomutt/default.nix | 168 ++++ hm/soispha/conf/nheko/default.nix | 13 + hm/soispha/conf/npm/.npmrc | 6 + hm/soispha/conf/npm/default.nix | 7 + hm/soispha/conf/nvim/autocmds/default.nix | 99 ++ hm/soispha/conf/nvim/clipboard/default.nix | 7 + hm/soispha/conf/nvim/default.nix | 48 + hm/soispha/conf/nvim/files/default.nix | 17 + hm/soispha/conf/nvim/files/ftplugin/tex.lua | 78 ++ hm/soispha/conf/nvim/mappings/default.nix | 222 +++++ hm/soispha/conf/nvim/options/default.nix | 105 ++ .../conf/nvim/plugins/colorscheme/default.nix | 17 + .../plugins/colorscheme/lua/mk_todos_readable.lua | 5 + .../conf/nvim/plugins/colorscheme/lua/nightfox.lua | 44 + hm/soispha/conf/nvim/plugins/default.nix | 23 + hm/soispha/conf/nvim/plugins/femaco/default.nix | 24 + hm/soispha/conf/nvim/plugins/femaco/lua/femaco.lua | 49 + .../conf/nvim/plugins/goto-preview/default.nix | 42 + .../nvim/plugins/goto-preview/lua/goto-preview.lua | 21 + hm/soispha/conf/nvim/plugins/harpoon/default.nix | 95 ++ hm/soispha/conf/nvim/plugins/leap/default.nix | 58 ++ hm/soispha/conf/nvim/plugins/lf-nvim/default.nix | 18 + .../conf/nvim/plugins/lf-nvim/lua/lf-nvim.lua | 43 + .../nvim/plugins/lsp-progress-nvim/default.nix | 50 + .../lsp-progress-nvim/lua/lsp-progress-nvim.lua | 150 +++ hm/soispha/conf/nvim/plugins/lsp/default.nix | 29 + .../conf/nvim/plugins/lsp/keymaps/default.nix | 72 ++ .../conf/nvim/plugins/lsp/servers/default.nix | 11 + .../nvim/plugins/lsp/servers/servers/bashls.nix | 5 + .../conf/nvim/plugins/lsp/servers/servers/ccls.nix | 5 + .../conf/nvim/plugins/lsp/servers/servers/ltex.nix | 39 + .../nvim/plugins/lsp/servers/servers/lua-ls.nix | 8 + .../nvim/plugins/lsp/servers/servers/nil_ls.nix | 10 + .../plugins/lsp/servers/servers/rust-analyzer.nix | 10 + .../nvim/plugins/lsp/servers/servers/texlab.nix | 7 + hm/soispha/conf/nvim/plugins/lspkind/default.nix | 6 + hm/soispha/conf/nvim/plugins/lualine/default.nix | 114 +++ hm/soispha/conf/nvim/plugins/luasnip/default.nix | 12 + .../conf/nvim/plugins/luasnip/lua/luasnip.lua | 7 + .../conf/nvim/plugins/luasnip/lua/snippets/all.lua | 60 ++ .../plugins/luasnip/lua/snippets/html/html.lua | 108 +++ .../plugins/luasnip/lua/snippets/tex/delimiter.lua | 34 + .../plugins/luasnip/lua/snippets/tex/greek.lua | 37 + hm/soispha/conf/nvim/plugins/nvim-cmp/default.nix | 47 + hm/soispha/conf/nvim/plugins/nvim-lint/default.nix | 15 + .../conf/nvim/plugins/nvim-lint/lua/nvim-lint.lua | 20 + .../conf/nvim/plugins/raw_plugins/default.nix | 11 + hm/soispha/conf/nvim/plugins/telescope/default.nix | 10 + .../nvim/plugins/telescope/defaults/default.nix | 30 + .../telescope/extensions/bibtex/default.nix | 13 + .../nvim/plugins/telescope/extensions/default.nix | 9 + .../telescope/extensions/frecency/default.nix | 22 + .../telescope/extensions/fzy-native/default.nix | 5 + .../telescope/extensions/rooter/default.nix | 7 + .../telescope/extensions/rooter/lua/rooter.lua | 84 ++ .../telescope/extensions/symbols/default.nix | 51 + .../nvim/plugins/telescope/keymaps/default.nix | 8 + .../conf/nvim/plugins/todo-comments/default.nix | 49 + .../conf/nvim/plugins/treesitter/default.nix | 40 + hm/soispha/conf/nvim/plugins/vim-tex/default.nix | 59 ++ hm/soispha/conf/nvim/plugins/which-key/default.nix | 5 + hm/soispha/conf/python/default.nix | 7 + hm/soispha/conf/python/pythonrc | 11 + hm/soispha/conf/rclone/default.nix | 7 + hm/soispha/conf/rclone/rclone.conf | 10 + hm/soispha/conf/ssh/default.nix | 15 + hm/soispha/conf/swayidle/config | 5 + hm/soispha/conf/swayidle/default.nix | 29 + hm/soispha/conf/swaylock/commands.jpg | Bin 0 -> 629695 bytes hm/soispha/conf/swaylock/default.nix | 10 + hm/soispha/conf/swaylock/gnu.png | Bin 0 -> 327518 bytes hm/soispha/conf/tridactyl/config.vim | 47 + hm/soispha/conf/tridactyl/default.nix | 3 + hm/soispha/conf/yambar/config/config.yml | 234 +++++ hm/soispha/conf/yambar/config/laptop.yml | 234 +++++ hm/soispha/conf/yambar/default.nix | 53 ++ hm/soispha/conf/yambar/scripts/disk | 22 + hm/soispha/conf/yambar/scripts/grades-average | 15 + hm/soispha/conf/yambar/scripts/network | 47 + hm/soispha/conf/yambar/scripts/old/amixer-monitor | 24 + hm/soispha/conf/yambar/scripts/old/cpu | 126 +++ hm/soispha/conf/yambar/scripts/old/dfspace | 23 + hm/soispha/conf/yambar/scripts/old/grades-average | 12 + hm/soispha/conf/yambar/scripts/old/meminfo | 37 + hm/soispha/conf/yambar/scripts/old/nmclitest | 23 + hm/soispha/conf/yambar/scripts/old/pingtest | 28 + hm/soispha/conf/yambar/scripts/old/yambar-tray | 27 + .../conf/yambar/scripts/old/yambar-tray-width | 28 + hm/soispha/conf/yambar/scripts/sound-volume | 20 + hm/soispha/conf/zsh/config/custom_cursor.sh | 40 + hm/soispha/conf/zsh/config/zsh-init.sh | 39 + hm/soispha/conf/zsh/config/zsh-prompt.sh | 63 ++ hm/soispha/conf/zsh/default.nix | 139 +++ hm/soispha/default.nix | 61 ++ hm/soispha/files/default.nix | 5 + hm/soispha/files/wallpaper/abstract-nord.png | Bin 0 -> 140219 bytes hm/soispha/files/wallpaper/default.nix | 8 + hm/soispha/impermanence/default.nix | 31 + hm/soispha/pkgs/default.nix | 164 ++++ hm/soispha/pkgs/scripts.nix | 97 ++ hm/soispha/pkgs/scripts/apps/aumo | 54 ++ hm/soispha/pkgs/scripts/apps/con2pdf | 152 +++ hm/soispha/pkgs/scripts/small_functions/dldragon | 28 + hm/soispha/pkgs/scripts/small_functions/gtk-themes | 21 + hm/soispha/pkgs/scripts/small_functions/mocs | 15 + .../pkgs/scripts/small_functions/screen_shot | 10 + hm/soispha/pkgs/scripts/small_functions/update-sys | 78 ++ hm/soispha/pkgs/scripts/wrappers/backsnap | 3 + hm/soispha/pkgs/scripts/wrappers/ll | 14 + hm/soispha/pkgs/scripts/wrappers/llp | 19 + hm/soispha/pkgs/scripts/wrappers/spodi | 45 + hm/soispha/pkgs/scripts/wrappers/virsh-del | 10 + hm/soispha/pkgs/scripts/wrappers/yti | 36 + hm/soispha/wms/default.nix | 7 + hm/soispha/wms/plasma/default.nix | 5 + hm/soispha/wms/river/default.nix | 68 ++ hm/soispha/wms/river/init | 80 ++ hm/soispha/wms/river/res/keys.ron | 57 ++ hm/soispha/wms/river/res/moonlander.ron | 64 ++ hm/soispha/wms/river/res/safe_init | 160 ++++ hm/soispha/wms/sway/default.nix | 16 + home-manager/default.nix | 60 -- .../soispha/config/alacritty/alacritty.yml | 1003 -------------------- home-manager/soispha/config/alacritty/default.nix | 6 - home-manager/soispha/config/btop/default.nix | 5 - home-manager/soispha/config/dconf/default.nix | 9 - home-manager/soispha/config/default.nix | 38 - home-manager/soispha/config/direnv/default.nix | 6 - .../config/firefox/config/bookmarks/default.nix | 26 - .../config/firefox/config/chrome/userChrome.css | 41 - .../firefox/config/extensions/extensions.json | 51 - .../config/firefox/config/prefs/default.nix | 23 - .../config/firefox/config/prefs/override.js | 191 ---- .../firefox/config/search/engines/default.nix | 59 -- home-manager/soispha/config/firefox/default.nix | 71 -- .../config/firefox/functions/bookmarks/default.nix | 49 - .../firefox/functions/extensions/default.nix | 25 - .../firefox/functions/extensions/video-pauser.nix | 30 - .../soispha/config/firefox/scripts/unzip_mozlz4.py | 43 - .../config/firefox/scripts/update_extensions | 22 - home-manager/soispha/config/gammastep/default.nix | 29 - home-manager/soispha/config/git/default.nix | 90 -- home-manager/soispha/config/git/git_ignore.git | 4 - home-manager/soispha/config/git/git_template.git | 66 -- home-manager/soispha/config/gpg/agent-program | 2 - home-manager/soispha/config/gpg/default.nix | 65 -- home-manager/soispha/config/gpg/keys/key_1 | Bin 754 -> 0 bytes home-manager/soispha/config/gpg/keys/key_2 | Bin 717 -> 0 bytes home-manager/soispha/config/gpg/keys/key_3 | Bin 51304 -> 0 bytes home-manager/soispha/config/grades/config.yaml | 68 -- home-manager/soispha/config/grades/default.nix | 3 - home-manager/soispha/config/gtk/default.nix | 58 -- home-manager/soispha/config/himalaya/default.nix | 8 - home-manager/soispha/config/iamb/config.json | 9 - home-manager/soispha/config/iamb/default.nix | 3 - home-manager/soispha/config/keepassxc/default.nix | 7 - .../soispha/config/keepassxc/keepassxc.ini | 58 -- .../soispha/config/latexindent/default.nix | 8 - .../soispha/config/latexindent/indentconfig.yaml | 2 - .../soispha/config/latexindent/mysettings.yaml | 672 ------------- home-manager/soispha/config/less/default.nix | 15 - home-manager/soispha/config/lf/colors | 190 ---- .../soispha/config/lf/commands/default.nix | 241 ----- .../soispha/config/lf/commands/scripts/archive | 54 -- .../soispha/config/lf/commands/scripts/broot_jump | 16 - .../soispha/config/lf/commands/scripts/chmod | 13 - .../soispha/config/lf/commands/scripts/clear_trash | 8 - .../soispha/config/lf/commands/scripts/dl_file | 33 - .../soispha/config/lf/commands/scripts/dragon | 11 - .../config/lf/commands/scripts/dragon_individual | 11 - .../soispha/config/lf/commands/scripts/dragon_stay | 11 - .../soispha/config/lf/commands/scripts/fzf_jump | 16 - .../config/lf/commands/scripts/go_project_root | 13 - .../soispha/config/lf/commands/scripts/mk_dir | 24 - .../soispha/config/lf/commands/scripts/mk_file | 24 - .../config/lf/commands/scripts/mk_file_and_edit | 25 - .../soispha/config/lf/commands/scripts/mk_ln | 36 - .../config/lf/commands/scripts/mk_scr_default | 31 - .../soispha/config/lf/commands/scripts/mk_scr_temp | 31 - .../soispha/config/lf/commands/scripts/open | 11 - .../soispha/config/lf/commands/scripts/open_config | 7 - .../config/lf/commands/scripts/restore_trash | 7 - .../config/lf/commands/scripts/set_wall_paper | 10 - .../soispha/config/lf/commands/scripts/stripspace | 31 - .../soispha/config/lf/commands/scripts/trash | 26 - .../soispha/config/lf/commands/scripts/unarchive | 22 - home-manager/soispha/config/lf/default.nix | 53 -- home-manager/soispha/config/lf/icons | 357 ------- .../soispha/config/lf/keybindings/default.nix | 127 --- home-manager/soispha/config/mail/default.nix | 64 -- .../soispha/config/mail/non_public_accounts.nix | Bin 1002 -> 0 bytes home-manager/soispha/config/mako/default.nix | 44 - home-manager/soispha/config/mbsync/default.nix | 17 - home-manager/soispha/config/mpd/default.nix | 39 - home-manager/soispha/config/mpd/mpdconf.example | 418 -------- home-manager/soispha/config/mpv/default.nix | 10 - home-manager/soispha/config/mumble/Mumble.conf | 67 -- home-manager/soispha/config/mumble/default.nix | 3 - home-manager/soispha/config/neomutt/default.nix | 168 ---- home-manager/soispha/config/neovim/default.nix | 5 - .../config/neovim/nixvim/autocmds/default.nix | 99 -- .../config/neovim/nixvim/clipboard/default.nix | 7 - .../soispha/config/neovim/nixvim/default.nix | 48 - .../soispha/config/neovim/nixvim/files/default.nix | 17 - .../config/neovim/nixvim/files/ftplugin/tex.lua | 78 -- .../config/neovim/nixvim/mappings/default.nix | 222 ----- .../config/neovim/nixvim/options/default.nix | 105 -- .../neovim/nixvim/plugins/colorscheme/default.nix | 17 - .../plugins/colorscheme/lua/mk_todos_readable.lua | 5 - .../nixvim/plugins/colorscheme/lua/nightfox.lua | 44 - .../config/neovim/nixvim/plugins/default.nix | 23 - .../neovim/nixvim/plugins/femaco/default.nix | 24 - .../neovim/nixvim/plugins/femaco/lua/femaco.lua | 49 - .../neovim/nixvim/plugins/goto-preview/default.nix | 42 - .../plugins/goto-preview/lua/goto-preview.lua | 21 - .../neovim/nixvim/plugins/harpoon/default.nix | 95 -- .../config/neovim/nixvim/plugins/leap/default.nix | 58 -- .../neovim/nixvim/plugins/lf-nvim/default.nix | 18 - .../neovim/nixvim/plugins/lf-nvim/lua/lf-nvim.lua | 43 - .../nixvim/plugins/lsp-progress-nvim/default.nix | 50 - .../lsp-progress-nvim/lua/lsp-progress-nvim.lua | 150 --- .../config/neovim/nixvim/plugins/lsp/default.nix | 29 - .../neovim/nixvim/plugins/lsp/keymaps/default.nix | 72 -- .../neovim/nixvim/plugins/lsp/servers/default.nix | 11 - .../nixvim/plugins/lsp/servers/servers/bashls.nix | 5 - .../nixvim/plugins/lsp/servers/servers/ccls.nix | 5 - .../nixvim/plugins/lsp/servers/servers/ltex.nix | 39 - .../nixvim/plugins/lsp/servers/servers/lua-ls.nix | 8 - .../nixvim/plugins/lsp/servers/servers/nil_ls.nix | 10 - .../plugins/lsp/servers/servers/rust-analyzer.nix | 10 - .../nixvim/plugins/lsp/servers/servers/texlab.nix | 7 - .../neovim/nixvim/plugins/lspkind/default.nix | 6 - .../neovim/nixvim/plugins/lualine/default.nix | 110 --- .../neovim/nixvim/plugins/luasnip/default.nix | 12 - .../neovim/nixvim/plugins/luasnip/lua/luasnip.lua | 7 - .../nixvim/plugins/luasnip/lua/snippets/all.lua | 60 -- .../plugins/luasnip/lua/snippets/html/html.lua | 108 --- .../plugins/luasnip/lua/snippets/tex/delimiter.lua | 34 - .../plugins/luasnip/lua/snippets/tex/greek.lua | 37 - .../neovim/nixvim/plugins/nvim-cmp/default.nix | 47 - .../neovim/nixvim/plugins/nvim-lint/default.nix | 15 - .../nixvim/plugins/nvim-lint/lua/nvim-lint.lua | 20 - .../neovim/nixvim/plugins/raw_plugins/default.nix | 11 - .../neovim/nixvim/plugins/telescope/default.nix | 10 - .../nixvim/plugins/telescope/defaults/default.nix | 30 - .../telescope/extensions/bibtex/default.nix | 13 - .../plugins/telescope/extensions/default.nix | 9 - .../telescope/extensions/frecency/default.nix | 22 - .../telescope/extensions/fzy-native/default.nix | 5 - .../telescope/extensions/rooter/default.nix | 7 - .../telescope/extensions/rooter/lua/rooter.lua | 84 -- .../telescope/extensions/symbols/default.nix | 51 - .../nixvim/plugins/telescope/keymaps/default.nix | 8 - .../nixvim/plugins/todo-comments/default.nix | 49 - .../neovim/nixvim/plugins/treesitter/default.nix | 40 - .../neovim/nixvim/plugins/vim-tex/default.nix | 59 -- .../neovim/nixvim/plugins/which-key/default.nix | 5 - home-manager/soispha/config/nheko/default.nix | 13 - home-manager/soispha/config/npm/.npmrc | 6 - home-manager/soispha/config/npm/default.nix | 7 - home-manager/soispha/config/python/default.nix | 7 - home-manager/soispha/config/python/pythonrc | 11 - home-manager/soispha/config/rclone/default.nix | 7 - home-manager/soispha/config/rclone/rclone.conf | 10 - home-manager/soispha/config/ssh/default.nix | 15 - home-manager/soispha/config/swayidle/config | 5 - home-manager/soispha/config/swayidle/default.nix | 29 - home-manager/soispha/config/swaylock/commands.jpg | Bin 629695 -> 0 bytes home-manager/soispha/config/swaylock/default.nix | 10 - home-manager/soispha/config/swaylock/gnu.png | Bin 327518 -> 0 bytes home-manager/soispha/config/tridactyl/config.vim | 47 - home-manager/soispha/config/tridactyl/default.nix | 3 - .../soispha/config/yambar/config/config.yml | 234 ----- .../soispha/config/yambar/config/laptop.yml | 234 ----- home-manager/soispha/config/yambar/default.nix | 53 -- home-manager/soispha/config/yambar/scripts/disk | 22 - .../soispha/config/yambar/scripts/grades-average | 15 - home-manager/soispha/config/yambar/scripts/network | 47 - .../config/yambar/scripts/old/amixer-monitor | 24 - home-manager/soispha/config/yambar/scripts/old/cpu | 126 --- .../soispha/config/yambar/scripts/old/dfspace | 23 - .../config/yambar/scripts/old/grades-average | 12 - .../soispha/config/yambar/scripts/old/meminfo | 37 - .../soispha/config/yambar/scripts/old/nmclitest | 23 - .../soispha/config/yambar/scripts/old/pingtest | 28 - .../soispha/config/yambar/scripts/old/yambar-tray | 27 - .../config/yambar/scripts/old/yambar-tray-width | 28 - .../soispha/config/yambar/scripts/sound-volume | 20 - .../soispha/config/zsh/config/custom_cursor.sh | 40 - home-manager/soispha/config/zsh/config/zsh-init.sh | 39 - .../soispha/config/zsh/config/zsh-prompt.sh | 63 -- home-manager/soispha/config/zsh/default.nix | 139 --- home-manager/soispha/default.nix | 61 -- home-manager/soispha/files/default.nix | 5 - .../soispha/files/wallpaper/abstract-nord.png | Bin 140219 -> 0 bytes home-manager/soispha/files/wallpaper/default.nix | 8 - home-manager/soispha/impermanence/default.nix | 31 - home-manager/soispha/packages/default.nix | 164 ---- home-manager/soispha/packages/scripts.nix | 97 -- home-manager/soispha/packages/scripts/apps/aumo | 54 -- home-manager/soispha/packages/scripts/apps/con2pdf | 152 --- .../packages/scripts/small_functions/dldragon | 28 - .../packages/scripts/small_functions/gtk-themes | 21 - .../soispha/packages/scripts/small_functions/mocs | 15 - .../packages/scripts/small_functions/screen_shot | 10 - .../packages/scripts/small_functions/update-sys | 78 -- .../soispha/packages/scripts/wrappers/backsnap | 3 - home-manager/soispha/packages/scripts/wrappers/ll | 14 - home-manager/soispha/packages/scripts/wrappers/llp | 19 - .../soispha/packages/scripts/wrappers/spodi | 45 - .../soispha/packages/scripts/wrappers/virsh-del | 10 - home-manager/soispha/packages/scripts/wrappers/yti | 36 - home-manager/soispha/wms/default.nix | 7 - home-manager/soispha/wms/plasma/default.nix | 5 - home-manager/soispha/wms/river/default.nix | 68 -- home-manager/soispha/wms/river/init | 80 -- home-manager/soispha/wms/river/res/keys.ron | 57 -- home-manager/soispha/wms/river/res/moonlander.ron | 64 -- home-manager/soispha/wms/river/res/safe_init | 160 ---- home-manager/soispha/wms/sway/default.nix | 16 - hosts/apzu/default.nix | 2 +- hosts/isimud/default.nix | 2 +- hosts/lahmu/default.nix | 2 +- hosts/mammun/default.nix | 2 +- hosts/tiamat/default.nix | 2 +- sys/boot/boot_pictures/gnu.png | Bin 0 -> 327518 bytes sys/boot/boot_pictures/gnulin_emb_1.png | Bin 0 -> 207444 bytes sys/boot/boot_pictures/gnulin_emb_2.png | Bin 0 -> 208347 bytes sys/boot/default.nix | 41 + sys/default.nix | 25 + sys/disks/default.nix | 130 +++ sys/disks/fstrim.nix | 42 + sys/disks/hibernate.nix | 45 + sys/font/default.nix | 21 + sys/hardware/default.nix | 46 + sys/impermanence/default.nix | 52 + sys/libvirtd/default.nix | 27 + sys/locale/default.nix | 36 + sys/network/default.nix | 51 + sys/nixpkgs/default.nix | 20 + sys/options/default.nix | 26 + sys/polkit/default.nix | 3 + sys/power/default.nix | 19 + sys/secrets/default.nix | 32 + sys/secrets/nheko/conf.apzu | 45 + sys/secrets/nheko/conf.isimud | 47 + sys/secrets/nheko/conf.tiamat | 45 + sys/secrets/secrets.nix | 15 + sys/secrets/serverphone/ca.key | 19 + sys/secrets/serverphone/server.key | 19 + sys/sound/default.nix | 23 + sys/svcs/backup/default.nix | 67 ++ sys/svcs/backup/snap-sync-forked | 529 +++++++++++ sys/svcs/dconf/default.nix | 10 + sys/svcs/default.nix | 17 + sys/svcs/fwupd/default.nix | 3 + sys/svcs/nix/default.nix | 39 + sys/svcs/openssh/default.nix | 15 + sys/svcs/postgresql/default.nix | 5 + sys/svcs/printing/default.nix | 26 + sys/svcs/scanning/default.nix | 12 + sys/svcs/serverphone/certificates/ca.crt | 10 + sys/svcs/serverphone/certificates/server.crt | 10 + sys/svcs/serverphone/default.nix | 49 + sys/svcs/serverphone/keys/key_1 | 1 + sys/svcs/serverphone/keys/key_2 | 1 + sys/svcs/snapper/default.nix | 41 + sys/svcs/steam/default.nix | 23 + sys/svcs/swaylock/default.nix | 4 + sys/svcs/xdg/default.nix | 11 + sys/tempfiles/default.nix | 6 + sys/users/default.nix | 44 + system/boot/boot_pictures/gnu.png | Bin 327518 -> 0 bytes system/boot/boot_pictures/gnulin_emb_1.png | Bin 207444 -> 0 bytes system/boot/boot_pictures/gnulin_emb_2.png | Bin 208347 -> 0 bytes system/boot/default.nix | 41 - system/default.nix | 25 - system/disks/default.nix | 130 --- system/disks/fstrim.nix | 42 - system/disks/hibernate.nix | 45 - system/font/default.nix | 21 - system/hardware/default.nix | 46 - system/impermanence/default.nix | 52 - system/libvirtd/default.nix | 27 - system/locale/default.nix | 36 - system/network/default.nix | 51 - system/nixpkgs/default.nix | 20 - system/options/default.nix | 26 - system/polkit/default.nix | 3 - system/power/default.nix | 19 - system/secrets/default.nix | 32 - system/secrets/nheko/conf.apzu | 45 - system/secrets/nheko/conf.isimud | 47 - system/secrets/nheko/conf.tiamat | 45 - system/secrets/secrets.nix | 15 - system/secrets/serverphone/ca.key | 19 - system/secrets/serverphone/server.key | 19 - system/services/backup/default.nix | 67 -- system/services/backup/snap-sync-forked | 529 ----------- system/services/dconf/default.nix | 10 - system/services/default.nix | 17 - system/services/fwupd/default.nix | 3 - system/services/nix/default.nix | 39 - system/services/openssh/default.nix | 15 - system/services/postgresql/default.nix | 5 - system/services/printing/default.nix | 26 - system/services/scanning/default.nix | 12 - system/services/serverphone/certificates/ca.crt | 10 - .../services/serverphone/certificates/server.crt | 10 - system/services/serverphone/default.nix | 49 - system/services/serverphone/keys/key_1 | 1 - system/services/serverphone/keys/key_2 | 1 - system/services/snapper/default.nix | 41 - system/services/steam/default.nix | 23 - system/services/swaylock/default.nix | 4 - system/services/xdg/default.nix | 11 - system/sound/default.nix | 23 - system/tempfiles/default.nix | 6 - system/users/default.nix | 44 - 500 files changed, 11944 insertions(+), 11945 deletions(-) create mode 100644 hm/default.nix create mode 100644 hm/soispha/conf/alacritty/alacritty.yml create mode 100644 hm/soispha/conf/alacritty/default.nix create mode 100644 hm/soispha/conf/btop/default.nix create mode 100644 hm/soispha/conf/dconf/default.nix create mode 100644 hm/soispha/conf/default.nix create mode 100644 hm/soispha/conf/direnv/default.nix create mode 100644 hm/soispha/conf/firefox/config/bookmarks/default.nix create mode 100644 hm/soispha/conf/firefox/config/chrome/userChrome.css create mode 100644 hm/soispha/conf/firefox/config/extensions/extensions.json create mode 100644 hm/soispha/conf/firefox/config/prefs/default.nix create mode 100644 hm/soispha/conf/firefox/config/prefs/override.js create mode 100644 hm/soispha/conf/firefox/config/search/engines/default.nix create mode 100644 hm/soispha/conf/firefox/default.nix create mode 100644 hm/soispha/conf/firefox/functions/bookmarks/default.nix create mode 100644 hm/soispha/conf/firefox/functions/extensions/default.nix create mode 100644 hm/soispha/conf/firefox/functions/extensions/video-pauser.nix create mode 100755 hm/soispha/conf/firefox/scripts/unzip_mozlz4.py create mode 100755 hm/soispha/conf/firefox/scripts/update_extensions create mode 100644 hm/soispha/conf/gammastep/default.nix create mode 100644 hm/soispha/conf/git/default.nix create mode 100644 hm/soispha/conf/git/git_ignore.git create mode 100644 hm/soispha/conf/git/git_template.git create mode 100755 hm/soispha/conf/gpg/agent-program create mode 100644 hm/soispha/conf/gpg/default.nix create mode 100644 hm/soispha/conf/gpg/keys/key_1 create mode 100644 hm/soispha/conf/gpg/keys/key_2 create mode 100644 hm/soispha/conf/gpg/keys/key_3 create mode 100644 hm/soispha/conf/grades/config.yaml create mode 100644 hm/soispha/conf/grades/default.nix create mode 100644 hm/soispha/conf/gtk/default.nix create mode 100644 hm/soispha/conf/himalaya/default.nix create mode 100644 hm/soispha/conf/iamb/config.json create mode 100644 hm/soispha/conf/iamb/default.nix create mode 100644 hm/soispha/conf/keepassxc/default.nix create mode 100644 hm/soispha/conf/keepassxc/keepassxc.ini create mode 100644 hm/soispha/conf/latexindent/default.nix create mode 100644 hm/soispha/conf/latexindent/indentconfig.yaml create mode 100644 hm/soispha/conf/latexindent/mysettings.yaml create mode 100644 hm/soispha/conf/less/default.nix create mode 100644 hm/soispha/conf/lf/colors create mode 100644 hm/soispha/conf/lf/commands/default.nix create mode 100755 hm/soispha/conf/lf/commands/scripts/archive create mode 100755 hm/soispha/conf/lf/commands/scripts/broot_jump create mode 100755 hm/soispha/conf/lf/commands/scripts/chmod create mode 100755 hm/soispha/conf/lf/commands/scripts/clear_trash create mode 100755 hm/soispha/conf/lf/commands/scripts/dl_file create mode 100755 hm/soispha/conf/lf/commands/scripts/dragon create mode 100755 hm/soispha/conf/lf/commands/scripts/dragon_individual create mode 100755 hm/soispha/conf/lf/commands/scripts/dragon_stay create mode 100755 hm/soispha/conf/lf/commands/scripts/fzf_jump create mode 100755 hm/soispha/conf/lf/commands/scripts/go_project_root create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_dir create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_file create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_file_and_edit create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_ln create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_scr_default create mode 100755 hm/soispha/conf/lf/commands/scripts/mk_scr_temp create mode 100755 hm/soispha/conf/lf/commands/scripts/open create mode 100755 hm/soispha/conf/lf/commands/scripts/open_config create mode 100755 hm/soispha/conf/lf/commands/scripts/restore_trash create mode 100755 hm/soispha/conf/lf/commands/scripts/set_wall_paper create mode 100755 hm/soispha/conf/lf/commands/scripts/stripspace create mode 100755 hm/soispha/conf/lf/commands/scripts/trash create mode 100755 hm/soispha/conf/lf/commands/scripts/unarchive create mode 100644 hm/soispha/conf/lf/default.nix create mode 100644 hm/soispha/conf/lf/icons create mode 100644 hm/soispha/conf/lf/keybindings/default.nix create mode 100644 hm/soispha/conf/mail/default.nix create mode 100644 hm/soispha/conf/mail/non_public_accounts.nix create mode 100644 hm/soispha/conf/mako/default.nix create mode 100644 hm/soispha/conf/mbsync/default.nix create mode 100644 hm/soispha/conf/mpd/default.nix create mode 100644 hm/soispha/conf/mpd/mpdconf.example create mode 100644 hm/soispha/conf/mpv/default.nix create mode 100644 hm/soispha/conf/mumble/Mumble.conf create mode 100644 hm/soispha/conf/mumble/default.nix create mode 100644 hm/soispha/conf/neomutt/default.nix create mode 100644 hm/soispha/conf/nheko/default.nix create mode 100644 hm/soispha/conf/npm/.npmrc create mode 100644 hm/soispha/conf/npm/default.nix create mode 100644 hm/soispha/conf/nvim/autocmds/default.nix create mode 100644 hm/soispha/conf/nvim/clipboard/default.nix create mode 100644 hm/soispha/conf/nvim/default.nix create mode 100644 hm/soispha/conf/nvim/files/default.nix create mode 100644 hm/soispha/conf/nvim/files/ftplugin/tex.lua create mode 100644 hm/soispha/conf/nvim/mappings/default.nix create mode 100644 hm/soispha/conf/nvim/options/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/colorscheme/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua create mode 100644 hm/soispha/conf/nvim/plugins/colorscheme/lua/nightfox.lua create mode 100644 hm/soispha/conf/nvim/plugins/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/femaco/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/femaco/lua/femaco.lua create mode 100644 hm/soispha/conf/nvim/plugins/goto-preview/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/goto-preview/lua/goto-preview.lua create mode 100644 hm/soispha/conf/nvim/plugins/harpoon/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/leap/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lf-nvim/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lf-nvim/lua/lf-nvim.lua create mode 100644 hm/soispha/conf/nvim/plugins/lsp-progress-nvim/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua create mode 100644 hm/soispha/conf/nvim/plugins/lsp/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/keymaps/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/bashls.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/ccls.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/ltex.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/lua-ls.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/nil_ls.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/rust-analyzer.nix create mode 100644 hm/soispha/conf/nvim/plugins/lsp/servers/servers/texlab.nix create mode 100644 hm/soispha/conf/nvim/plugins/lspkind/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/lualine/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/lua/luasnip.lua create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/all.lua create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/html/html.lua create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/delimiter.lua create mode 100644 hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/greek.lua create mode 100644 hm/soispha/conf/nvim/plugins/nvim-cmp/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/nvim-lint/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/nvim-lint/lua/nvim-lint.lua create mode 100644 hm/soispha/conf/nvim/plugins/raw_plugins/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua create mode 100644 hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/todo-comments/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/treesitter/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/vim-tex/default.nix create mode 100644 hm/soispha/conf/nvim/plugins/which-key/default.nix create mode 100644 hm/soispha/conf/python/default.nix create mode 100644 hm/soispha/conf/python/pythonrc create mode 100644 hm/soispha/conf/rclone/default.nix create mode 100644 hm/soispha/conf/rclone/rclone.conf create mode 100644 hm/soispha/conf/ssh/default.nix create mode 100644 hm/soispha/conf/swayidle/config create mode 100644 hm/soispha/conf/swayidle/default.nix create mode 100644 hm/soispha/conf/swaylock/commands.jpg create mode 100644 hm/soispha/conf/swaylock/default.nix create mode 100644 hm/soispha/conf/swaylock/gnu.png create mode 100644 hm/soispha/conf/tridactyl/config.vim create mode 100644 hm/soispha/conf/tridactyl/default.nix create mode 100644 hm/soispha/conf/yambar/config/config.yml create mode 100644 hm/soispha/conf/yambar/config/laptop.yml create mode 100644 hm/soispha/conf/yambar/default.nix create mode 100755 hm/soispha/conf/yambar/scripts/disk create mode 100755 hm/soispha/conf/yambar/scripts/grades-average create mode 100755 hm/soispha/conf/yambar/scripts/network create mode 100755 hm/soispha/conf/yambar/scripts/old/amixer-monitor create mode 100755 hm/soispha/conf/yambar/scripts/old/cpu create mode 100755 hm/soispha/conf/yambar/scripts/old/dfspace create mode 100755 hm/soispha/conf/yambar/scripts/old/grades-average create mode 100755 hm/soispha/conf/yambar/scripts/old/meminfo create mode 100755 hm/soispha/conf/yambar/scripts/old/nmclitest create mode 100755 hm/soispha/conf/yambar/scripts/old/pingtest create mode 100755 hm/soispha/conf/yambar/scripts/old/yambar-tray create mode 100755 hm/soispha/conf/yambar/scripts/old/yambar-tray-width create mode 100755 hm/soispha/conf/yambar/scripts/sound-volume create mode 100644 hm/soispha/conf/zsh/config/custom_cursor.sh create mode 100644 hm/soispha/conf/zsh/config/zsh-init.sh create mode 100644 hm/soispha/conf/zsh/config/zsh-prompt.sh create mode 100644 hm/soispha/conf/zsh/default.nix create mode 100644 hm/soispha/default.nix create mode 100644 hm/soispha/files/default.nix create mode 100644 hm/soispha/files/wallpaper/abstract-nord.png create mode 100644 hm/soispha/files/wallpaper/default.nix create mode 100644 hm/soispha/impermanence/default.nix create mode 100644 hm/soispha/pkgs/default.nix create mode 100644 hm/soispha/pkgs/scripts.nix create mode 100755 hm/soispha/pkgs/scripts/apps/aumo create mode 100755 hm/soispha/pkgs/scripts/apps/con2pdf create mode 100755 hm/soispha/pkgs/scripts/small_functions/dldragon create mode 100755 hm/soispha/pkgs/scripts/small_functions/gtk-themes create mode 100755 hm/soispha/pkgs/scripts/small_functions/mocs create mode 100755 hm/soispha/pkgs/scripts/small_functions/screen_shot create mode 100755 hm/soispha/pkgs/scripts/small_functions/update-sys create mode 100755 hm/soispha/pkgs/scripts/wrappers/backsnap create mode 100755 hm/soispha/pkgs/scripts/wrappers/ll create mode 100755 hm/soispha/pkgs/scripts/wrappers/llp create mode 100755 hm/soispha/pkgs/scripts/wrappers/spodi create mode 100755 hm/soispha/pkgs/scripts/wrappers/virsh-del create mode 100755 hm/soispha/pkgs/scripts/wrappers/yti create mode 100644 hm/soispha/wms/default.nix create mode 100644 hm/soispha/wms/plasma/default.nix create mode 100644 hm/soispha/wms/river/default.nix create mode 100755 hm/soispha/wms/river/init create mode 100644 hm/soispha/wms/river/res/keys.ron create mode 100644 hm/soispha/wms/river/res/moonlander.ron create mode 100755 hm/soispha/wms/river/res/safe_init create mode 100644 hm/soispha/wms/sway/default.nix delete mode 100644 home-manager/default.nix delete mode 100644 home-manager/soispha/config/alacritty/alacritty.yml delete mode 100644 home-manager/soispha/config/alacritty/default.nix delete mode 100644 home-manager/soispha/config/btop/default.nix delete mode 100644 home-manager/soispha/config/dconf/default.nix delete mode 100644 home-manager/soispha/config/default.nix delete mode 100644 home-manager/soispha/config/direnv/default.nix delete mode 100644 home-manager/soispha/config/firefox/config/bookmarks/default.nix delete mode 100644 home-manager/soispha/config/firefox/config/chrome/userChrome.css delete mode 100644 home-manager/soispha/config/firefox/config/extensions/extensions.json delete mode 100644 home-manager/soispha/config/firefox/config/prefs/default.nix delete mode 100644 home-manager/soispha/config/firefox/config/prefs/override.js delete mode 100644 home-manager/soispha/config/firefox/config/search/engines/default.nix delete mode 100644 home-manager/soispha/config/firefox/default.nix delete mode 100644 home-manager/soispha/config/firefox/functions/bookmarks/default.nix delete mode 100644 home-manager/soispha/config/firefox/functions/extensions/default.nix delete mode 100644 home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix delete mode 100755 home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py delete mode 100755 home-manager/soispha/config/firefox/scripts/update_extensions delete mode 100644 home-manager/soispha/config/gammastep/default.nix delete mode 100644 home-manager/soispha/config/git/default.nix delete mode 100644 home-manager/soispha/config/git/git_ignore.git delete mode 100644 home-manager/soispha/config/git/git_template.git delete mode 100755 home-manager/soispha/config/gpg/agent-program delete mode 100644 home-manager/soispha/config/gpg/default.nix delete mode 100644 home-manager/soispha/config/gpg/keys/key_1 delete mode 100644 home-manager/soispha/config/gpg/keys/key_2 delete mode 100644 home-manager/soispha/config/gpg/keys/key_3 delete mode 100644 home-manager/soispha/config/grades/config.yaml delete mode 100644 home-manager/soispha/config/grades/default.nix delete mode 100644 home-manager/soispha/config/gtk/default.nix delete mode 100644 home-manager/soispha/config/himalaya/default.nix delete mode 100644 home-manager/soispha/config/iamb/config.json delete mode 100644 home-manager/soispha/config/iamb/default.nix delete mode 100644 home-manager/soispha/config/keepassxc/default.nix delete mode 100644 home-manager/soispha/config/keepassxc/keepassxc.ini delete mode 100644 home-manager/soispha/config/latexindent/default.nix delete mode 100644 home-manager/soispha/config/latexindent/indentconfig.yaml delete mode 100644 home-manager/soispha/config/latexindent/mysettings.yaml delete mode 100644 home-manager/soispha/config/less/default.nix delete mode 100644 home-manager/soispha/config/lf/colors delete mode 100644 home-manager/soispha/config/lf/commands/default.nix delete mode 100755 home-manager/soispha/config/lf/commands/scripts/archive delete mode 100755 home-manager/soispha/config/lf/commands/scripts/broot_jump delete mode 100755 home-manager/soispha/config/lf/commands/scripts/chmod delete mode 100755 home-manager/soispha/config/lf/commands/scripts/clear_trash delete mode 100755 home-manager/soispha/config/lf/commands/scripts/dl_file delete mode 100755 home-manager/soispha/config/lf/commands/scripts/dragon delete mode 100755 home-manager/soispha/config/lf/commands/scripts/dragon_individual delete mode 100755 home-manager/soispha/config/lf/commands/scripts/dragon_stay delete mode 100755 home-manager/soispha/config/lf/commands/scripts/fzf_jump delete mode 100755 home-manager/soispha/config/lf/commands/scripts/go_project_root delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_dir delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_file delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_file_and_edit delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_ln delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_scr_default delete mode 100755 home-manager/soispha/config/lf/commands/scripts/mk_scr_temp delete mode 100755 home-manager/soispha/config/lf/commands/scripts/open delete mode 100755 home-manager/soispha/config/lf/commands/scripts/open_config delete mode 100755 home-manager/soispha/config/lf/commands/scripts/restore_trash delete mode 100755 home-manager/soispha/config/lf/commands/scripts/set_wall_paper delete mode 100755 home-manager/soispha/config/lf/commands/scripts/stripspace delete mode 100755 home-manager/soispha/config/lf/commands/scripts/trash delete mode 100755 home-manager/soispha/config/lf/commands/scripts/unarchive delete mode 100644 home-manager/soispha/config/lf/default.nix delete mode 100644 home-manager/soispha/config/lf/icons delete mode 100644 home-manager/soispha/config/lf/keybindings/default.nix delete mode 100644 home-manager/soispha/config/mail/default.nix delete mode 100644 home-manager/soispha/config/mail/non_public_accounts.nix delete mode 100644 home-manager/soispha/config/mako/default.nix delete mode 100644 home-manager/soispha/config/mbsync/default.nix delete mode 100644 home-manager/soispha/config/mpd/default.nix delete mode 100644 home-manager/soispha/config/mpd/mpdconf.example delete mode 100644 home-manager/soispha/config/mpv/default.nix delete mode 100644 home-manager/soispha/config/mumble/Mumble.conf delete mode 100644 home-manager/soispha/config/mumble/default.nix delete mode 100644 home-manager/soispha/config/neomutt/default.nix delete mode 100644 home-manager/soispha/config/neovim/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/autocmds/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/clipboard/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/files/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/files/ftplugin/tex.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/mappings/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/options/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/mk_todos_readable.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/nightfox.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/femaco/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/femaco/lua/femaco.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/lua/goto-preview.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/harpoon/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/leap/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/lua/lf-nvim.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/bashls.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ccls.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ltex.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/lua-ls.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/nil_ls.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/rust-analyzer.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/texlab.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lspkind/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/luasnip.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/all.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/html/html.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/delimiter.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/greek.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/nvim-cmp/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/lua/nvim-lint.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/raw_plugins/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/bibtex/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/lua/rooter.lua delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/todo-comments/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/treesitter/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/vim-tex/default.nix delete mode 100644 home-manager/soispha/config/neovim/nixvim/plugins/which-key/default.nix delete mode 100644 home-manager/soispha/config/nheko/default.nix delete mode 100644 home-manager/soispha/config/npm/.npmrc delete mode 100644 home-manager/soispha/config/npm/default.nix delete mode 100644 home-manager/soispha/config/python/default.nix delete mode 100644 home-manager/soispha/config/python/pythonrc delete mode 100644 home-manager/soispha/config/rclone/default.nix delete mode 100644 home-manager/soispha/config/rclone/rclone.conf delete mode 100644 home-manager/soispha/config/ssh/default.nix delete mode 100644 home-manager/soispha/config/swayidle/config delete mode 100644 home-manager/soispha/config/swayidle/default.nix delete mode 100644 home-manager/soispha/config/swaylock/commands.jpg delete mode 100644 home-manager/soispha/config/swaylock/default.nix delete mode 100644 home-manager/soispha/config/swaylock/gnu.png delete mode 100644 home-manager/soispha/config/tridactyl/config.vim delete mode 100644 home-manager/soispha/config/tridactyl/default.nix delete mode 100644 home-manager/soispha/config/yambar/config/config.yml delete mode 100644 home-manager/soispha/config/yambar/config/laptop.yml delete mode 100644 home-manager/soispha/config/yambar/default.nix delete mode 100755 home-manager/soispha/config/yambar/scripts/disk delete mode 100755 home-manager/soispha/config/yambar/scripts/grades-average delete mode 100755 home-manager/soispha/config/yambar/scripts/network delete mode 100755 home-manager/soispha/config/yambar/scripts/old/amixer-monitor delete mode 100755 home-manager/soispha/config/yambar/scripts/old/cpu delete mode 100755 home-manager/soispha/config/yambar/scripts/old/dfspace delete mode 100755 home-manager/soispha/config/yambar/scripts/old/grades-average delete mode 100755 home-manager/soispha/config/yambar/scripts/old/meminfo delete mode 100755 home-manager/soispha/config/yambar/scripts/old/nmclitest delete mode 100755 home-manager/soispha/config/yambar/scripts/old/pingtest delete mode 100755 home-manager/soispha/config/yambar/scripts/old/yambar-tray delete mode 100755 home-manager/soispha/config/yambar/scripts/old/yambar-tray-width delete mode 100755 home-manager/soispha/config/yambar/scripts/sound-volume delete mode 100644 home-manager/soispha/config/zsh/config/custom_cursor.sh delete mode 100644 home-manager/soispha/config/zsh/config/zsh-init.sh delete mode 100644 home-manager/soispha/config/zsh/config/zsh-prompt.sh delete mode 100644 home-manager/soispha/config/zsh/default.nix delete mode 100644 home-manager/soispha/default.nix delete mode 100644 home-manager/soispha/files/default.nix delete mode 100644 home-manager/soispha/files/wallpaper/abstract-nord.png delete mode 100644 home-manager/soispha/files/wallpaper/default.nix delete mode 100644 home-manager/soispha/impermanence/default.nix delete mode 100644 home-manager/soispha/packages/default.nix delete mode 100644 home-manager/soispha/packages/scripts.nix delete mode 100755 home-manager/soispha/packages/scripts/apps/aumo delete mode 100755 home-manager/soispha/packages/scripts/apps/con2pdf delete mode 100755 home-manager/soispha/packages/scripts/small_functions/dldragon delete mode 100755 home-manager/soispha/packages/scripts/small_functions/gtk-themes delete mode 100755 home-manager/soispha/packages/scripts/small_functions/mocs delete mode 100755 home-manager/soispha/packages/scripts/small_functions/screen_shot delete mode 100755 home-manager/soispha/packages/scripts/small_functions/update-sys delete mode 100755 home-manager/soispha/packages/scripts/wrappers/backsnap delete mode 100755 home-manager/soispha/packages/scripts/wrappers/ll delete mode 100755 home-manager/soispha/packages/scripts/wrappers/llp delete mode 100755 home-manager/soispha/packages/scripts/wrappers/spodi delete mode 100755 home-manager/soispha/packages/scripts/wrappers/virsh-del delete mode 100755 home-manager/soispha/packages/scripts/wrappers/yti delete mode 100644 home-manager/soispha/wms/default.nix delete mode 100644 home-manager/soispha/wms/plasma/default.nix delete mode 100644 home-manager/soispha/wms/river/default.nix delete mode 100755 home-manager/soispha/wms/river/init delete mode 100644 home-manager/soispha/wms/river/res/keys.ron delete mode 100644 home-manager/soispha/wms/river/res/moonlander.ron delete mode 100755 home-manager/soispha/wms/river/res/safe_init delete mode 100644 home-manager/soispha/wms/sway/default.nix create mode 100755 sys/boot/boot_pictures/gnu.png create mode 100755 sys/boot/boot_pictures/gnulin_emb_1.png create mode 100755 sys/boot/boot_pictures/gnulin_emb_2.png create mode 100644 sys/boot/default.nix create mode 100644 sys/default.nix create mode 100644 sys/disks/default.nix create mode 100644 sys/disks/fstrim.nix create mode 100644 sys/disks/hibernate.nix create mode 100644 sys/font/default.nix create mode 100644 sys/hardware/default.nix create mode 100644 sys/impermanence/default.nix create mode 100644 sys/libvirtd/default.nix create mode 100644 sys/locale/default.nix create mode 100644 sys/network/default.nix create mode 100644 sys/nixpkgs/default.nix create mode 100644 sys/options/default.nix create mode 100644 sys/polkit/default.nix create mode 100644 sys/power/default.nix create mode 100644 sys/secrets/default.nix create mode 100644 sys/secrets/nheko/conf.apzu create mode 100644 sys/secrets/nheko/conf.isimud create mode 100644 sys/secrets/nheko/conf.tiamat create mode 100644 sys/secrets/secrets.nix create mode 100644 sys/secrets/serverphone/ca.key create mode 100644 sys/secrets/serverphone/server.key create mode 100644 sys/sound/default.nix create mode 100644 sys/svcs/backup/default.nix create mode 100755 sys/svcs/backup/snap-sync-forked create mode 100644 sys/svcs/dconf/default.nix create mode 100644 sys/svcs/default.nix create mode 100644 sys/svcs/fwupd/default.nix create mode 100644 sys/svcs/nix/default.nix create mode 100644 sys/svcs/openssh/default.nix create mode 100644 sys/svcs/postgresql/default.nix create mode 100644 sys/svcs/printing/default.nix create mode 100644 sys/svcs/scanning/default.nix create mode 100644 sys/svcs/serverphone/certificates/ca.crt create mode 100644 sys/svcs/serverphone/certificates/server.crt create mode 100644 sys/svcs/serverphone/default.nix create mode 120000 sys/svcs/serverphone/keys/key_1 create mode 120000 sys/svcs/serverphone/keys/key_2 create mode 100644 sys/svcs/snapper/default.nix create mode 100644 sys/svcs/steam/default.nix create mode 100644 sys/svcs/swaylock/default.nix create mode 100644 sys/svcs/xdg/default.nix create mode 100644 sys/tempfiles/default.nix create mode 100644 sys/users/default.nix delete mode 100755 system/boot/boot_pictures/gnu.png delete mode 100755 system/boot/boot_pictures/gnulin_emb_1.png delete mode 100755 system/boot/boot_pictures/gnulin_emb_2.png delete mode 100644 system/boot/default.nix delete mode 100644 system/default.nix delete mode 100644 system/disks/default.nix delete mode 100644 system/disks/fstrim.nix delete mode 100644 system/disks/hibernate.nix delete mode 100644 system/font/default.nix delete mode 100644 system/hardware/default.nix delete mode 100644 system/impermanence/default.nix delete mode 100644 system/libvirtd/default.nix delete mode 100644 system/locale/default.nix delete mode 100644 system/network/default.nix delete mode 100644 system/nixpkgs/default.nix delete mode 100644 system/options/default.nix delete mode 100644 system/polkit/default.nix delete mode 100644 system/power/default.nix delete mode 100644 system/secrets/default.nix delete mode 100644 system/secrets/nheko/conf.apzu delete mode 100644 system/secrets/nheko/conf.isimud delete mode 100644 system/secrets/nheko/conf.tiamat delete mode 100644 system/secrets/secrets.nix delete mode 100644 system/secrets/serverphone/ca.key delete mode 100644 system/secrets/serverphone/server.key delete mode 100644 system/services/backup/default.nix delete mode 100755 system/services/backup/snap-sync-forked delete mode 100644 system/services/dconf/default.nix delete mode 100644 system/services/default.nix delete mode 100644 system/services/fwupd/default.nix delete mode 100644 system/services/nix/default.nix delete mode 100644 system/services/openssh/default.nix delete mode 100644 system/services/postgresql/default.nix delete mode 100644 system/services/printing/default.nix delete mode 100644 system/services/scanning/default.nix delete mode 100644 system/services/serverphone/certificates/ca.crt delete mode 100644 system/services/serverphone/certificates/server.crt delete mode 100644 system/services/serverphone/default.nix delete mode 120000 system/services/serverphone/keys/key_1 delete mode 120000 system/services/serverphone/keys/key_2 delete mode 100644 system/services/snapper/default.nix delete mode 100644 system/services/steam/default.nix delete mode 100644 system/services/swaylock/default.nix delete mode 100644 system/services/xdg/default.nix delete mode 100644 system/sound/default.nix delete mode 100644 system/tempfiles/default.nix delete mode 100644 system/users/default.nix diff --git a/.gitattributes b/.gitattributes index 2b1e447f..fd6b66c6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ -home-manager/soispha/config/mail/non_public_accounts.nix filter=git-crypt diff=git-crypt +hm/soispha/conf/mail/non_public_accounts.nix filter=git-crypt diff=git-crypt # gpg keys: -home-manager/soispha/config/gpg/keys/key_1 filter=git-crypt diff=git-crypt -home-manager/soispha/config/gpg/keys/key_2 filter=git-crypt diff=git-crypt -home-manager/soispha/config/gpg/keys/key_3 filter=git-crypt diff=git-crypt +hm/soispha/conf/gpg/keys/key_1 filter=git-crypt diff=git-crypt +hm/soispha/conf/gpg/keys/key_2 filter=git-crypt diff=git-crypt +hm/soispha/conf/gpg/keys/key_3 filter=git-crypt diff=git-crypt diff --git a/flake.nix b/flake.nix index 7a03be49..7bdcdd89 100644 --- a/flake.nix +++ b/flake.nix @@ -314,7 +314,7 @@ }: let sysLib = shell_library.lib.${system}; system = "x86_64-linux"; - pkgs = import nixpkgs (import ./system/nixpkgs { + pkgs = import nixpkgs (import ./sys/nixpkgs { inherit (nixpkgs) lib; inherit system; overlays = [nixNeovim.overlays.default]; diff --git a/flake/default.nix b/flake/default.nix index 63dea536..b88370c0 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -33,7 +33,7 @@ grades, flake_update, }: let - home_manager_config = import ../home-manager { + home_manager_config = import ../hm { inherit pkgs sysLib diff --git a/flake/packages/default.nix b/flake/packages/default.nix index 3f69bc89..d182b9b3 100644 --- a/flake/packages/default.nix +++ b/flake/packages/default.nix @@ -20,7 +20,7 @@ builtins.mapAttrs ( name: value: let nvim_config = - import ../../home-manager/soispha/config/neovim/nixvim/default.nix + import ../../hm/soispha/conf/nvim/default.nix args; build_args = args diff --git a/hm/default.nix b/hm/default.nix new file mode 100644 index 00000000..015cdeb2 --- /dev/null +++ b/hm/default.nix @@ -0,0 +1,60 @@ +{ + pkgs, + sysLib, + # extra information + system, + # bins + video_pause, + yambar_cpu, + yambar_memory, + lf_rename, + strip_js_comments, + river_init_lesser, + grades, + shell_library, + flake_update, + # external deps + user_js, + neovim_config, + snap-sync, + # modules + impermanence, + nixNeovim, + nixVim, +}: { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users.soispha = import ./soispha; + extraSpecialArgs = { + inherit + pkgs + sysLib + # extra information + + system + # bins + + video_pause + yambar_cpu + yambar_memory + lf_rename + strip_js_comments + river_init_lesser + grades + shell_library + flake_update + # external deps + + user_js + neovim_config + snap-sync + # modules + + impermanence + nixNeovim + nixVim + ; + }; + }; +} diff --git a/hm/soispha/conf/alacritty/alacritty.yml b/hm/soispha/conf/alacritty/alacritty.yml new file mode 100644 index 00000000..fdccac3f --- /dev/null +++ b/hm/soispha/conf/alacritty/alacritty.yml @@ -0,0 +1,1003 @@ +--- +# Configuration for Alacritty, the GPU enhanced terminal emulator. + +# Import additional configuration files +# +# Imports are loaded in order, skipping all missing files, with the importing +# file being loaded last. If a field is already present in a previous import, it +# will be replaced. +# +# All imports must either be absolute paths starting with `/`, or paths relative +# to the user's home directory starting with `~/`. +#import: +# - /path/to/alacritty.yml + +# Any items in the `env` entry below will be added as +# environment variables. Some entries may override variables +# set by alacritty itself. +env: + # TERM variable + # + # This value is used to set the `$TERM` environment variable for + # each instance of Alacritty. If it is not present, alacritty will + # check the local terminfo database and use `alacritty` if it is + # available, otherwise `xterm-256color` is used. + TERM: alacritty + +window: + # Window dimensions (changes require restart) + # + # Number of lines/columns (not pixels) in the terminal. Both lines and columns + # must be non-zero for this to take effect. The number of columns must be at + # least `2`, while using a value of `0` for columns and lines will fall back + # to the window manager's recommended size + dimensions: + columns: 0 + lines: 0 + + # Window position (changes require restart) + # + # Specified in number of pixels. + # If the position is not set, the window manager will handle the placement. + #position: + # x: 0 + # y: 0 + + # Window padding (changes require restart) + # + # Blank space added around the window in pixels. This padding is scaled + # by DPI and the specified value is always added at both opposing sides. + padding: + x: 5 + y: 5 + + # Spread additional padding evenly around the terminal content. + #dynamic_padding: false + + # Window decorations + # + # Values for `decorations`: + # - full: Borders and title bar + # - none: Neither borders nor title bar + # + # Values for `decorations` (macOS only): + # - transparent: Title bar, transparent background and title bar buttons + # - buttonless: Title bar, transparent background and no title bar buttons + decorations: none + + # Background opacity + # + # Window opacity as a floating point number from `0.0` to `1.0`. + # The value `0.0` is completely transparent and `1.0` is opaque. + opacity: 0.9 + + # Startup Mode (changes require restart) + # + # Values for `startup_mode`: + # - Windowed + # - Maximized + # - Fullscreen + # + # Values for `startup_mode` (macOS only): + # - SimpleFullscreen + startup_mode: Windowed + + # Window title + title: Alacritty + + # Allow terminal applications to change Alacritty's window title. + dynamic_title: true + + # Window class (Linux/BSD only): + class: + # Application instance name + instance: Alacritty + # General application class + general: Alacritty + + # Decorations theme variant + # + # Override the variant of the System theme/GTK theme/Wayland client side + # decorations. Commonly supported values are `Dark`, `Light`, and `None` for + # auto pick-up. Set this to `None` to use the default theme variant. + decorations_theme_variant: None + + # Resize increments + # + # Prefer resizing window by discrete steps equal to cell dimensions. + #resize_increments: false + + # Make `Option` key behave as `Alt` (macOS only): + # - OnlyLeft + # - OnlyRight + # - Both + # - None (default) + #option_as_alt: None + +scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + history: 10000 + + # Scrolling distance multiplier. + multiplier: 3 + +# Font configuration +font: + # Normal (roman) font face + normal: + # Font family + # + # Default: + # - (macOS) Menlo + # - (Linux/BSD) monospace + # - (Windows) Consolas + # family: Source Code Pro + #family: SauceCodePro Nerd Font # This is needed because of reserved font names + family: SauceCodePro Nerd Font Mono + + # The `style` can be specified to pick a specific face. + style: Regular + + # Bold font face + #bold: + # Font family + # + # If the bold family is not specified, it will fall back to the + # value specified for the normal font. + #family: Source Code Pro + + # The `style` can be specified to pick a specific face. + #style: Bold + + # Italic font face + #italic: + # Font family + # + # If the italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: Source Code Pro + + # The `style` can be specified to pick a specific face. + #style: Italic + + # Bold italic font face + #bold_italic: + # Font family + # + # If the bold italic family is not specified, it will fall back to the + # value specified for the normal font. + #family: Source Code Pro + + # The `style` can be specified to pick a specific face. + #style: Bold Italic + + # Point size + size: 12.0 + + # Offset is the extra space around each character. `offset.y` can be thought + # of as modifying the line spacing, and `offset.x` as modifying the letter + # spacing. + offset: + x: -1 + y: -1 + + # Glyph offset determines the locations of the glyphs within their cells with + # the default being at the bottom. Increasing `x` moves the glyph to the + # right, increasing `y` moves the glyph upward. + glyph_offset: + x: -1 + y: -1 + + # Use built-in font for box drawing characters. + # + # If `true`, Alacritty will use a custom built-in font for box drawing + # characters (Unicode points 2500 - 259f). + # + builtin_box_drawing: true # TODO: + +# If `true`, bold text is drawn using the bright color variants. +#draw_bold_text_with_bright_colors: true # TODO: + +# Colors (Tomorrow Night) +colors: + # Default colors + primary: + background: '#191919' + foreground: '#d8dee9' + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not + # present. If the bright foreground color is not set, or + # `draw_bold_text_with_bright_colors` is `false`, the normal foreground + # color will be used. + #dim_foreground: '#828482' + #bright_foreground: '#eaeaea' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + cursor: + text: '#191919' + cursor: '#d8dee9' + + # Vi mode cursor colors + # + # Colors for the cursor when the vi mode is active. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + vi_mode_cursor: + text: CellBackground + cursor: CellForeground + + # Search colors + # + # Colors used for the search bar and match highlighting. + search: + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + matches: + foreground: '#000000' + background: '#ffffff' + focused_match: + foreground: '#ffffff' + background: '#000000' + + # Keyboard hints + hints: + # First character in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + start: + foreground: '#1d1f21' + background: '#e9ff5e' + + # All characters after the first one in the hint label + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + end: + foreground: '#e9ff5e' + background: '#1d1f21' + + # Line indicator + # + # Color used for the indicator displaying the position in history during + # search and vi mode. + # + # By default, these will use the opposing primary color. + #line_indicator: + # foreground: None + # background: None + + # Footer bar + # + # Color used for the footer bar on the bottom, used by search regex input, + # hyperlink URI preview, etc. + # + footer_bar: + background: '#c5c8c6' + foreground: '#1d1f21' + + # Selection colors + # + # Colors which should be used to draw the selection area. + # + # Allowed values are CellForeground/CellBackground, which reference the + # affected cell, or hexadecimal colors like #ff00ff. + selection: + text: '#191919' + background: '#d8dee9' + + # Normal colors + normal: + black: '#191919' + red: '#b02626' + green: '#40a62f' + yellow: '#f2e635' + blue: '#314ad0' + magenta: '#b30ad0' + cyan: '#32d0fc' + white: '#acadb1' + + # Bright colors + bright: + black: '#36393d' + red: '#ce2727' + green: '#47c930' + yellow: '#fff138' + blue: '#2e4bea' + magenta: '#cc15ed' + cyan: '#54d9ff' + white: '#dbdbdb' + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + dim: + black: '#676f78' + red: '#b55454' + green: '#78a670' + yellow: '#faf380' + blue: '#707fd0' + magenta: '#c583d0' + cyan: '#8adaf1' + white: '#e0e3e7' + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '#ff00ff' }` + # + #indexed_colors: [] + + # Transparent cell backgrounds + # + # Whether or not `window.opacity` applies to all cell backgrounds or only to + # the default background. When set to `true` all cells will be transparent + # regardless of their background color. + #transparent_background_colors: false # TODO: + +# Bell +# +# The bell is rung every time the BEL control character is received. +#bell: + # Visual Bell Animation + # + # Animation effect for flashing the screen when the visual bell is rung. + # + # Values for `animation`: + # - Ease + # - EaseOut + # - EaseOutSine + # - EaseOutQuad + # - EaseOutCubic + # - EaseOutQuart + # - EaseOutQuint + # - EaseOutExpo + # - EaseOutCirc + # - Linear + #animation: EaseOutExpo + + # Duration of the visual bell flash in milliseconds. A `duration` of `0` will + # disable the visual bell animation. + duration: 0 + + # Visual bell animation color. + #color: '#ffffff' + + # Bell Command + # + # This program is executed whenever the bell is rung. + # + # When set to `command: None`, no command will be executed. + # + # Example: + # command: + # program: notify-send + # args: ["Hello, World!"] + # + #command: None + +selection: + # This string contains all characters that are used as separators for + # "semantic words" in Alacritty. + semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" + + # When set to `true`, selected text will be copied to the primary clipboard. + save_to_clipboard: false + +cursor: + # Cursor style + style: + # Cursor shape + # + # Values for `shape`: + # - ▇ Block + # - _ Underline + # - | Beam + shape: Beam + + # Cursor blinking state + # + # Values for `blinking`: + # - Never: Prevent the cursor from ever blinking + # - Off: Disable blinking by default + # - On: Enable blinking by default + # - Always: Force the cursor to always blink + blinking: On + + # Vi mode cursor style + # + # If the vi mode cursor style is `None` or not specified, it will fall back to + # the style of the active value of the normal cursor. + # + # See `cursor.style` for available options. + vi_mode_style: None + + # Cursor blinking interval in milliseconds. + blink_interval: 750 + + # Time after which cursor stops blinking, in seconds. + # + # Specifying '0' will disable timeout for blinking. + blink_timeout: 5 + + # If this is `true`, the cursor will be rendered as a hollow box when the + # window is not focused. + unfocused_hollow: true + + # Thickness of the cursor relative to the cell width as floating point number + # from `0.0` to `1.0`. + thickness: 0.15 + +# Live config reload (changes require restart) +live_config_reload: true + +# Shell +# +# You can set `shell.program` to the path of your favorite shell, e.g. +# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the +# shell. +# +# Default: +# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset +# - (Windows) powershell +#shell: +# program: /bin/bash +# args: +# - --login + +# Startup directory +# +# Directory the shell is started in. If this is unset, or `None`, the working +# directory of the parent process will be used. +#working_directory: None + +# Offer IPC using `alacritty msg` (unix only) +ipc_socket: true + +mouse: + # Click settings + # + # The `double_click` and `triple_click` settings control the time + # alacritty should wait for accepting multiple clicks as one double + # or triple click. + double_click: { threshold: 300 } + triple_click: { threshold: 300 } + + # If this is `true`, the cursor is temporarily hidden when typing. + hide_when_typing: false + +# Hints +# +# Terminal hints can be used to find text or hyperlink in the visible part of +# the terminal and pipe it to other applications. +hints: + # Keys used for the hint labels. + alphabet: "jfkdls;ahgurieowpq" + + # List with all available hints + # + # Each hint must have any of `regex` or `hyperlinks` field and either an + # `action` or a `command` field. The fields `mouse`, `binding` and + # `post_processing` are optional. + # + # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be + # highlighted. + # + # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and + # `mouse.mods` accept the same values as they do in the `key_bindings` section. + # + # The `mouse.enabled` field controls if the hint should be underlined while + # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. + # + # If the `post_processing` field is set to `true`, heuristics will be used to + # shorten the match if there are characters likely not to be part of the hint + # (e.g. a trailing `.`). This is most useful for URIs and applies only to + # `regex` matches. + # + # Values for `action`: + # - Copy + # Copy the hint's text to the clipboard. + # - Paste + # Paste the hint's text to the terminal or search. + # - Select + # Select the hint's text. + # - MoveViModeCursor + # Move the vi mode cursor to the beginning of the hint. + enabled: + - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + hyperlinks: true + command: xdg-open + post_processing: true + mouse: + enabled: true + mods: None + binding: + key: U + mods: Control|Shift + + - regex: "([^ '\"`=:\\[\\(]*/)([^/: '\"`\\)\\]]*)" + action: Paste + post_procesing: false + binding: + key: T + mods: Control|Shift + + - regex: "([a-z0-9]{7})\\s" + action: Paste + post_procesing: false + binding: + key: H + mods: Control|Shift + + # multi regex for different purposes: + # 2. UUIDs + # 3. hex (for example signatures) + # 4. IP addresses +# - regex: "([[:alnum:]_$%&+=/@-]+)\ +#|([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\ +#|([0-9a-f]{12,128})\ +#|([[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3})" +# action: Copy +# post_processing: false +# binding: +# key: U +# mods: Control|Shift + +# Mouse bindings +# +# Mouse bindings are specified as a list of objects, much like the key +# bindings further below. +# +# To trigger mouse bindings when an application running within Alacritty +# captures the mouse, the `Shift` modifier is automatically added as a +# requirement. +# +# Each mouse binding will specify a: +# +# - `mouse`: +# +# - Middle +# - Left +# - Right +# - Numeric identifier such as `5` +# +# - `action` (see key bindings for actions not exclusive to mouse mode) +# +# - Mouse exclusive actions: +# +# - ExpandSelection +# Expand the selection to the current mouse cursor location. +# +# And optionally: +# +# - `mods` (see key bindings) +mouse_bindings: +# - { mouse: Right, action: ExpandSelection } +# - { mouse: Right, mods: Control, action: ExpandSelection } + - { mouse: Middle, action: Copy } + +# Key bindings +# +# Key bindings are specified as a list of objects. For example, this is the +# default paste binding: +# +# `- { key: V, mods: Control|Shift, action: Paste }` +# +# Each key binding will specify a: +# +# - `key`: Identifier of the key pressed +# +# - A-Z +# - F1-F24 +# - Key0-Key9 +# +# A full list with available key codes can be found here: +# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants +# +# Instead of using the name of the keys, the `key` field also supports using +# the scancode of the desired key. Scancodes have to be specified as a +# decimal number. This command will allow you to display the hex scancodes +# for certain keys: +# +# `showkey --scancodes`. +# +# Then exactly one of: +# +# - `chars`: Send a byte sequence to the running application +# +# The `chars` field writes the specified string to the terminal. This makes +# it possible to pass escape sequences. To find escape codes for bindings +# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside +# of tmux. Note that applications use terminfo to map escape sequences back +# to keys. It is therefore required to update the terminfo when changing an +# escape sequence. +# +# - `action`: Execute a predefined action +# +# - ToggleViMode +# - SearchForward +# Start searching toward the right of the search origin. +# - SearchBackward +# Start searching toward the left of the search origin. +# - Copy +# - Paste +# - IncreaseFontSize +# - DecreaseFontSize +# - ResetFontSize +# - ScrollPageUp +# - ScrollPageDown +# - ScrollHalfPageUp +# - ScrollHalfPageDown +# - ScrollLineUp +# - ScrollLineDown +# - ScrollToTop +# - ScrollToBottom +# - ClearHistory +# Remove the terminal's scrollback history. +# - Hide +# Hide the Alacritty window. +# - Minimize +# Minimize the Alacritty window. +# - Quit +# Quit Alacritty. +# - ToggleFullscreen +# - ToggleMaximized +# - SpawnNewInstance +# Spawn a new instance of Alacritty. +# - CreateNewWindow +# Create a new Alacritty window from the current process. +# - ClearLogNotice +# Clear Alacritty's UI warning and error notice. +# - ClearSelection +# Remove the active selection. +# - ReceiveChar +# - None +# +# - Vi mode exclusive actions: +# +# - Open +# Perform the action of the first matching hint under the vi mode cursor +# with `mouse.enabled` set to `true`. +# - ToggleNormalSelection +# - ToggleLineSelection +# - ToggleBlockSelection +# - ToggleSemanticSelection +# Toggle semantic selection based on `selection.semantic_escape_chars`. +# - CenterAroundViCursor +# Center view around vi mode cursor +# +# - Vi mode exclusive cursor motion actions: +# +# - Up +# One line up. +# - Down +# One line down. +# - Left +# One character left. +# - Right +# One character right. +# - First +# First column, or beginning of the line when already at the first column. +# - Last +# Last column, or beginning of the line when already at the last column. +# - FirstOccupied +# First non-empty cell in this terminal row, or first non-empty cell of +# the line when already at the first cell of the row. +# - High +# Top of the screen. +# - Middle +# Center of the screen. +# - Low +# Bottom of the screen. +# - SemanticLeft +# Start of the previous semantically separated word. +# - SemanticRight +# Start of the next semantically separated word. +# - SemanticLeftEnd +# End of the previous semantically separated word. +# - SemanticRightEnd +# End of the next semantically separated word. +# - WordLeft +# Start of the previous whitespace separated word. +# - WordRight +# Start of the next whitespace separated word. +# - WordLeftEnd +# End of the previous whitespace separated word. +# - WordRightEnd +# End of the next whitespace separated word. +# - Bracket +# Character matching the bracket at the cursor's location. +# - SearchNext +# Beginning of the next match. +# - SearchPrevious +# Beginning of the previous match. +# - SearchStart +# Start of the match to the left of the vi mode cursor. +# - SearchEnd +# End of the match to the right of the vi mode cursor. +# +# - Search mode exclusive actions: +# - SearchFocusNext +# Move the focus to the next search match. +# - SearchFocusPrevious +# Move the focus to the previous search match. +# - SearchConfirm +# - SearchCancel +# - SearchClear +# Reset the search regex. +# - SearchDeleteWord +# Delete the last word in the search regex. +# - SearchHistoryPrevious +# Go to the previous regex in the search history. +# - SearchHistoryNext +# Go to the next regex in the search history. +# +# - macOS exclusive actions: +# - ToggleSimpleFullscreen +# Enter fullscreen without occupying another space. +# +# - Linux/BSD exclusive actions: +# +# - CopySelection +# Copy from the selection buffer. +# - PasteSelection +# Paste from the selection buffer. +# +# - `command`: Fork and execute a specified command plus arguments +# +# The `command` field must be a map containing a `program` string and an +# `args` array of command line parameter strings. For example: +# `{ program: "alacritty", args: ["-e", "vttest"] }` +# +# And optionally: +# +# - `mods`: Key modifiers to filter binding actions +# +# - Command +# - Control +# - Option +# - Super +# - Shift +# - Alt +# +# Multiple `mods` can be combined using `|` like this: +# `mods: Control|Shift`. +# Whitespace and capitalization are relevant and must match the example. +# +# - `mode`: Indicate a binding for only specific terminal reported modes +# +# This is mainly used to send applications the correct escape sequences +# when in different modes. +# +# - AppCursor +# - AppKeypad +# - Search +# - Alt +# - Vi +# +# A `~` operator can be used before a mode to apply the binding whenever +# the mode is *not* active, e.g. `~Alt`. +# +# Bindings are always filled by default, but will be replaced when a new +# binding with the same triggers is defined. To unset a default binding, it can +# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for +# a no-op if you do not wish to receive input characters for that binding. +# +# If the same trigger is assigned to multiple actions, all of them are executed +# in the order they were defined in. +key_bindings: +# +# + - { key: P, mods: Control, action: Paste } + - { key: Insert, mods: Shift, action: Paste } + - { key: Slash, mods: Control, chars: "gc" } + - { key: Y, mods: Control, action: Copy } + - { key: Key0, mods: Control, action: ResetFontSize } + - { key: Equals, mods: Control, action: IncreaseFontSize } + - { key: Plus, mods: Control, action: IncreaseFontSize } + - { key: Minus, mods: Control, action: DecreaseFontSize } + + # Vi Mode + - { key: Space, mods: Control, action: ToggleViMode } + - { key: Space, mods: Control, mode: Vi, action: ScrollToBottom } + - { key: I, mode: Vi, action: ScrollToBottom } + - { key: I, mode: Vi, action: ToggleViMode } + - { key: C, mods: Control, mode: Vi, action: ScrollToBottom } + - { key: C, mods: Control, mode: Vi, action: ToggleViMode } + - { key: Escape, mode: Vi, action: ClearSelection } + - { key: Y, mods: Control, mode: Vi, action: ScrollLineUp } + - { key: E, mods: Control, mode: Vi, action: ScrollLineDown } + - { key: G, mode: Vi, action: ScrollToTop } + - { key: G, mods: Shift, mode: Vi, action: ScrollToBottom } + - { key: B, mods: Control, mode: Vi, action: ScrollPageUp } + - { key: F, mods: Control, mode: Vi, action: ScrollPageDown } + - { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp } + - { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown } + - { key: Y, mode: Vi, action: Copy } + - { key: Y, mode: Vi, action: ClearSelection } + - { key: V, mode: Vi, action: ToggleNormalSelection } + - { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection } + - { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection } + - { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection } + - { key: Return, mode: Vi, action: Open } + - { key: K, mode: Vi, action: Up } + - { key: J, mode: Vi, action: Down } + - { key: H, mode: Vi, action: Left } + - { key: L, mode: Vi, action: Right } + - { key: Up, mode: Vi, action: Up } + - { key: Down, mode: Vi, action: Down } + - { key: Left, mode: Vi, action: Left } + - { key: Right, mode: Vi, action: Right } + - { key: Key0, mode: Vi, action: First } + - { key: Key4, mode: Vi, action: Last } + - { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied } + - { key: H, mods: Shift, mode: Vi, action: High } + - { key: M, mods: Shift, mode: Vi, action: Middle } + - { key: L, mods: Shift, mode: Vi, action: Low } + - { key: B, mode: Vi, action: SemanticLeft } + - { key: W, mode: Vi, action: SemanticRight } + - { key: E, mode: Vi, action: SemanticRightEnd } + - { key: B, mods: Shift, mode: Vi, action: WordLeft } + - { key: W, mods: Shift, mode: Vi, action: WordRight } + - { key: E, mods: Shift, mode: Vi, action: WordRightEnd } + - { key: Key5, mods: Shift, mode: Vi, action: Bracket } + - { key: Slash, mode: Vi, action: SearchForward } + - { key: Slash, mods: Shift, mode: Vi, action: SearchBackward } + - { key: N, mode: Vi, action: SearchNext } + - { key: N, mods: Shift, mode: Vi, action: SearchPrevious } +# +# +# + #- { key: Paste, action: Paste } + #- { key: Copy, action: Copy } + #- { key: L, mods: Control, action: ClearLogNotice } + #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } + #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } + #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } + #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } + + # Vi Mode + #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } + #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } + #- { key: Escape, mode: Vi|~Search, action: ClearSelection } + #- { key: I, mode: Vi|~Search, action: ToggleViMode } + #- { key: I, mode: Vi|~Search, action: ScrollToBottom } + #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } + #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } + #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } + #- { key: G, mode: Vi|~Search, action: ScrollToTop } + #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } + #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } + #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } + #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } + #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } + #- { key: Y, mode: Vi|~Search, action: Copy } + #- { key: Y, mode: Vi|~Search, action: ClearSelection } + #- { key: Copy, mode: Vi|~Search, action: ClearSelection } + #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } + #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } + #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } + #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } + #- { key: Return, mode: Vi|~Search, action: Open } + #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } + #- { key: K, mode: Vi|~Search, action: Up } + #- { key: J, mode: Vi|~Search, action: Down } + #- { key: H, mode: Vi|~Search, action: Left } + #- { key: L, mode: Vi|~Search, action: Right } + #- { key: Up, mode: Vi|~Search, action: Up } + #- { key: Down, mode: Vi|~Search, action: Down } + #- { key: Left, mode: Vi|~Search, action: Left } + #- { key: Right, mode: Vi|~Search, action: Right } + #- { key: Key0, mode: Vi|~Search, action: First } + #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } + #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } + #- { key: H, mods: Shift, mode: Vi|~Search, action: High } + #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } + #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } + #- { key: B, mode: Vi|~Search, action: SemanticLeft } + #- { key: W, mode: Vi|~Search, action: SemanticRight } + #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } + #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } + #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } + #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } + #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } + #- { key: Slash, mode: Vi|~Search, action: SearchForward } + #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } + #- { key: N, mode: Vi|~Search, action: SearchNext } + #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } + + # Search Mode + #- { key: Return, mode: Search|Vi, action: SearchConfirm } + #- { key: Escape, mode: Search, action: SearchCancel } + #- { key: C, mods: Control, mode: Search, action: SearchCancel } + #- { key: U, mods: Control, mode: Search, action: SearchClear } + #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } + #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } + #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } + #- { key: Up, mode: Search, action: SearchHistoryPrevious } + #- { key: Down, mode: Search, action: SearchHistoryNext } + #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } + #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } + + # (Windows, Linux, and BSD only) + #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } + #- { key: C, mods: Control|Shift, action: Copy } + #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } + #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } + #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } + #- { key: Insert, mods: Shift, action: PasteSelection } + #- { key: Key0, mods: Control, action: ResetFontSize } + #- { key: Equals, mods: Control, action: IncreaseFontSize } + #- { key: Plus, mods: Control, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } + #- { key: Minus, mods: Control, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } + + # (Windows only) + #- { key: Return, mods: Alt, action: ToggleFullscreen } + + # (macOS only) + #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } + #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } + #- { key: Key0, mods: Command, action: ResetFontSize } + #- { key: Equals, mods: Command, action: IncreaseFontSize } + #- { key: Plus, mods: Command, action: IncreaseFontSize } + #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } + #- { key: Minus, mods: Command, action: DecreaseFontSize } + #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } + #- { key: V, mods: Command, action: Paste } + #- { key: C, mods: Command, action: Copy } + #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } + #- { key: H, mods: Command, action: Hide } + #- { key: H, mods: Command|Alt, action: HideOtherApplications } + #- { key: M, mods: Command, action: Minimize } + #- { key: Q, mods: Command, action: Quit } + #- { key: W, mods: Command, action: Quit } + #- { key: N, mods: Command, action: CreateNewWindow } + #- { key: F, mods: Command|Control, action: ToggleFullscreen } + #- { key: F, mods: Command, mode: ~Search, action: SearchForward } + #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } + +#debug: + # Display the time it takes to redraw each frame. + #render_timer: false + + # Keep the log file after quitting Alacritty. + #persistent_logging: false + + # Log level + # + # Values for `log_level`: + # - Off + # - Error + # - Warn + # - Info + # - Debug + # - Trace + #log_level: Warn + + # Renderer override. + # - glsl3 + # - gles2 + # - gles2_pure + #renderer: None + + # Print all received window events. + #print_events: false + + # Highlight window damage information. + #highlight_damage: false diff --git a/hm/soispha/conf/alacritty/default.nix b/hm/soispha/conf/alacritty/default.nix new file mode 100644 index 00000000..4e98f502 --- /dev/null +++ b/hm/soispha/conf/alacritty/default.nix @@ -0,0 +1,6 @@ +{config, ...}: { + programs.alacritty = { + enable = true; + }; + xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml; +} diff --git a/hm/soispha/conf/btop/default.nix b/hm/soispha/conf/btop/default.nix new file mode 100644 index 00000000..06b56ea7 --- /dev/null +++ b/hm/soispha/conf/btop/default.nix @@ -0,0 +1,5 @@ +{config, ...}: { + programs.btop = { + enable = true; + }; +} diff --git a/hm/soispha/conf/dconf/default.nix b/hm/soispha/conf/dconf/default.nix new file mode 100644 index 00000000..dc439e1e --- /dev/null +++ b/hm/soispha/conf/dconf/default.nix @@ -0,0 +1,9 @@ +{...}: { + # Also see: https://github.com/gvolpe/dconf2nix + dconf.settings = { + "org/gnome/desktop/wm/preferences" = { + # hide gtk buttons in titelbar + button-layout = ""; + }; + }; +} diff --git a/hm/soispha/conf/default.nix b/hm/soispha/conf/default.nix new file mode 100644 index 00000000..01d18d4a --- /dev/null +++ b/hm/soispha/conf/default.nix @@ -0,0 +1,38 @@ +{...}: { + imports = [ + ./alacritty + ./btop + ./dconf + ./direnv + ./firefox + ./gammastep + ./git + ./gpg + ./grades + ./gtk + ./himalaya + ./iamb + ./keepassxc + ./latexindent + ./less + ./lf + ./mail + ./mako + ./mbsync + ./mpd + ./mpv + ./mumble + ./neomutt + ./nvim + ./nheko + ./npm + ./python + ./rclone + ./ssh + ./swayidle + ./swaylock + ./tridactyl + ./yambar + ./zsh + ]; +} diff --git a/hm/soispha/conf/direnv/default.nix b/hm/soispha/conf/direnv/default.nix new file mode 100644 index 00000000..3a7b8add --- /dev/null +++ b/hm/soispha/conf/direnv/default.nix @@ -0,0 +1,6 @@ +{...}: { + programs.direnv = { + enable = true; + nix-direnv.enable = true; + }; +} diff --git a/hm/soispha/conf/firefox/config/bookmarks/default.nix b/hm/soispha/conf/firefox/config/bookmarks/default.nix new file mode 100644 index 00000000..4de83ac9 --- /dev/null +++ b/hm/soispha/conf/firefox/config/bookmarks/default.nix @@ -0,0 +1,26 @@ +[ + { + name = "Feed - Piped"; + url = "https://piped.video/feed"; + } + + { + name = "DeepL Translate"; + url = "https://www.deepl.com/translator"; + } + + { + name = "HM Options"; + url = "https://mipmip.github.io/home-manager-option-search/"; + } + + { + name = "Nix lib"; + url = "https://teu5us.github.io/nix-lib.html"; + } + + { + name = "Nixpkgs manual"; + url = "https://ryantm.github.io/nixpkgs/"; + } +] diff --git a/hm/soispha/conf/firefox/config/chrome/userChrome.css b/hm/soispha/conf/firefox/config/chrome/userChrome.css new file mode 100644 index 00000000..0b3aff77 --- /dev/null +++ b/hm/soispha/conf/firefox/config/chrome/userChrome.css @@ -0,0 +1,41 @@ +/* thickness of tab when you have too many open tabs */ +.tabbrowser-tab:not([pinned="true"]) { + min-width: 10px !important; + min-height: 10px !important; +} + +/* tab height +#TabsToolbar .tabbrowser-tabs { +min-height: 10px !important; +} +*/ + +/* +.tabbrowser-tab {min-width: 016px !important;} +.tabbrowser-tab {clip-width: 016px !important;} +*/ + +/* the + button that opens new tabs */ +#TabsToolbar .tabs-newtab-button { + margin-left: 10px !important; + height: Auto !important; +} + +#main-window[privatebrowsingmode="temporary"] #navigator-toolbox { + background-color: #c40944 !important; +} + +/* close button inside a tab */ +.tab-close-button * { + width: 10px !important; + height: 10px !important; +} + +/* bookmark toolbar */ +#personal-bookmarks .bookmark-item > .toolbarbutton-text { + font-size: 10pt !important; +} +#personal-bookmarks .bookmark-item > .toolbarbutton-icon { + height: 12px !important; + width: 12px !important; +} diff --git a/hm/soispha/conf/firefox/config/extensions/extensions.json b/hm/soispha/conf/firefox/config/extensions/extensions.json new file mode 100644 index 00000000..7f32dfb1 --- /dev/null +++ b/hm/soispha/conf/firefox/config/extensions/extensions.json @@ -0,0 +1,51 @@ +{ + "darkreader": { + "addonId": "addon@darkreader.org", + "pname": "darkreader", + "sha256": "sha256:964d7fdeec1dc90b5238a82db699de7a2bbf54e3e2bf18569befff451f35f89a", + "url": "https://addons.mozilla.org/firefox/downloads/file/4151368/darkreader-4.9.65.xpi", + "version": "4.9.65" + }, + "keepassxc-browser": { + "addonId": "keepassxc-browser@keepassxc.org", + "pname": "keepassxc-browser", + "sha256": "sha256:deb1c3c29fabe90dd811536d434d64c200caab9a9f7febc3428aa170eefec5f2", + "url": "https://addons.mozilla.org/firefox/downloads/file/4134768/keepassxc_browser-1.8.7.xpi", + "version": "1.8.7" + }, + "libredirect": { + "addonId": "7esoorv3@alefvanoon.anonaddy.me", + "pname": "libredirect", + "sha256": "sha256:564e56e1ccccf2f445b6cb9485c602609589a23052d2a53ab491cbce51c6b42f", + "url": "https://addons.mozilla.org/firefox/downloads/file/4144580/libredirect-2.7.1.xpi", + "version": "2.7.1" + }, + "simple-tab-groups": { + "addonId": "simple-tab-groups@drive4ik", + "pname": "simple-tab-groups", + "sha256": "sha256:b56f30cea753a9c4d1c0e078c0e5e635f1885ea7e40305cee59b9e145fad0a6c", + "url": "https://addons.mozilla.org/firefox/downloads/file/4103800/simple_tab_groups-5.2.xpi", + "version": "5.2" + }, + "tridactyl-vim": { + "addonId": "tridactyl.vim@cmcaine.co.uk", + "pname": "tridactyl-vim", + "sha256": "sha256:08b7af97bef05300ab3ac3ad721322ff00505631233482568fc4489c16d51b71", + "url": "https://addons.mozilla.org/firefox/downloads/file/4036604/tridactyl_vim-1.23.0.xpi", + "version": "1.23.0" + }, + "ublock-origin": { + "addonId": "uBlock0@raymondhill.net", + "pname": "ublock-origin", + "sha256": "sha256:8b73468bc233a11dd2895219466381783d19123857dd0b6fd16a01820fca4834", + "url": "https://addons.mozilla.org/firefox/downloads/file/4141256/ublock_origin-1.51.0.xpi", + "version": "1.51.0" + }, + "video-pauser": { + "addonId": "video-pauser@addons.vhack.eu", + "pname": "video-pauser", + "sha256": "sha256:da02e29f1d50d3a6db8a28bb7972afaeaa788bb8d38a2e9ebbfcd73d65d84841", + "url": "https://addons.mozilla.org/firefox/downloads/file/4098103/video_pauser-0.1.0.xpi", + "version": "0.1.0" + } +} diff --git a/hm/soispha/conf/firefox/config/prefs/default.nix b/hm/soispha/conf/firefox/config/prefs/default.nix new file mode 100644 index 00000000..91bb65f0 --- /dev/null +++ b/hm/soispha/conf/firefox/config/prefs/default.nix @@ -0,0 +1,23 @@ +{ + pkgs, + config, + user_js, + lib, + ... +}: let + bookmarks = import ../bookmarks; + firefoxBookmarksFile = (import ../../functions/bookmarks) {inherit lib pkgs;}; + user_js_override = pkgs.writeText "user.override.js" (builtins.readFile ./override.js); +in + pkgs.runCommand "user.js" {} '' + mkdir $out; + cat "${user_js}/user.js" > $out/user.js; + cat "${user_js_override}" >> $out/user.js; + + cat << EOF >> $out/user.js; + // My bookmarks + user_pref("browser.bookmarks.file", "${toString (firefoxBookmarksFile bookmarks)}"); + user_pref("browser.startup.homepage", "file:///home/dt/home.html"); // 0103 // TODO: add this from a flake + user_pref("browser.download.dir", "${config.home.homeDirectory}/media/downloads"); + EOF + '' diff --git a/hm/soispha/conf/firefox/config/prefs/override.js b/hm/soispha/conf/firefox/config/prefs/override.js new file mode 100644 index 00000000..9c9b70e5 --- /dev/null +++ b/hm/soispha/conf/firefox/config/prefs/override.js @@ -0,0 +1,191 @@ +/* + 0100: STARTUP + 0200: GEOLOCATION / LANGUAGE / LOCALE + 0300: QUIETER FOX + 0400: SAFE BROWSING + 0600: BLOCK IMPLICIT OUTBOUND + 0700: DNS / DoH / PROXY / SOCKS / IPv6 + 0800: LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS + 0900: PASSWORDS + 1000: DISK AVOIDANCE + 1200: HTTPS (SSL/TLS / OCSP / CERTS / HPKP) + 1400: FONTS + 1600: HEADERS / REFERERS + 1700: CONTAINERS + 2000: PLUGINS / MEDIA / WEBRTC + 2400: DOM (DOCUMENT OBJECT MODEL) + 2600: MISCELLANEOUS + 2700: ETP (ENHANCED TRACKING PROTECTION) + 2800: SHUTDOWN & SANITIZING + 4500: RFP (RESIST FINGERPRINTING) + 5000: OPTIONAL OPSEC + 5500: OPTIONAL HARDENING + 6000: DON'T TOUCH + 7000: DON'T BOTHER + 8000: DON'T BOTHER: FINGERPRINTING + 9000: NON-PROJECT RELATED + 9999: DEPRECATED / REMOVED / LEGACY / RENAMED +*/ + + +// restore session +user_pref("browser.startup.page", 3); // 0102 + +user_pref("browser.newtabpage.enabled", true); // 0104 + +// disable the geoservice, TODO: don't know if I want this +//user_pref("geo.provider.use_geoclue", false); // 0202 + +// TODO: is this something useful? +user_pref("datareporting.policy.dataSubmissionEnabled", true); // 0330 + +// enable health reports +user_pref("datareporting.healthreport.uploadEnabled", true); // 0331 + +// Do I want to opt-out? +user_pref("toolkit.telemetry.coverage.opt-out", false); // 0333 + +// enables studies +user_pref("app.shield.optoutstudies.enabled", true); // 0340 + +// I guess that browsing protection is useful +user_pref("browser.safebrowsing.downloads.remote.enabled", true); // 0403 + +// TODO: does this (-> set to false) make things slower? +user_pref("network.prefetch-next", true); // 0601 + +// enable ipv6 because the rest of the system uses it +user_pref("network.dns.disableIPv6", false); // 0701 + +// TRR only +user_pref("network.trr.mode", 3); // 0710 + +// I trust my search engine +user_pref("keyword.enabled", true); // 801 +user_pref("browser.search.suggest.enabled", true); // 0804 +user_pref("browser.urlbar.suggest.searches", true); // 0804 +// TODO: no idea what this does, enabling it +user_pref("browser.urlbar.showSearchTerms.enabled", true); // 9004 + +// prefetch urls, if the get auto completed +user_pref("browser.urlbar.speculativeConnect.enabled", true); // 0805 + +// Disable autoScrolling (clicking with the mouse wheel) +user_pref("general.autoScroll", false); + +// add new tabs after the current one +user_pref("browser.tabs.insertAfterCurrent", true); + +// TODO: I might want to enable this +//user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); // 0807 + +// TODO: enable form and search history? +//user_pref("browser.formfill.enable", false); // 0810 + +// disk cache should help performance +user_pref("browser.cache.disk.enable", true); // 1001 + +// store extra session data (form content, cookies and POST data) 0: everywhere +user_pref("browser.sessionstore.privacy_level", 0); // 1003 + +// Disable unsafe passive content (images) on https sites +user_pref("security.mixed_content.block_display_content", true); // 1241 + +// Disable the eme banner +user_pref("browser.eme.ui.enabled", false); // 2022 + +// Don't delete my precious temp files +user_pref("browser.helperApps.deleteTempFileOnExit", false); // 2603 + +// Download to the download dir +user_pref("browser.download.useDownloadDir", true); // 2651 + +// Open the download panel +user_pref("browser.download.alwaysOpenPanel", true); // 2652 + +// Block after custom ruleset +user_pref("browser.contentblocking.category", "custom"); // 2701 + +// set the custom settings // 7016 +user_pref("network.cookie.cookieBehavior", 1); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true); +user_pref("network.http.referer.disallowCrossSiteRelaxingDefault.top_navigation", true); +user_pref("privacy.partition.network_state.ocsp_cache", true); +user_pref("privacy.query_stripping.enabled", true); +user_pref("privacy.trackingprotection.enabled", true); +user_pref("privacy.trackingprotection.socialtracking.enabled", true); +user_pref("privacy.trackingprotection.cryptomining.enabled", true); +user_pref("privacy.trackingprotection.fingerprinting.enabled", true); + + +// I might want to change that, when it hinders session restore +//user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false); // 2720 + +// I like my history very much! +user_pref("privacy.sanitize.sanitizeOnShutdown", false); // 2810 + +// The downsides (light theme + potential breakages): +//user_pref("privacy.resistFingerprinting", true); // 4501 +user_pref("privacy.resistFingerprinting.letterboxing", false); // 4504 + +// I would like to keep my gl, even in the web +user_pref("webgl.disabled", false); // 4520 + +// I like my service workers and am using a service using them. +user_pref("dom.serviceWorkers.enabled", true); // 7017 + +// I've got a password manager already +user_pref("signon.rememberSignons", false); // 5003 + +// Do not track header +user_pref("privacy.donottrackheader.enabled", true); // 7015 + +// Allow my custom css +user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + +// might improve performance TODO: +user_pref("gfx.webrender.all", true); + +// disable updates (pretty pointless with nix) +user_pref("extensions.update.autoUpdateDefault", false); +user_pref("extensions.update.enabled", false); +user_pref("app.update.channel", "default"); + +user_pref("browser.ctrlTab.recentlyUsedOrder", false); + +user_pref("browser.download.useDownloadDir", true); +user_pref("browser.download.folderList", 2); # TODO: +user_pref("browser.download.viewableInternally.typeWasRegistered.svg", true); +user_pref("browser.download.viewableInternally.typeWasRegistered.webp", true); +user_pref("browser.download.viewableInternally.typeWasRegistered.xml", true); + +// TODO: what does this do? +user_pref("browser.search.widget.inNavBar", true); + +user_pref("browser.shell.checkDefaultBrowser", false); +user_pref("browser.tabs.loadInBackground", true); +user_pref("browser.urlbar.placeholderName", "Brave"); + +// Set the tabs and bookmarks +user_pref("browser.tabs.inTitlebar", 1); +user_pref("browser.toolbars.bookmarks.visibility", "always"); +user_pref("browser.places.importBookmarksHTML", true); + +// Theme +user_pref("extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); +user_pref("extensions.extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); + +// highlight all entries when searching +user_pref("findbar.highlightAll", true); + +// TODO: +//user_pref("extensions.webcompat.enable_picture_in_picture_overrides", true); +//user_pref("extensions.webcompat.enable_shims", true); +//user_pref("extensions.webcompat.perform_injections", true); +//user_pref("extensions.webcompat.perform_ua_overrides", true); + +// onlykey / copied from a yubikey config +//user_pref("security.webauth.u2f", true); +//user_pref("security.webauth.webauthn", true); +//user_pref("security.webauth.webauthn_enable_softtoken", true); +//user_pref("security.webauth.webauthn_enable_usbtoken", true); diff --git a/hm/soispha/conf/firefox/config/search/engines/default.nix b/hm/soispha/conf/firefox/config/search/engines/default.nix new file mode 100644 index 00000000..286d7247 --- /dev/null +++ b/hm/soispha/conf/firefox/config/search/engines/default.nix @@ -0,0 +1,59 @@ +{pkgs, ...}: { + "Brave Search" = { + urls = [{template = "https://search.brave.com/search?q={searchTerms}";}]; + IconUpdateURL = "https://raw.githubusercontent.com/brave/brave-core/master/components/brave_welcome_ui/components/images/lion_logo.svg"; + updateInterval = 24; # every day + definedAliases = ["@bs"]; + }; + + # NIX + "Nix Packages" = { + urls = [{template = "https://search.nixos.org/packages?type=packages&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@np"]; + }; + "Nix Options" = { + urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@no"]; + }; + "NixOS Wiki" = { + urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@nw"]; + }; + + "Arch Wiki" = { + urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; + iconUpdateURL = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Archlinux-icon-crystal-64.svg"; + updateInterval = 24; + definedAliases = ["@aw"]; + }; + + # RUST + "Rust std" = { + urls = [{template = "https://doc.rust-lang.org/std/?search={searchTerms}";}]; + iconUpdateURL = "https://rustacean.net/assets/rustacean-orig-noshadow.svg"; + updateInterval = 24; + definedAliases = ["@rs"]; + }; + + "Google Scholar" = { + urls = [{template = "https://scholar.google.com/scholar?hl=en&q={searchTerms}";}]; + iconUpdateURL = "https://scholar.google.com/favicon.ico"; + updateInterval = 24; + definedAliases = ["@gs"]; + }; + "Wikipedia" = { + urls = [{template = "https://en.wikipedia.org/wiki/{searchTerms}";}]; + iconUpdateURL = "https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg"; + updateInterval = 24; + definedAliases = ["@wp"]; + }; + + "Wikipedia (en)".metaData.hidden = true; + "DuckDuckGo".metaData.hidden = true; + "Bing".metaData.hidden = true; + "Google".metaData.hidden = true; + "Amazon.de".metaData.hidden = true; +} diff --git a/hm/soispha/conf/firefox/default.nix b/hm/soispha/conf/firefox/default.nix new file mode 100644 index 00000000..1040ed0b --- /dev/null +++ b/hm/soispha/conf/firefox/default.nix @@ -0,0 +1,71 @@ +{ + config, + pkgs, + lib, + user_js, + video_pause, + ... +}: let + userChrome = builtins.readFile ./config/chrome/userChrome.css; + + user_js_nix = (import ./config/prefs) {inherit pkgs lib config user_js;}; + + extensions = builtins.map buildFirefoxXpiAddon ( + lib.attrValues ( + lib.importJSON ./config/extensions/extensions.json + ) + ); + engines = (import ./config/search/engines) {inherit pkgs;}; + + # source: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/default.nix + buildFirefoxXpiAddon = (import ./functions/extensions) {inherit pkgs;}; + + video-pauser = (import ./functions/extensions/video-pauser.nix) {inherit pkgs video_pause;}; +in { + home.packages = [ + pkgs.tridactyl-native + ]; + home.sessionVariables = { + # improve touch input & make scrolling smother + MOZ_USE_XINPUT2 = "1"; + # improve wayland support + MOZ_ENABLE_WAYLAND = 1; + }; + xdg.mimeApps = { + enable = true; + defaultApplications = { + "text/html" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop"]; + "x-scheme-handler/unknown" = ["firefox.desktop"]; + }; + }; + programs.firefox = { + enable = true; + package = pkgs.firefox-wayland.override { + extraNativeMessagingHosts = [video-pauser]; + cfg = { + enableTridactylNative = true; + }; + }; + profiles."default" = { + inherit extensions; + isDefault = true; + id = 0; + name = "default"; + + inherit userChrome; + + search = { + default = "Brave Search"; + force = true; + + inherit engines; + }; + + bookmarks = []; + extraConfig = builtins.readFile "${user_js_nix}/user.js"; + }; + }; +} diff --git a/hm/soispha/conf/firefox/functions/bookmarks/default.nix b/hm/soispha/conf/firefox/functions/bookmarks/default.nix new file mode 100644 index 00000000..d1d89dd2 --- /dev/null +++ b/hm/soispha/conf/firefox/functions/bookmarks/default.nix @@ -0,0 +1,49 @@ +{ + lib, + pkgs, +}: bookmarks: let + indent = level: + lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); + + bookmarkToHTML = indentLevel: bookmark: '' + ${indent indentLevel}
${lib.escapeXML bookmark.name}''; + + directoryToHTML = indentLevel: directory: '' + ${indent indentLevel}
${ + if directory.toolbar + then ''

Bookmarks Toolbar'' + else "

${lib.escapeXML directory.name}" + }

+ ${indent indentLevel}

+ ${allItemsToHTML (indentLevel + 1) directory.bookmarks} + ${indent indentLevel}

''; + + itemToHTMLOrRecurse = indentLevel: item: + if item ? "url" + then bookmarkToHTML indentLevel item + else directoryToHTML indentLevel item; + + allItemsToHTML = indentLevel: bookmarks: + lib.concatStringsSep "\n" + (map (itemToHTMLOrRecurse indentLevel) bookmarks); + + bookmarkEntries = allItemsToHTML 1 bookmarks; +in + pkgs.writeText "firefox-bookmarks.html" '' + + + + Bookmarks +

Bookmarks Menu

+ +

+

Bookmarks Toolbar

+

+ ${bookmarkEntries} +

+

+ '' diff --git a/hm/soispha/conf/firefox/functions/extensions/default.nix b/hm/soispha/conf/firefox/functions/extensions/default.nix new file mode 100644 index 00000000..b84461c7 --- /dev/null +++ b/hm/soispha/conf/firefox/functions/extensions/default.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: { + pname, + version, + addonId, + url, + sha256, + #meta, + ... +}: +pkgs.stdenv.mkDerivation { + name = "${pname}-${version}"; + + #inherit meta; + + src = builtins.fetchurl {inherit url sha256;}; + + preferLocalBuild = true; + allowSubstitutes = true; + + buildCommand = '' + dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" + mkdir -p "$dst" + install -v -m644 "$src" "$dst/${addonId}.xpi" + ''; +} diff --git a/hm/soispha/conf/firefox/functions/extensions/video-pauser.nix b/hm/soispha/conf/firefox/functions/extensions/video-pauser.nix new file mode 100644 index 00000000..c4c5238f --- /dev/null +++ b/hm/soispha/conf/firefox/functions/extensions/video-pauser.nix @@ -0,0 +1,30 @@ +{ + pkgs, + video_pause, + ... +}: +pkgs.runCommand "video_pause_native_messaging" {} '' + install -d $out/share/ + cat << EOF > $out/share/video_pauser.json + { + "name": "video_pauser", + "description": "Pause your Videos with a single key stroke!", + "path": "${video_pause}/bin/video_pause", + "type": "stdio", + "allowed_extensions": ["video-pauser@addons.vhack.eu"] + } + EOF + + nativeMessagingPaths=( + /lib/mozilla/native-messaging-hosts + /etc/opt/chrome/native-messaging-hosts + /etc/chromium/native-messaging-hosts + /etc/vivaldi/native-messaging-hosts + /lib/librewolf/native-messaging-hosts + ) + + for manifestDir in "''${nativeMessagingPaths[@]}"; do + install -d $out$manifestDir + ln -s $out/share/video_pauser.json $out$manifestDir/ + done +'' diff --git a/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py b/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py new file mode 100755 index 00000000..311fd214 --- /dev/null +++ b/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py @@ -0,0 +1,43 @@ +#!/usr/bin/python +# source: https://unix.stackexchange.com/a/497861 +# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information. +# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4. +# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17). + +import lz4.block # pip install lz4 --user + + +def mozlz4_to_text(filepath): + # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, + # return the uncompressed text. + bytestream = open(filepath, "rb") + bytestream.read(8) # skip past the b"mozLz40\0" header + valid_bytes = bytestream.read() + text = lz4.block.decompress(valid_bytes) + return text + + +def main(args): + # Given command-line arguments of an input filepath for a ".mozlz4" file + # and optionally an output filepath, write the decompressed text to the + # output filepath. + # Default output filepath is the input filepath minus the last three characters + # (e.g. "foo.jsonlz4" becomes "foo.json") + filepath_in = args[0] + if len(args) < 2: + filepath_out = filepath_in[:-3] + else: + filepath_out = args[1] + text = mozlz4_to_text(filepath_in) + with open(filepath_out, "wb") as outfile: + outfile.write(text) + print("Wrote decompressed text to {}".format(filepath_out)) + + +if __name__ == "__main__": + import sys + args = sys.argv[1:] + if args and not args[0] in ("--help", "-h"): + main(args) + else: + print("Usage: mozlz4.py ") diff --git a/hm/soispha/conf/firefox/scripts/update_extensions b/hm/soispha/conf/firefox/scripts/update_extensions new file mode 100755 index 00000000..05f47aad --- /dev/null +++ b/hm/soispha/conf/firefox/scripts/update_extensions @@ -0,0 +1,22 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +#. ~/.local/lib/shell/lib + +tmp=$(mktemp) +cat << EOF > $tmp + darkreader + keepassxc-browser + simple-tab-groups + ublock-origin + tridactyl-vim + video-pauser + libredirect +EOF + +# The bin is provided in the devshell. The cat execution should be unquoted +generate_extensions $(cat "$tmp") > "$(dirname $0)"/../config/extensions/extensions.json + + + +rm "$tmp"; diff --git a/hm/soispha/conf/gammastep/default.nix b/hm/soispha/conf/gammastep/default.nix new file mode 100644 index 00000000..1ae0550b --- /dev/null +++ b/hm/soispha/conf/gammastep/default.nix @@ -0,0 +1,29 @@ +{ + lib, + nixosConfig, + ... +}: let + temp = + if nixosConfig.soispha.laptop.enable + then 3000 + else 1300; +in { + services.gammastep = { + enable = true; + settings = { + general = { + temp-day = lib.mkForce temp; + temp-night = lib.mkForce temp; + gamma = "0.8:0.8:0.8"; + fade = 0; + adjustment-method = "wayland"; + location-provider = "manual"; + }; + + manual = { + lat = 48.1; + lon = 11.6; + }; + }; + }; +} diff --git a/hm/soispha/conf/git/default.nix b/hm/soispha/conf/git/default.nix new file mode 100644 index 00000000..f99f705c --- /dev/null +++ b/hm/soispha/conf/git/default.nix @@ -0,0 +1,90 @@ +{ + lib, + nixosConfig, + ... +}: let + gitIgnoreFile = ./git_ignore.git; + gitTemplateFile = ./git_template.git; +in { + programs.git = { + enable = true; + #package = pkgs.gitAndTools.gitFull; # TODO: for git send-email support + aliases = { + st = "status"; + ds = "diff --staged"; + di = "diff"; + rs = "restore --staged"; + + ## Logging: + ls = "log --max-count=10 --color --format=format:'%C(bold red)%h%C(reset) %C(dim bold blue)%s%C(reset) %C(dim white)[%aN] %C(bold red)<%G?>%C(reset)%C(auto)%d%C(reset)'"; + + # https://stackoverflow.com/a/61487052 + lg = "lg1"; + lg1 = "lg1-specific --all"; + lg2 = "lg2-specific --all"; + lg3 = "lg3-specific --all"; + + lg1-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold cyan) [%G?]%C(reset)%C(auto)%d%C(reset)'"; + + lg2-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"; + + lg3-specific = "log --graph --abbrev-commit --decorate \ + --format=format:'%C(bold blue)%h%C(reset)\ + - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)\ + %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)\ + %C(bold red)(signature: %G? by %GS, trust: %GT)%C(reset)%n\ + '' %C(white)%s%C(reset)%n''\ + %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)\ + %C(bold white)- trailers: %(trailers) %C(reset)'"; + }; + extraConfig = { + core = { + excludesFile = "${gitIgnoreFile}"; + }; + init = { + defaultBranch = "prime"; + }; + user = { + email = "soispha@vhack.eu"; + name = "Soispha"; + }; + help = { + autocorrect = 5; + }; + push = { + gpgSign = "if-asked"; + }; + commit = { + template = "${gitTemplateFile}"; + }; + diff = { + colorMoved = "default"; + }; + merge = { + conflictstyle = "diff3"; + }; + }; + delta = { + enable = true; + options = { + decorations = { + commit-decoration-style = "bold yellow box ul"; + file-decoration-style = "none"; + file-style = "bold yellow ul"; + }; + keep-plus-minus-markers = + if nixosConfig.soispha.laptop.enable + then true + else false; + features = "decorations"; + whitespace-error-style = "22 reverse"; + }; + }; + signing = { + key = "9606FC749FCE16360723D4ADA5E94010C3A642AD!"; + signByDefault = true; + }; + }; +} diff --git a/hm/soispha/conf/git/git_ignore.git b/hm/soispha/conf/git/git_ignore.git new file mode 100644 index 00000000..8f29815e --- /dev/null +++ b/hm/soispha/conf/git/git_ignore.git @@ -0,0 +1,4 @@ +# default nvim Session file name +Session.vim + +# vim: ft=gitignore diff --git a/hm/soispha/conf/git/git_template.git b/hm/soispha/conf/git/git_template.git new file mode 100644 index 00000000..9621698d --- /dev/null +++ b/hm/soispha/conf/git/git_template.git @@ -0,0 +1,66 @@ + +# Title: Summary, imperative, start upper case, don't end with a period +# If applied, this commit will + +# Body: Explain *what* and *why* (not *how*). + + +# BREAKING CHANGE: +# Fixes: # +# Refs: # +# Co-authored-by: + + + +# Convention Commits (https://www.conventionalcommits.org/en/v1.0.0/ or https://github.com/angular/angular/blob/85b4941be137a2fcdc664dc870e408dd72ad7de7/CONTRIBUTING.md#commit): +# Feat: [Features] -> MINOR version bump +# A new feature +# +# Fix: [Bug Fixes] -> PATCH version bump +# A bug fix +# +# append '!' after the type/scope: [Breaking Change] -> MAJOR version bump +# A breaking API change +# +# Docs: [Documentation] +# Documentation only changes +# +# Style: [Styles] +# Changes that do not affect the meaning of the code +# (white-space, formatting, missing semi-colons, etc) +# +# Refactor: [Code Refactoring] +# A code change that neither fixes a bug nor adds a feature +# +# Perf: [Performance Improvements] -> PATCH version bump +# A code change that improves performance +# +# Test: [Tests] +# Adding missing tests or correcting existing tests +# +# Build: [Builds] -> PATCH version bump +# Changes that affect the build system or external dependencies +# (example scopes: gulp, broccoli, npm) +# +# Ci: [Continuous Integrations] +# Changes to our CI configuration files and scripts +# (example scopes: Travis, Circle, BrowserStack, SauceLabs) +# +# Chore: [Chores] +# Other changes that don't modify src or test files +# +# Reverts: [Reverts] +# Reverts a previous commit + +# How to Write a Git Commit Message: +# [https://chris.beams.io/posts/git-commit/] -> https://cbea.ms/git-commit/ +# +# 1. Separate subject from body with a blank line +# 2. Limit the subject line to 50 characters +# 3. Capitalize the subject line +# 4. Do not end the subject line with a period +# 5. Use the imperative mood in the subject line +# 6. Wrap the body at 72 characters +# 7. Use the body to explain *what* and *why* vs. *how* +# +# vim: ft=gitcommit diff --git a/hm/soispha/conf/gpg/agent-program b/hm/soispha/conf/gpg/agent-program new file mode 100755 index 00000000..e6917db0 --- /dev/null +++ b/hm/soispha/conf/gpg/agent-program @@ -0,0 +1,2 @@ +#!/bin/sh +onlykey-gpg-agent -v --skey-slot=ECC32 --dkey-slot=ECC32 "$@" diff --git a/hm/soispha/conf/gpg/default.nix b/hm/soispha/conf/gpg/default.nix new file mode 100644 index 00000000..97334c8f --- /dev/null +++ b/hm/soispha/conf/gpg/default.nix @@ -0,0 +1,65 @@ +{ + config, + nixosConfig, + sysLib, + pkgs, + ... +}: let + agent-program = sysLib.writeShellScriptWithLibrary { + name = "onlykey-gpg-agent"; + src = ./agent-program; + dependencies = with pkgs; [ + python3 + onlykey-agent + ]; + }; + settings = + if nixosConfig.networking.hostName == "isimud" + then {} + else { + # Hardware-based GPG configuration + agent-program = "${agent-program}/bin/onlykey-gpg-agent"; + + default-key = "Soispha "; + # TODO: add more + }; + gpg-agent = + if nixosConfig.networking.hostName == "isimud" + then { + enable = true; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + } + else { + enable = false; + enableZshIntegration = true; + enableScDaemon = true; # smartcards and such things + pinentryFlavor = "tty"; + }; +in { + programs.gpg = { + enable = true; + homedir = "${config.xdg.dataHome}/gnupg/onlykey"; + mutableKeys = false; + mutableTrust = false; + inherit settings; + publicKeys = [ + { + source = ./keys/key_1; + trust = "ultimate"; + } + { + source = ./keys/key_2; + trust = "ultimate"; + } + { + source = ./keys/key_3; + trust = "full"; + } + ]; + }; + services = { + inherit gpg-agent; + }; +} diff --git a/hm/soispha/conf/gpg/keys/key_1 b/hm/soispha/conf/gpg/keys/key_1 new file mode 100644 index 00000000..b10b8b6c Binary files /dev/null and b/hm/soispha/conf/gpg/keys/key_1 differ diff --git a/hm/soispha/conf/gpg/keys/key_2 b/hm/soispha/conf/gpg/keys/key_2 new file mode 100644 index 00000000..0b06cf3b Binary files /dev/null and b/hm/soispha/conf/gpg/keys/key_2 differ diff --git a/hm/soispha/conf/gpg/keys/key_3 b/hm/soispha/conf/gpg/keys/key_3 new file mode 100644 index 00000000..22ffb931 Binary files /dev/null and b/hm/soispha/conf/gpg/keys/key_3 differ diff --git a/hm/soispha/conf/grades/config.yaml b/hm/soispha/conf/grades/config.yaml new file mode 100644 index 00000000..36712971 --- /dev/null +++ b/hm/soispha/conf/grades/config.yaml @@ -0,0 +1,68 @@ +# für oberstufe +--- +unit: Punkte +grade_groups: + - name: Zeugnis + weight: '100' + double_weight_on_class_type: false + - name: Sonstige + weight: '1' + double_weight_on_class_type: true + - name: Klausur + weight: '1' + double_weight_on_class_type: false + +grade_types: + - name: Zeugnis + group: Zeugnis + - name: Klausur + group: Klausur + - name: Epo + group: Sonstige + - name: Test + group: Sonstige + +class_types: + - name: NebenFach + double_weight_on_marked_grade_groups: true + - name: LeistungsKurs + double_weight_on_marked_grade_groups: false + +classes: + - name: M + long_name: Mathe + class_type: LeistungsKurs + - name: E + long_name: Englisch + class_type: LeistungsKurs + - name: CH + long_name: Chemie + class_type: LeistungsKurs + + - name: d + long_name: Deutsch + class_type: NebenFach + - name: g + long_name: Geschichte + class_type: NebenFach + - name: se + long_name: Sozialkunde/Erdkunde + class_type: NebenFach + - name: et + long_name: Ethik + class_type: NebenFach + - name: spj + long_name: Sport + class_type: NebenFach + - name: inf + long_name: Informatik + class_type: NebenFach + - name: ph + long_name: Phyisk + class_type: NebenFach + - name: phi + long_name: Philosophie + class_type: NebenFach + - name: bi + long_name: Biologie + class_type: NebenFach diff --git a/hm/soispha/conf/grades/default.nix b/hm/soispha/conf/grades/default.nix new file mode 100644 index 00000000..d2678174 --- /dev/null +++ b/hm/soispha/conf/grades/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."grades/config.yaml".source = ./config.yaml; +} diff --git a/hm/soispha/conf/gtk/default.nix b/hm/soispha/conf/gtk/default.nix new file mode 100644 index 00000000..f5411369 --- /dev/null +++ b/hm/soispha/conf/gtk/default.nix @@ -0,0 +1,58 @@ +{ + config, + lib, + pkgs, + stdenv, + ... +}: { + gtk = { + enable = true; + theme = { + package = pkgs.nordic; + name = "Nordic"; + }; + cursorTheme = { + package = pkgs.nordzy-cursor-theme; + name = "Nordzy-cursors"; + }; + iconTheme = { + package = pkgs.nordzy-icon-theme; + name = "Nordzy-icon"; + }; + font = { + name = "Noto Sans"; + size = 10; + }; + gtk2 = { + configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + # extraConfig = '' + # gtk-enable-animations=1 + # gtk-primary-button-warps-slider=0 + # gtk-toolbar-style=3 + # gtk-menu-images=1 + # gtk-button-images=1 + # + # ''; + }; + gtk3 = { + # extraConfig = '' + # gtk-button-images=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-menu-images=true + # gtk-primary-button-warps-slider=false + # gtk-toolbar-style=3 + # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module + # ''; + extraCss = ""; + }; + gtk4 = { + # extraConfig = '' + # gtk-application-prefer-dark-theme=true + # gtk-decoration-layout=icon:minimize,maximize,close + # gtk-enable-animations=true + # gtk-primary-button-warps-slider=false + # ''; + }; + }; +} diff --git a/hm/soispha/conf/himalaya/default.nix b/hm/soispha/conf/himalaya/default.nix new file mode 100644 index 00000000..c072693e --- /dev/null +++ b/hm/soispha/conf/himalaya/default.nix @@ -0,0 +1,8 @@ +{...}: { + programs.himalaya = { + enable = true; + settings = { + # TODO: + }; + }; +} diff --git a/hm/soispha/conf/iamb/config.json b/hm/soispha/conf/iamb/config.json new file mode 100644 index 00000000..ca06d543 --- /dev/null +++ b/hm/soispha/conf/iamb/config.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "soispha": { + "user_id": "@soispha:vhack.eu", + "url": "https://matrix.vhack.eu" + } + }, + "default_profile": "soispha" +} diff --git a/hm/soispha/conf/iamb/default.nix b/hm/soispha/conf/iamb/default.nix new file mode 100644 index 00000000..2a93472c --- /dev/null +++ b/hm/soispha/conf/iamb/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."iamb/config.json".source = ./config.json; +} diff --git a/hm/soispha/conf/keepassxc/default.nix b/hm/soispha/conf/keepassxc/default.nix new file mode 100644 index 00000000..3ac82812 --- /dev/null +++ b/hm/soispha/conf/keepassxc/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."keepassxc/keepassxc.ini".source = ./keepassxc.ini; +} diff --git a/hm/soispha/conf/keepassxc/keepassxc.ini b/hm/soispha/conf/keepassxc/keepassxc.ini new file mode 100644 index 00000000..288a194b --- /dev/null +++ b/hm/soispha/conf/keepassxc/keepassxc.ini @@ -0,0 +1,58 @@ +[General] +AutoSaveAfterEveryChange=true +BackupBeforeSave=true +BackupFilePathPattern=/home/soispha/.local/share/keepassxc/{DB_FILENAME}.old.kdbx +ConfigVersion=2 +HideWindowOnCopy=false + +[Browser] +CustomProxyLocation= +Enabled=true + +[FdoSecrets] +Enabled=true + +[GUI] +AdvancedSettings=true +ApplicationTheme=dark +CompactMode=false +HidePasswords=true +ShowExpiredEntriesOnDatabaseUnlockOffsetDays=1 +TrayIconAppearance=monochrome-light + +[KeeShare] +Active="" +Own="" +QuietSuccess=true + +[PasswordGenerator] +AdditionalChars= +AdvancedMode=true +Braces=true +Dashes=true +EASCII=true +ExcludedChars= +Length=128 +Logograms=true +LowerCase=true +Math=true +Numbers=true +Punctuation=true +Quotes=true +SpecialChars=true +Type=0 +UpperCase=true +WordCount=4 +WordSeparator="," + +[SSHAgent] +Enabled=true + +[Security] +HidePasswordPreviewPanel=true +IconDownloadFallback=true +LockDatabaseIdle=false +LockDatabaseIdleSeconds=960 +PasswordEmptyPlaceholder=true +PasswordsHidden=true +PasswordsRepeatVisible=true diff --git a/hm/soispha/conf/latexindent/default.nix b/hm/soispha/conf/latexindent/default.nix new file mode 100644 index 00000000..0d776e14 --- /dev/null +++ b/hm/soispha/conf/latexindent/default.nix @@ -0,0 +1,8 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."latexindent/indentconfig.yaml".source = ./indentconfig.yaml; + xdg.configFile."latexindent/mysettings.yaml".source = ./mysettings.yaml; +} diff --git a/hm/soispha/conf/latexindent/indentconfig.yaml b/hm/soispha/conf/latexindent/indentconfig.yaml new file mode 100644 index 00000000..d67351f3 --- /dev/null +++ b/hm/soispha/conf/latexindent/indentconfig.yaml @@ -0,0 +1,2 @@ +paths: +- /home/dt/.config/latexindent/mysettings.yaml diff --git a/hm/soispha/conf/latexindent/mysettings.yaml b/hm/soispha/conf/latexindent/mysettings.yaml new file mode 100644 index 00000000..9a0f8b2f --- /dev/null +++ b/hm/soispha/conf/latexindent/mysettings.yaml @@ -0,0 +1,672 @@ +# defaultSettings.yaml for latexindent.pl, version 3.19.1, 2022-12-04 +# a script that aims to +# beautify .tex, .sty, .cls files +# +# (or latexindent.exe if you're on Windows) +# +#--------------------------------------------------------------------------------------- +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# See http://www.gnu.org/licenses/. +# +# Chris Hughes, 2017 +# +# For all communication, please visit: https://github.com/cmhughes/latexindent.pl +# +#--------------------------------------------------------------------------------------- +# You should feel encouraged to change anything you like in these settings, but +# it would probably be better to have your own user settings +# files somewhere else - remember that this file may be overwritten +# when you update your tex distribution. Please see the manual linked from: +# +# https://github.com/cmhughes/latexindent.pl +# +# for details of how to create and configure your own settings files. +# +# Please read the manual (linked from above) first to understand what each switch does. +# +#--------------------------------------------------------------------------------------- + +# latexindent can be called to act on a file without using the file's extension, +# e.g, simply +# latexindent myfile +# in which case the choice of file extension is chosen +# according to the choices made in fileExtensionPreference +# Other file extensions can be added. +fileExtensionPreference: + .tex: 1 + .sty: 2 + .cls: 3 + .bib: 4 + +# default file extension of backup file (if -w switch is active) +# for example, if your .tex file is called +# myfile.tex +# and you specify the backupExtension as BACKUP.bak then your +# backup file will be +# myfileBACKUP.bak +backupExtension: .bak + +# only one backup per file: +# - if onlyOneBackUp is 0 then, as a safety measure, +# the number on the extension increments by 1 each time: +# +# myfile.bak0, myfile.bak1, myfile.bak2 +# - if you set onlyOnebackUp to 1, then the backup file will +# be overwritten each time (not recommended until you trust the script) +onlyOneBackUp: 0 + +# some users may want a finite number of backup files, +# say at most 3; in which case, they can change this maxNumberOfBackUps. +# +# If maxNumberOfBackUps is set to 0 (or less) then infinitely +# many backups are possible, unless onlyOneBackUp is switched on +maxNumberOfBackUps: 0 + +# some users may wish to cycle through back up files. +# +# for example, with maxNumberOfBackUps: 4, they may +# wish to delete the oldest back up file, and keep only the most recent. +# +# copy myfile.bak1 to myfile.bak0 +# copy myfile.bak2 to myfile.bak1 +# copy myfile.bak3 to myfile.bak2 +# copy myfile.bak4 to myfile.bak3 +# +# the back up will be written to myfile.bak4 +cycleThroughBackUps: 0 + +# preferences for information displayed in the log file +logFilePreferences: + showEveryYamlRead: 1 + showAmalgamatedSettings: 0 + showDecorationStartCodeBlockTrace: 0 + showDecorationFinishCodeBlockTrace: 0 + endLogFileWith: '--------------' + showGitHubInfoFooter: 1 + Dumper: + Terse: 1 + Indent: 1 + Useqq: 1 + Deparse: 1 + Quotekeys: 0 + Sortkeys: 1 + Pair: " => " + +# verbatim environments specified +# in this field will not be changed at all! +verbatimEnvironments: + verbatim: 1 + lstlisting: 1 + minted: 1 + +# verbatim commands such as \verb! body !, \lstinline$something else$ +verbatimCommands: + verb: 1 + lstinline: 1 + +# no indent blocks (not necessarily verbatim +# environments) which are marked as %\begin{noindent} +# or anything else that you detail in the following +noIndentBlock: + noindent: 1 + cmhtest: 1 + +# \begin{document} and \end{document} are treated differently +# by latexindent within filecontents environments +fileContentsEnvironments: + filecontents: 1 + filecontents*: 1 + +# indent preamble +indentPreamble: 1 + +# assume no preamble in cls, sty, by default +lookForPreamble: + .tex: 1 + .sty: 0 + .cls: 0 + .bib: 0 + +# some preambles can contain \begin and \end statements +# that are not in their 'standard environment block', for example, +# consider the following key = values: +# preheadhook={\begin{mdframed}[style=myframedstyle]}, +# postfoothook=\end{mdframed}, +preambleCommandsBeforeEnvironments: 0 + +# default value of indentation +defaultIndent: " " + +# remove trailing whitespace from all lines +removeTrailingWhitespace: + beforeProcessing: 0 + afterProcessing: 1 + +# name of code blocks that should have their body aligned at ampersand delimiters +lookForAlignDelims: + tabular: + delims: 1 + alignDoubleBackSlash: 1 + spacesBeforeDoubleBackSlash: 1 + multiColumnGrouping: 0 + alignRowsWithoutMaxDelims: 1 + spacesBeforeAmpersand: 1 + spacesAfterAmpersand: 1 + justification: left + alignFinalDoubleBackSlash: 0 + dontMeasure: 0 + delimiterRegEx: '(?]*?>)' + keyEqualsValuesBracesBrackets: + name: '[a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*?' + follow: '(?:(?<]+?' + follow: '\h|\R|\{|\[|\$|\)|\(' + UnNamedGroupingBracesBrackets: + follow: '\{|\[|,|&|\)|\(|\$' + arguments: + before: '(?:#\d\h*;?,?\/?)+|\<.*?\>' + between: '_|\^|\*' + trailingComments: + notPreceededBy: '(? "$script" +chmod +x "$script" +"$VISUAL" "$script" + + +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/mk_scr_temp b/hm/soispha/conf/lf/commands/scripts/mk_scr_temp new file mode 100755 index 00000000..a520469c --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/mk_scr_temp @@ -0,0 +1,31 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + + +prompt "Script name: " +name="" +while [ -z "$name" ] || [ -e "$name" ] +do + read -r name + if [ -e "$name" ]; then + prompt "Script already exists, overwrite [y|N]: " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + prompt "Script Name: " + fi + fi +done + +script="$(pwd)"/"$name" + +sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" > "$script" +chmod +x "$script" +"$VISUAL" "$script" + + +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/open b/hm/soispha/conf/lf/commands/scripts/open new file mode 100755 index 00000000..c507482b --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/open @@ -0,0 +1,11 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +case $(file --mime-type "$f" -bL) in + text/*|application/json|application/vnd.hp-HPGL) "$EDITOR" "$f";; + image/*) "$IVIEWER" "$f";; + *) xdg-open "$f";; +esac +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/open_config b/hm/soispha/conf/lf/commands/scripts/open_config new file mode 100755 index 00000000..35e5165d --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/open_config @@ -0,0 +1,7 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +"$EDITOR" "$(bookmenu -b ~/.config/bookmenu/configs -f fzf -o)" # TODO: implement this +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/restore_trash b/hm/soispha/conf/lf/commands/scripts/restore_trash new file mode 100755 index 00000000..a7bf0094 --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/restore_trash @@ -0,0 +1,7 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +trash list | fzf --multi | awk '{print $NF}' | xargs trash restore --match=exact +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/set_wall_paper b/hm/soispha/conf/lf/commands/scripts/set_wall_paper new file mode 100755 index 00000000..c493e773 --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/set_wall_paper @@ -0,0 +1,10 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +die "No yet implemented" # TODO: do what the 'die' says +#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv +#nohub swaybg -i "$f" +#feh --bg-max --no-fehbg "$f" +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/stripspace b/hm/soispha/conf/lf/commands/scripts/stripspace new file mode 100755 index 00000000..91714712 --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/stripspace @@ -0,0 +1,31 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +files=$(mktmp); +echo "$fx" > "$files"; + +awk_source=$(mktmp); +cat << OFT > "$awk_source" +BEGIN {FS=" "} +{for (i=1; i != NF + 1; i++) + if (i == NF) { + parts[i]=tolower(\$i); + } else { + parts[i]=tolower(\$i"_"); + } +} +END {for (i in parts) printf parts[i]} +OFT + +while read -r file; do + dirty_name=$(mktmp) + basename "$file" > "$dirty_name"; + clean_name=$(awk -f "$awk_source" "$dirty_name"); + + [ -e "$clean_name" ] && die "file \"$clean_name\" already exists!"; + mv "$(cat "$dirty_name")" "$clean_name" || die "Move failed"; + lf -remote 'send reload' +done < "$files"; +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/trash b/hm/soispha/conf/lf/commands/scripts/trash new file mode 100755 index 00000000..8dd6033d --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/trash @@ -0,0 +1,26 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +trash_output=$(mktmp); +expected_error_output=$(mktmp); + +while read -r file; do + set -- "$@" "$file" +done < "$(tmp "echo '$fx'")" + +# TODO: why are we using trashy at all, when trash-cli can do everything? +# try trashy first, trough nix because both trashy and trash-cli provide a trash command, which conflicts +nix run nixpkgs#trashy -- put "$@" 2> "$trash_output"; + +cat << EOF > "$expected_error_output"; +error: Error during a \`trash\` operation: Unknown { description: "Path: '\"/.Trash-1000\"'. Message: Permission denied (os error 13)" } +EOF + +if [ "$(cat "$expected_error_output")" = "$(cat "$trash_output")" ];then + warning "Deleting with trash-cli to the /.Trash folder"; + # this file could not be trashed because it is on the tempfs volume, trash-cli can do this this + trash-put "$@"; +fi +# vim: ft=sh diff --git a/hm/soispha/conf/lf/commands/scripts/unarchive b/hm/soispha/conf/lf/commands/scripts/unarchive new file mode 100755 index 00000000..ee97f3b1 --- /dev/null +++ b/hm/soispha/conf/lf/commands/scripts/unarchive @@ -0,0 +1,22 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# extract the current file with the right command +# (xkcd link: https://xkcd.com/1168/) +set -f +# TODO: add support for multiple files at once +case "$f" in + *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf "$f";; + *.tar.gz|*.tgz) tar xzvf "$f";; + *.tar.xz|*.txz) tar xJvf "$f";; + *.zip) unzip "$f";; + *.rar) + die "rar is a unfree format!" + #unrar x $f + ;; + *.7z) 7z x "$f";; + *) die "Unsupported format" ;; +esac +# vim: ft=sh diff --git a/hm/soispha/conf/lf/default.nix b/hm/soispha/conf/lf/default.nix new file mode 100644 index 00000000..ed037b05 --- /dev/null +++ b/hm/soispha/conf/lf/default.nix @@ -0,0 +1,53 @@ +{ + pkgs, + sysLib, + nixosConfig, + shell_library, + lf_rename, + system, + ... +}: let + commands = import ./commands {inherit pkgs sysLib shell_library system lf_rename;}; + keybindings = import ./keybindings {inherit nixosConfig;}; +in { + xdg.configFile."lf/icons".source = ./icons; + xdg.configFile."lf/colors".source = ./colors; + + # TODO: add the systemd tempfile option here + + programs.lf = { + enable = true; + + inherit commands keybindings; + + previewer = { + keybinding = "i"; + source = "${pkgs.ctpv}/bin/ctpv"; + }; + settings = { + # TODO: this needs to be added to nixos: + #autoquit = true; # quit the server, if no clients are left + #dirpreviews = true; # preview for directories + + dircounts = true; # count things in directories TODO: this has performance impact + drawbox = true; + # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; + errorfmt = "\\033[1;91m%s\\033[0m"; + hidden = true; # show hidden files + icons = true; + ifs = "\\n"; # internal field separator for shell commands + #info = "size"; # show the size of a directory + shell = "sh"; + shellopts = "-eu"; # e: exit on error; u: error for unset variables + }; + # TODO: remove auto quit, if it has been added + extraConfig = '' + &${pkgs.ctpv}/bin/ctpv -s $id + cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id + set cleaner ${pkgs.ctpv}/bin/ctpvclear + + # close the server, after the last client exits + set autoquit true + ''; + }; +} diff --git a/hm/soispha/conf/lf/icons b/hm/soispha/conf/lf/icons new file mode 100644 index 00000000..7ef62a0b --- /dev/null +++ b/hm/soispha/conf/lf/icons @@ -0,0 +1,357 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# default values from lf (with matching order) +# ln l # LINK +# or l # ORPHAN +# tw t # STICKY_OTHER_WRITABLE +# ow d # OTHER_WRITABLE +# st t # STICKY +# di d # DIR +# pi p # FIFO +# so s # SOCK +# bd b # BLK +# cd c # CHR +# su u # SETUID +# sg g # SETGID +# ex x # EXEC +# fi - # FILE + +# file types (with matching order) +ln  # LINK +or  # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow  # OTHER_WRITABLE # nf-oct-file_directory +st t # STICKY +di  # DIR # nf-oct-file_directory +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex  # EXEC +fi  # FILE # nf-fa-file_text_o + +# file extensions (vim-devicons) +*.styl  +*.sass  +*.scss  +*.htm  +*.html  +*.slim  +*.haml  +*.ejs  +*.css  +*.less  +*.md  +*.mdx  +*.markdown  +*.rmd  +*.json  +*.webmanifest  +*.js  +*.mjs  +*.jsx  +*.rb  +*.gemspec  +*.rake  +*.php  +*.py  +*.pyc  +*.pyo  +*.pyd  +*.coffee  +*.mustache  +*.hbs  +*.conf  +*.ini  +*.yml  +*.yaml  +*.toml  +*.bat  +*.mk  +*.jpg  +*.jpeg  +*.bmp  +*.png  +*.webp  +*.gif  +*.ico  +*.twig  +*.cpp  +*.c++  +*.cxx  +*.cc  +*.cp  +*.c  +*.cs 󰌛 +*.h  +*.hh  +*.hpp  +*.hxx  +*.hs  +*.lhs  +*.nix  +*.lua  +*.java  +*.sh  +*.fish  +*.bash  +*.zsh  +*.ksh  +*.csh  +*.awk  +*.ps1  +*.ml λ +*.mli λ +*.diff  +*.db  +*.sql  +*.dump  +*.clj  +*.cljc  +*.cljs  +*.edn  +*.scala  +*.go  +*.dart  +*.xul  +*.sln  +*.suo  +*.pl  +*.pm  +*.t  +*.rss  +'*.f#'  +*.fsscript  +*.fsx  +*.fs  +*.fsi  +*.rs  +*.rlib  +*.d  +*.erl  +*.hrl  +*.ex  +*.exs  +*.eex  +*.leex  +*.heex  +*.vim  +*.ai  +*.psd  +*.psb  +*.ts  +*.tsx  +*.jl  +*.pp  +*.vue  +*.elm  +*.swift  +*.xcplayground  +*.tex 󰙩 +*.r 󰟔 +*.rproj 󰗆 +*.sol 󰡪 +*.pem  + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee  +*gruntfile.js  +*gruntfile.ls  +*gulpfile.coffee  +*gulpfile.js  +*gulpfile.ls  +*mix.lock  +*dropbox  +*.ds_store  +*.gitconfig  +*.gitignore  +*.gitattributes  +*.gitlab-ci.yml  +*.bashrc  +*.zshrc  +*.zshenv  +*.zprofile  +*.vimrc  +*.gvimrc  +*_vimrc  +*_gvimrc  +*.bashprofile  +*favicon.ico  +*license  +*node_modules  +*react.jsx  +*procfile  +*dockerfile  +*docker-compose.yml  +*rakefile  +*config.ru  +*gemfile  +*makefile  +*cmakelists.txt  +*robots.txt 󰚩 + +# file names (case-sensitive adaptations) +*Gruntfile.coffee  +*Gruntfile.js  +*Gruntfile.ls  +*Gulpfile.coffee  +*Gulpfile.js  +*Gulpfile.ls  +*Dropbox  +*.DS_Store  +*LICENSE  +*React.jsx  +*Procfile  +*Dockerfile  +*Docker-compose.yml  +*Rakefile  +*Gemfile  +*Makefile  +*CMakeLists.txt  + +# file patterns (vim-devicons) (patterns not supported in lf) +# .*jquery.*\.js$  +# .*angular.*\.js$  +# .*backbone.*\.js$  +# .*require.*\.js$  +# .*materialize.*\.js$  +# .*materialize.*\.css$  +# .*mootools.*\.js$  +# .*vimrc.*  +# Vagrantfile$  + +# file patterns (file name adaptations) +*jquery.min.js  +*angular.min.js  +*backbone.min.js  +*require.min.js  +*materialize.min.js  +*materialize.min.css  +*mootools.min.js  +*vimrc  +Vagrantfile  + +# archives or compressed (extensions from dircolors defaults) +*.tar  +*.tgz  +*.arc  +*.arj  +*.taz  +*.lha  +*.lz4  +*.lzh  +*.lzma  +*.tlz  +*.txz  +*.tzo  +*.t7z  +*.zip  +*.z  +*.dz  +*.gz  +*.lrz  +*.lz  +*.lzo  +*.xz  +*.zst  +*.tzst  +*.bz2  +*.bz  +*.tbz  +*.tbz2  +*.tz  +*.deb  +*.rpm  +*.jar  +*.war  +*.ear  +*.sar  +*.rar  +*.alz  +*.ace  +*.zoo  +*.cpio  +*.7z  +*.rz  +*.cab  +*.wim  +*.swm  +*.dwm  +*.esd  + +# image formats (extensions from dircolors defaults) +*.jpg  +*.jpeg  +*.mjpg  +*.mjpeg  +*.gif  +*.bmp  +*.pbm  +*.pgm  +*.ppm  +*.tga  +*.xbm  +*.xpm  +*.tif  +*.tiff  +*.png  +*.svg  +*.svgz  +*.mng  +*.pcx  +*.mov  +*.mpg  +*.mpeg  +*.m2v  +*.mkv  +*.webm  +*.ogm  +*.mp4  +*.m4v  +*.mp4v  +*.vob  +*.qt  +*.nuv  +*.wmv  +*.asf  +*.rm  +*.rmvb  +*.flc  +*.avi  +*.fli  +*.flv  +*.gl  +*.dl  +*.xcf  +*.xwd  +*.yuv  +*.cgm  +*.emf  +*.ogv  +*.ogx  + +# audio formats (extensions from dircolors defaults) +*.aac  +*.au  +*.flac  +*.m4a  +*.mid  +*.midi  +*.mka  +*.mp3  +*.mpc  +*.ogg  +*.ra  +*.wav  +*.oga  +*.opus  +*.spx  +*.xspf  + +# other formats +*.pdf  diff --git a/hm/soispha/conf/lf/keybindings/default.nix b/hm/soispha/conf/lf/keybindings/default.nix new file mode 100644 index 00000000..ab34d7d4 --- /dev/null +++ b/hm/soispha/conf/lf/keybindings/default.nix @@ -0,0 +1,127 @@ +{nixosConfig, ...}: { + # Remove some defaults + m = null; + "\"'\"" = null; + "'\"'" = null; + d = null; + c = null; + e = null; + j = null; + k = null; + l = null; + ";" = null; + + # File Openers + ee = "\$\$EDITOR \"$f\""; + es = "\$ nvim -S \"$f\""; + u = "%\$IVIEWER \"$f\""; + cc = "\$sudo -e \"$f\""; + + # Archive Mappings + au = "unarchive"; + aa = "archive"; + + # Trash Mappings + dd = "trash"; + jc = "clear_trash"; + jr = "restore_trash"; + + # Broot Mapping + f = "fzf_jump"; + + # Dragon Mapping + dr = "dragon"; + ds = "dragon-stay"; + di = "dragon-individual"; + #dm = "mvdragon"; + #dc = "cpdragon"; + dl = "dlfile"; + + cs = "stripspace"; + + # Vim keys + h = "updir"; + t = "down"; + n = "up"; + s = "open"; + + # Basic Functions + "." = "set hidden!"; + DD = "delete"; + p = "paste"; + x = "cut"; + y = "copy"; + "" = "open"; + + mk = "mk_ln"; + mf = "mk_file"; + me = "mk_file_and_edit"; + md = "mk_dir"; + ms = "mk_scr_default"; + mt = "mk_scr_temp"; + + ch = "chmod"; + bg = "set_wall_paper"; + o = "open_config"; + r = "rename"; + H = "go_project_base_directory"; + L = "bottom"; + R = "reload"; + C = "clear"; + U = "unselect"; + + # Movement + gjr = "cd ~/.local/share/Trash/files"; + gus = "cd /run/user/${builtins.toString nixosConfig.users.users.soispha.uid}"; + + "gr." = "cd ~/repos"; + grn = "cd ~/repos/nix"; + grcc = "cd ~/repos/c"; + grcp = "cd ~/repos/cpp"; + grl = "cd ~/repos/lua"; + grr = "cd ~/repos/rust"; + grs = "cd ~/repos/shell"; + grjs = "cd ~/repos/java_script"; + grmd = "cd ~/repos/mark_down"; + grty = "cd ~/repos/typst"; + grte = "cd ~/repos/tex"; + grj = "cd ~/repos/java"; + gra = "cd ~/repos/awk"; + grpy = "cd ~/repos/python"; + grpe = "cd ~/repos/perl"; + grahk = "cd ~/repos/auto_hot_key"; + grh = "cd ~/repos/html"; + # ------------- + "gm." = "cd ~/media"; + gmp = "cd ~/media/pictures"; + gmd = "cd ~/media/downloads"; + gmm = "cd ~/media/music"; + gmi = "cd ~/media/isos"; + # ------------- + "gs." = "cd ~/school"; + gsi = "cd ~/school/infomatik"; + gsc = "cd ~/school/chemie"; + gse = "cd ~/school/english"; + gsgo = "cd ~/school/geographie"; + gsgs = "cd ~/school/geschichte"; + gskr = "cd ~/school/katholische_religion"; + gsmu = "cd ~/school/musik"; + gsma = "cd ~/school/mathematik"; + gsl = "cd ~/school/latein"; + gsd = "cd ~/school/deutsch"; + gsb = "cd ~/school/biologie"; + gsso = "cd ~/school/sozialkunde"; + gssp = "cd ~/school/sport"; + gspy = "cd ~/school/physik"; + gspi = "cd ~/school/philosophie"; + # ------------- + + gc = "cd ~/.config"; + gl = "cd ~/.local"; + gE = "cd /etc"; + + "gU." = "cd /usr"; + gUs = " cd /usr/share"; + + gt = "cd /tmp"; +} diff --git a/hm/soispha/conf/mail/default.nix b/hm/soispha/conf/mail/default.nix new file mode 100644 index 00000000..475bcacf --- /dev/null +++ b/hm/soispha/conf/mail/default.nix @@ -0,0 +1,64 @@ +{ + config, + pkgs, + lib, + ... +}: let + non_public_accounts = import ./non_public_accounts.nix {inherit pkgs;}; + accounts = lib.recursiveUpdate {inherit soispha;} non_public_accounts; + + soispha = { + address = "soispha@vhack.eu"; + userName = "soispha@vhack.eu"; + realName = "Soispha"; + primary = true; + passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup account soispha@vhack.eu"; + aliases = [ + "admin@vhack.eu" + ]; + folders = { + }; + gpg = { + encryptByDefault = true; + key = "9606FC749FCE16360723D4ADA5E94010C3A642AD"; + signByDefault = true; + }; + signature = { + # TODO: + }; + neomutt = { + enable = true; + }; + mbsync = { + enable = true; + create = "both"; + }; + himalaya = { + enable = true; + backend = "imap"; + sender = "smtp"; + settings = { + # TODO: + }; + }; + smtp = { + host = "server1.vhack.eu"; + port = 465; + }; + imap = { + host = "server1.vhack.eu"; + port = 993; + }; + jmap = { + # TODO: + }; + maildir = { + path = "soispha"; + }; + }; +in { + accounts.email = { + maildirBasePath = "${config.xdg.dataHome}/maildir"; + inherit accounts; + }; +} diff --git a/hm/soispha/conf/mail/non_public_accounts.nix b/hm/soispha/conf/mail/non_public_accounts.nix new file mode 100644 index 00000000..0076aebd Binary files /dev/null and b/hm/soispha/conf/mail/non_public_accounts.nix differ diff --git a/hm/soispha/conf/mako/default.nix b/hm/soispha/conf/mako/default.nix new file mode 100644 index 00000000..711457f2 --- /dev/null +++ b/hm/soispha/conf/mako/default.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + ... +}: { + services.mako = { + enable = true; + backgroundColor = "#2e3440"; + borderColor = "#88c0d0"; + borderRadius = 25; + borderSize = 2; + defaultTimeout = 5000; + font = "Source Code Pro 10"; + width = 500; + height = 500; + icons = true; + ignoreTimeout = true; + layer = "overlay"; + markup = true; # TODO: + maxIconSize = 64; + sort = "-time"; + extraConfig = '' + [urgency=low] + border-color=#cccccc + + [urgency=normal] + border-color=#d08770 + + [urgency=high] + border-size=3 + border-color=#bf616a + default-timeout=0 + + [urgency=critical] + border-size=4 + border-color=#bf616a + default-timeout=0 + + [category=mpd] + default-timeout=2000 + group-by=category + ''; + }; +} diff --git a/hm/soispha/conf/mbsync/default.nix b/hm/soispha/conf/mbsync/default.nix new file mode 100644 index 00000000..ac9808c9 --- /dev/null +++ b/hm/soispha/conf/mbsync/default.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: { + # TODO: I have no clue if both are needed, but it looks neat, right? + programs.mbsync = { + enable = true; + }; + services.mbsync = { + enable = true; + # TODO: enable after isync 1.5 drops + #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf"; + }; + # Disable the timer, and only activate it on neomutt start + systemd.user.timers.mbsync = lib.mkForce {}; +} diff --git a/hm/soispha/conf/mpd/default.nix b/hm/soispha/conf/mpd/default.nix new file mode 100644 index 00000000..bbd345a7 --- /dev/null +++ b/hm/soispha/conf/mpd/default.nix @@ -0,0 +1,39 @@ +{ + config, + pkgs, + lib, + osConfig, + ... +}: let + dataDir = "${config.xdg.dataHome}/mpd"; + playlistDirectory = "${dataDir}/playlists"; + runtimeDir = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd"; +in { + systemd.user.services.mpd.Service.ExecStartPre = lib.mkForce '' + ${pkgs.coreutils}/bin/mkdir -p "${dataDir}" "${playlistDirectory}" "${runtimeDir}" + ''; + services.mpd = { + enable = true; + inherit dataDir; + musicDirectory = "~/media/music"; + network = { + listenAddress = "${runtimeDir}/socket"; + }; + extraConfig = '' + metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc,comment" + auto_update "yes" + + audio_output { + type "pipewire" + name "pipewire" + } + #database { + # plugin "simple" + # path "~/.local/share/mpd/db + # cache_directory "~/.local/share/mpd/cache" + #} + + filesystem_charset "UTF-8" + ''; + }; +} diff --git a/hm/soispha/conf/mpd/mpdconf.example b/hm/soispha/conf/mpd/mpdconf.example new file mode 100644 index 00000000..eaa5e641 --- /dev/null +++ b/hm/soispha/conf/mpd/mpdconf.example @@ -0,0 +1,418 @@ +# An example configuration file for MPD. +# Read the user manual for documentation: http://www.musicpd.org/doc/user/ + + +# Files and directories ####################################################### +# +# This setting controls the top directory which MPD will search to discover the +# available audio files and add them to the daemon's online database. This +# setting defaults to the XDG directory, otherwise the music directory will be +# be disabled and audio files will only be accepted over ipc socket (using +# file:// protocol) or streaming files over an accepted protocol. +# +#music_directory "~/music" +# +# This setting sets the MPD internal playlist directory. The purpose of this +# directory is storage for playlists created by MPD. The server will use +# playlist files not created by the server but only if they are in the MPD +# format. This setting defaults to playlist saving being disabled. +# +#playlist_directory "~/.mpd/playlists" +# +# This setting sets the location of the MPD database. This file is used to +# load the database at server start up and store the database while the +# server is not up. This setting defaults to disabled which will allow +# MPD to accept files over ipc socket (using file:// protocol) or streaming +# files over an accepted protocol. +# +#db_file "~/.mpd/database" + +# These settings are the locations for the daemon log files for the daemon. +# +# The special value "syslog" makes MPD use the local syslog daemon. This +# setting defaults to logging to syslog. +# +# If you use systemd, do not configure a log_file. With systemd, MPD +# defaults to the systemd journal, which is fine. +# +#log_file "~/.mpd/log" + +# This setting sets the location of the file which stores the process ID +# for use of mpd --kill and some init scripts. This setting is disabled by +# default and the pid file will not be stored. +# +# If you use systemd, do not configure a pid_file. +# +#pid_file "~/.mpd/pid" + +# This setting sets the location of the file which contains information about +# most variables to get MPD back into the same general shape it was in before +# it was brought down. This setting is disabled by default and the server +# state will be reset on server start up. +# +#state_file "~/.mpd/state" +# +# The location of the sticker database. This is a database which +# manages dynamic information attached to songs. +# +#sticker_file "~/.mpd/sticker.sql" +# +############################################################################### + + +# General music daemon options ################################################ +# +# This setting specifies the user that MPD will run as. MPD should never run as +# root and you may use this setting to make MPD change its user ID after +# initialization. This setting is disabled by default and MPD is run as the +# current user. +# +#user "nobody" +# +# This setting specifies the group that MPD will run as. If not specified +# primary group of user specified with "user" setting will be used (if set). +# This is useful if MPD needs to be a member of group such as "audio" to +# have permission to use sound card. +# +#group "nogroup" +# +# This setting sets the address for the daemon to listen on. Careful attention +# should be paid if this is assigned to anything other than the default, any. +# This setting can deny access to control of the daemon. Not effective if +# systemd socket activation is in use. +# +# For network +#bind_to_address "any" +# +# And for Unix Socket +#bind_to_address "~/.mpd/socket" +# +# This setting is the TCP port that is desired for the daemon to get assigned +# to. +# +#port "6600" +# +# Suppress all messages below the given threshold. Use "verbose" for +# troubleshooting. Available setting arguments are "notice", "info", "verbose", +# "warning" and "error". +# +#log_level "notice" +# +# Setting "restore_paused" to "yes" puts MPD into pause mode instead +# of starting playback after startup. +# +#restore_paused "no" +# +# This setting enables MPD to create playlists in a format usable by other +# music players. +# +#save_absolute_paths_in_playlists "no" +# +# This setting defines a list of tag types that will be extracted during the +# audio file discovery process. The complete list of possible values can be +# found in the user manual. +#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" +# +# This example just enables the "comment" tag without disabling all +# the other supported tags: +#metadata_to_use "+comment" +# +# This setting enables automatic update of MPD's database when files in +# music_directory are changed. +# +#auto_update "yes" +# +# Limit the depth of the directories being watched, 0 means only watch +# the music directory itself. There is no limit by default. +# +#auto_update_depth "3" +# +############################################################################### + + +# Symbolic link behavior ###################################################### +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links outside of the configured music_directory. +# +#follow_outside_symlinks "yes" +# +# If this setting is set to "yes", MPD will discover audio files by following +# symbolic links inside of the configured music_directory. +# +#follow_inside_symlinks "yes" +# +############################################################################### + + +# Zeroconf / Avahi Service Discovery ########################################## +# +# If this setting is set to "yes", service information will be published with +# Zeroconf / Avahi. +# +#zeroconf_enabled "yes" +# +# The argument to this setting will be the Zeroconf / Avahi unique name for +# this MPD server on the network. %h will be replaced with the hostname. +# +#zeroconf_name "Music Player @ %h" +# +############################################################################### + + +# Permissions ################################################################# +# +# If this setting is set, MPD will require password authorization. The password +# setting can be specified multiple times for different password profiles. +# +#password "password@read,add,control,admin" +# +# This setting specifies the permissions a user has who has not yet logged in. +# +#default_permissions "read,add,control,admin" +# +############################################################################### + + +# Database ####################################################################### +# +# An example of a database section instead of the old 'db_file' setting. +# It enables mounting other storages into the music directory. +# +#database { +# plugin "simple" +# path "~/.local/share/mpd/db +# cache_directory "~/.local/share/mpd/cache" +#} +# +# An example of database config for a satellite setup +# +#music_directory "nfs://fileserver.local/srv/mp3" +#database { +# plugin "proxy" +# host "other.mpd.host" +# port "6600" +#} + +# Input ####################################################################### +# +input { + plugin "curl" +# proxy "proxy.isp.com:8080" +# proxy_user "user" +# proxy_password "password" +} + +# +############################################################################### + +# Audio Output ################################################################ +# +# MPD supports various audio output types, as well as playing through multiple +# audio outputs at the same time, through multiple audio_output settings +# blocks. Setting this block is optional, though the server will only attempt +# autodetection for one sound card. +# +# An example of an ALSA output: +# +#audio_output { +# type "alsa" +# name "My ALSA Device" +## device "hw:0,0" # optional +## mixer_type "hardware" # optional +## mixer_device "default" # optional +## mixer_control "PCM" # optional +## mixer_index "0" # optional +#} +# +# An example of an OSS output: +# +#audio_output { +# type "oss" +# name "My OSS Device" +## device "/dev/dsp" # optional +## mixer_type "hardware" # optional +## mixer_device "/dev/mixer" # optional +## mixer_control "PCM" # optional +#} +# +# An example of a shout output (for streaming to Icecast): +# +#audio_output { +# type "shout" +# encoder "vorbis" # optional +# name "My Shout Stream" +# host "localhost" +# port "8000" +# mount "/mpd.ogg" +# password "hackme" +# quality "5.0" +# bitrate "128" +# format "44100:16:1" +## protocol "icecast2" # optional +## user "source" # optional +## description "My Stream Description" # optional +## url "http://example.com" # optional +## genre "jazz" # optional +## public "no" # optional +## timeout "2" # optional +## mixer_type "software" # optional +#} +# +# An example of a recorder output: +# +#audio_output { +# type "recorder" +# name "My recorder" +# encoder "vorbis" # optional, vorbis or lame +# path "/var/lib/mpd/recorder/mpd.ogg" +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +#} +# +# An example of a httpd output (built-in HTTP streaming server): +# +#audio_output { +# type "httpd" +# name "My HTTP Stream" +# encoder "vorbis" # optional, vorbis or lame +# port "8000" +# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 +## quality "5.0" # do not define if bitrate is defined +# bitrate "128" # do not define if quality is defined +# format "44100:16:1" +# max_clients "0" # optional 0=no limit +#} +# +# An example of a pulseaudio output (streaming to a remote pulseaudio server) +# +#audio_output { +# type "pulse" +# name "My Pulse Output" +## server "remote_server" # optional +## sink "remote_server_sink" # optional +## media_role "media_role" #optional +#} +# +# An example of a winmm output (Windows multimedia API). +# +#audio_output { +# type "winmm" +# name "My WinMM output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## mixer_type "hardware" # optional +#} +# +# An example of a wasapi output (Windows multimedia API). +# +#audio_output { +# type "wasapi" +# name "My WASAPI output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +# or +## device "0" # optional +## Exclusive mode blocks all other audio source, and get best audio quality without resampling. +## exclusive "no" # optional +## Enumerate all devices in log. +## enumerate "no" # optional +#} +# +# An example of an openal output. +# +#audio_output { +# type "openal" +# name "My OpenAL output" +## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional +#} +# +# An example of an sndio output. +# +#audio_output { +# type "sndio" +# name "sndio output" +# mixer_type "hardware" +#} +# +# An example of an OS X output: +# +#audio_output { +# type "osx" +# name "My OS X Device" +## device "Built-in Output" # optional +## channel_map "-1,-1,0,1" # optional +#} +# +## Example "pipe" output: +# +#audio_output { +# type "pipe" +# name "my pipe" +# command "aplay -f cd 2>/dev/null" +## Or if you're want to use AudioCompress +# command "AudioCompress -m | aplay -f cd 2>/dev/null" +## Or to send raw PCM stream through PCM: +# command "nc example.org 8765" +# format "44100:16:2" +#} +# +## An example of a null output (for no audio output): +# +#audio_output { +# type "null" +# name "My Null Output" +# mixer_type "none" # optional +#} +# +############################################################################### + + +# Normalization automatic volume adjustments ################################## +# +# This setting specifies the type of ReplayGain to use. This setting can have +# the argument "off", "album", "track" or "auto". "auto" is a special mode that +# chooses between "track" and "album" depending on the current state of +# random playback. If random playback is enabled then "track" mode is used. +# See for +# more details about ReplayGain. +# This setting is off by default. +# +#replaygain "album" +# +# This setting sets the pre-amp used for files that have ReplayGain tags. By +# default this setting is disabled. +# +#replaygain_preamp "0" +# +# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. +# By default this setting is disabled. +# +#replaygain_missing_preamp "0" +# +# This setting enables or disables ReplayGain limiting. +# MPD calculates actual amplification based on the ReplayGain tags +# and replaygain_preamp / replaygain_missing_preamp setting. +# If replaygain_limit is enabled MPD will never amplify audio signal +# above its original level. If replaygain_limit is disabled such amplification +# might occur. By default this setting is enabled. +# +#replaygain_limit "yes" +# +# This setting enables on-the-fly normalization volume adjustment. This will +# result in the volume of all playing audio to be adjusted so the output has +# equal "loudness". This setting is disabled by default. +# +#volume_normalization "no" +# +############################################################################### + +# Character Encoding ########################################################## +# +# If file or directory names do not display correctly for your locale then you +# may need to modify this setting. +# +#filesystem_charset "UTF-8" +# +############################################################################### diff --git a/hm/soispha/conf/mpv/default.nix b/hm/soispha/conf/mpv/default.nix new file mode 100644 index 00000000..1e10f2ef --- /dev/null +++ b/hm/soispha/conf/mpv/default.nix @@ -0,0 +1,10 @@ +{ + config, + pkgs, + ... +}: { + programs.mpv = { + enable = true; + # TODO: add config + }; +} diff --git a/hm/soispha/conf/mumble/Mumble.conf b/hm/soispha/conf/mumble/Mumble.conf new file mode 100644 index 00000000..2d895f41 --- /dev/null +++ b/hm/soispha/conf/mumble/Mumble.conf @@ -0,0 +1,67 @@ +[General] +databaselocation=/home/soispha/.local/share/Mumble/Mumble/mumble.sqlite +lastupdate=3 + +[audio] +headphone=true +input=PipeWire +loudness=1549 +output=PipeWire +quality=72000 +vadmax=@Variant(\0\0\0\x87?Kw\x97) +vadmin=@Variant(\0\0\0\x87?7\x1e\xd4) + +[messages] +10\log=13 +12\log=13 +14\log=13 +15\log=13 +17\log=13 +18\log=13 +19\log=13 +2\log=13 +20\log=13 +21\log=13 +22\log=13 +23\log=13 +25\log=13 +26\log=13 +27\log=13 +28\log=13 +29\log=13 +30\log=13 +31\log=13 +5\log=13 +6\log=13 +9\log=13 +size=32 + +[messagesounds] +size=31 + +[net] +certificate="@ByteArray(0\x82\tX\x2\x1\x3\x30\x82\t\xe\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\b\xff\x4\x82\b\xfb\x30\x82\b\xf7\x30\x82\x3\xad\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x3\x9e\x4\x82\x3\x9a\x30\x82\x3\x96\x30\x82\x3\x92\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x3\xa0\x82\x3+0\x82\x3'\x6\n*\x86H\x86\xf7\r\x1\t\x16\x1\xa0\x82\x3\x17\x4\x82\x3\x13\x30\x82\x3\xf\x30\x82\x1\xf7\xa0\x3\x2\x1\x2\x2\x1\x1\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x30\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x1e\x17\r230710132716Z\x17\r430705132716Z0\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x82\x1\"0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x3\x82\x1\xf\0\x30\x82\x1\n\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\xa3h0f0\f\x6\x3U\x1d\x13\x1\x1\xff\x4\x2\x30\0\x30\x13\x6\x3U\x1d%\x4\f0\n\x6\b+\x6\x1\x5\x5\a\x3\x2\x30\x1d\x6\x3U\x1d\xe\x4\x16\x4\x14\xb9\x41\x19t\x16\x18~\xe8\v\xa9\x9b\x86i\x86\xeP%\xd7\n\xc9\x30\"\x6\t`\x86H\x1\x86\xf8\x42\x1\r\x4\x15\x16\x13Generated by Mumble0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x3\x82\x1\x1\0\x91+\r'hS\xc2\x12k\x13O\xb2\"\x85\xd6w\x96\x8a\x97\x46\xee\x95Q\x8b\x8b\t\x8a\xfcH\xab\x30\x1dxV\xc9\xf5\x80\x42;'o\xf1\xd1\xf2\xfb\x18\xe2+\x8d\x39 \xc3\xe\x44\xa9\t\xe2i\x8a\xa7?#\xcd]0\xf4\x1d\x4\a\xd6\x87\x62\xe2\xd8\x34\xb6\xcf\x89\xf2\v\xf1\x8b\xc6\xf8\x8f\x94H/\xfa`\x9d\xb5\xac\x66H\xef\xf4\tJ\xfeHg]!\xed\n\xaf\xa8nd@y\xe8>A\x10\xc4>\xc3\xf7\xe3\xffW\x90T\x87\x94[\x7fg0+p\xdd\x3\x8d\xdb\x80\f?\xe9\xf9l5\xac)z+4R\xbc\xf3\xe1\x82\xde\xc3u\xb2\xa1s\xe2\xbb\xdcpL#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0\x82\x5\x42\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x5\x33\x4\x82\x5/0\x82\x5+0\x82\x5'\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x1\xa0\x82\x4\xc0\x30\x82\x4\xbc\x2\x1\0\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x4\x82\x4\xa6\x30\x82\x4\xa2\x2\x1\0\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\x2\x82\x1\0\x4\xd6\xf2\x66\v\xe0\xae\xc6(\xccw\x91Ub\xfe\xd8\x7f\x97\x92\xa2Imc\x16\xaf}y\x8a\x14,\xe3\x90\xbc\x63!\xb2\aQ\xdbQ\x1f\xbc\xbc\x62\\\xd0\xc2\xa5\xf2-\xcc\xdc\x19\xd0\xe4\xcc\x8ey\xb7\xd1\xac\xcfP\x8du\x94\xa4\x3u\x1b;\xe5\xa2\x61\x12\xd1R\xaaZ\v\xe7\x8d\xf0\xabl\xce\xba\x99\xbd\x95\xdbpkCJr\xfb\xc5P9\x1e\xf\xb1iI9&\xeb\x62\x8a#\xa7\x17\xcbw\x92\xf9\xf7JZ\xa6;F\xb3\xba\xb1H\x89]uU7\x1e\xd7\xf6U`\x8d\xa1\x1aG7\x11\x31\xbf\xf4\xdb\x32\x63\xbf\x3\xad&h\x82\x9b\xe7\x19/\xf6\r\x8c\x89\xc6\xd0\x1d\0\x87\t|\xc0\xf2\x8f\xbb\x87_8{\xf2\xc7\x8a\x34)\xe3\xf1\xcc(\xf4\xee\xeb($\x5\x84\xaf\x1\xaa\xf7\xff\x9b\x15h\x2y\xb3\x91\xba,Oq\xc9$\x81\x11Zg\xc4I3\v\xeay\f\xf0\x33\xc6p\xea\xc6\x9d\xac\xaa\xedp\xa7!\xcbHf5\xa0i\xbdo@\xb8![\x7f\xea\xad\x6\x31p\x81\x61\x2\x81\x81\0\xdc\x8d}{\xc3\x31\xb6(F\xc5\x36\x9b\xba\x66\xb1\xce\r_\x90\xc6\x1f\x87\x37\x84m\xd1\a8\xc0\v9\xe0\x8bm\xaf\x64\xbe\x81\xa8\xe7\xaf\x19\x43,vj\xaf!9rz\x87\"\xca\xbf\xcf\x16\x88\x46t\xbd\x12\xaa;\xf4x_\x1b\xb3\x90\b\xb6\xf6\xec\x1f\x95\x62\xac\xfa\x1b\xae\xa2\xa7oA\x9bhOW\xa8\x44\\\xadz T\xe3\x43\x46\x99\x98\xb4{*\"\xdb\xd9\xc8\xd2\x15\n4\"\x8d\x96$\x17\xfd^\xf7\x84\x93\x7fw{o\0\xe1\x2\x81\x81\0\xd0hNA\xc3\x9e\x93&iq\x1dQ\xb6\xc6\x1c\x32\xf3\xfc c&Y\xe7|\xbeq2P\xe1\xdb\x97\xf8\x9fI(\x98\x9d\xf1\xfe\xb6\xf\x90\xa5\xebi>\x14\x6\xd8.\xf4\xce\x86\x9d*\x87 \xf9X\x4\xdcZ\xf9g\x3\x98H{\xdf\x66\xde\xd6zr\xecG_\x14t\x1dm%P\xe5\xea\x8e\x6\xa2. \xa1\xd7\xd7W]\xdd\x15\x6\xcf+/\x11\vel\xd3\xe8\xc3/\xbc\x1f\xc3n\xd4\xb8\x62j\xf5\xc0\xc0\x89\xe3z\xb8\x36\xd5\xb2\xa3\x2\x81\x80z`W\xdc\x30\x36\x89(W\xfc]\x8c\x93% K\x80\xc8\"\0\x8c\xc5\xee\\ \xc2\xf7\n\xda$`|\xe3`}\r\x9dWV\xa8\0\xc9\xcd\xd2\xc4\f\xe4\x8d%k+\x16\xbc.\n\xf7\x44\x9d\xd6\xfc\x1a\x88\x8a\xdd\x11J\xd9\xc4%\xe6g\xd8\xbc.\xe2\x11/J\x81\x2\x81\x80\x63;W\xf\xbf:1,\x98\x6\x31\x4\xa8wz\x13\xd4\xd2\x97\x5>\xcc\x8e\tz\x90\x61y\xdb\xa0\xf8\xa2|\r\x94\x93\xde\x98\xcc\x44\x19\xf3\x30\xdd\x7fu\xfc\x89)\xc4i\xf2\x30l\x83\x44\x66\x31\xf3t\x15\f\b6\xc1\xa2o\xd8\xf3\x8d\x82\xcb\x32\xf0\xa7\x8ap>G\xef~\xf9\xc6\xa4\x42\xe3\xafJ\xe7\x95\xc8\x1a\x2\xc1\xe9\xc2\x8b\xf1{\x11?\xce\xe8\xd3\x39WI<.\xedo^Y\xd6U\x99\x1e\xfe\xb6\xf1\xb6v'\a\xb1\xac\\\xeb\x2\x81\x80@\x19\xc4\x32&\xcb\xc1\xca\x10K\xdf\x45\xf9\xf\x1d\x85\x39\x65\xdc\x33\x45\xbe\xac\x97~;\xe2m-\xd6\x9b\x82\x1\xbd\x90'W\xf5\xf5\xce\x35\xd7\xb4\xcdidTiP\\-vG+`\xb5u\xb7\x14\x44\xe1\xd9\xd3\r\x81\xb0GL\xe1U\xe3\xf0\xaa\xd1\x8f\xc6\"\xa5S\xb6\xbf\x4\x1a\xc4\xe0|\x8d\xa2+y(-\xad\ty\xd5\xe2g\xd3\x8c\xcdl\x96g3\xfe\x80\xb7|b[\xca\xb2\xbf\x61\xf7\x9c\x65\x30\x61\xa0\x35\xf6W\xb4\xcc\xdd\x34\x31T0#\x6\t*\x86H\x86\xf7\r\x1\t\x15\x31\x16\x4\x14\x9f\xdc\xf9\x38\xc2\x8a\x1c\xfe\x6}\xf6\x64\x62>L#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0A010\r\x6\t`\x86H\x1\x65\x3\x4\x2\x1\x5\0\x4 Fm\xb6/lL\x18\x1b!\xfa+x\xb5\xd9?GrR\xb7\xd3\x90\xc1N)L\x9c\xc7')\xe^\xbe\x4\b\x8b\x2\xb2\xb2\x97\b\x8a\xf6\x2\x2\b\0)" +framesperpacket=1 + +[overlay] +blacklist=@Invalid() +blacklistexclude=@Invalid() +launchers=@Invalid() +launchersexclude=@Invalid() +paths=@Invalid() +pathsexclude=@Invalid() +version=1.4.0 +whitelist=@Invalid() +whitelistexclude=@Invalid() + +[shortcuts] +size=0 + +[ui] +HighContrast=true +connect\geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m)" +connect\header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2&\0\0\0\x3\x1\x1\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x3\0\0\x1w\0\0\0\x1\0\0\0\x1\0\0\0S\0\0\0\x1\0\0\0\x3\0\0\0\\\0\0\0\x1\0\0\0\x3\0\0\x3\xe8\0\0\0\0\x64) +geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa\0\0\n\0\0\0\0\0\0\0\f\xde\0\0\x1\xb2\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa) +header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2\xb0\0\0\0\x1\x1\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x1\0\0\x2\xb0\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64) +server=mumble.vhack.eu +state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\0\0\0\x1\0\0\0\x3\xbd\xfc\x2\0\0\0\x2\xfb\0\0\0\f\0q\0\x64\0w\0L\0o\0g\x1\0\0\0>\0\0\x3\xa0\0\0\0z\0\xff\xff\xff\xfb\0\0\0\xe\0q\0\x64\0w\0\x43\0h\0\x61\0t\x1\0\0\x3\xe2\0\0\0\x19\0\0\0\x19\0\0\0\x19\0\0\x2\xb6\0\0\x3\xbd\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x1a\0q\0t\0I\0\x63\0o\0n\0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) diff --git a/hm/soispha/conf/mumble/default.nix b/hm/soispha/conf/mumble/default.nix new file mode 100644 index 00000000..6fa524dc --- /dev/null +++ b/hm/soispha/conf/mumble/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."Mumble/Mumble.conf".source = ./Mumble.conf; +} diff --git a/hm/soispha/conf/neomutt/default.nix b/hm/soispha/conf/neomutt/default.nix new file mode 100644 index 00000000..e4fbcb39 --- /dev/null +++ b/hm/soispha/conf/neomutt/default.nix @@ -0,0 +1,168 @@ +{pkgs, ...}: { + programs.neomutt = { + enable = true; + package = pkgs.writeShellScriptBin "neomutt" '' + systemctl --user start mbsync.service; + ${pkgs.neomutt}/bin/neomutt; + ''; + vimKeys = false; # see the modified ones below + checkStatsInterval = 60; + binds = [ + #------------------------------------------------------------ + # Vi Key Bindings (taken from their configuration, modified for dvorak) + #------------------------------------------------------------ + + # Moving around + { + action = "noop"; + key = "g"; + map = ["attach" "browser" "index"]; + } + { + action = "first-entry"; + key = "gg"; + map = ["attach" "browser" "index"]; + } + { + action = "last-entry"; + key = "G"; + map = ["attach" "browser" "index"]; + } + { + action = "noop"; + key = "g"; + map = ["pager"]; + } + { + action = "top"; + key = "gg"; + map = ["pager"]; + } + { + action = "bottom"; + key = "G"; + map = ["pager"]; + } + { + action = "previous-line"; + key = "n"; + map = ["pager"]; + } + { + action = "next-line"; + key = "t"; + map = ["pager"]; + } + + # Scrolling + { + action = "next-page"; + key = "\\CF"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "previous-page"; + key = "\\CB"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "half-up"; + key = "\\Cu"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "half-down"; + key = "\\Cd"; + map = ["attach" "browser" "pager" "index"]; + } + { + action = "next-line"; + key = "\\Ce"; + map = ["browser" "pager"]; + } + { + action = "previous-line"; + key = "\\Cy"; + map = ["browser" "pager"]; + } + { + action = "next-line"; + key = "\\Ce"; + map = ["index"]; + } + { + action = "previous-line"; + key = "\\Cy"; + map = ["index"]; + } + + { + action = "noop"; + key = "d"; + map = ["pager" "index"]; + } + { + action = "delete-message"; + key = "dd"; + map = ["pager" "index"]; + } + + # Mail & Reply + { + # Doesn't work currently + action = "list-reply"; + key = "\\Cm"; + map = ["index"]; + } + + # Threads + { + action = "search-opposite"; + key = "N"; + map = ["browser" "pager" "index"]; + } + { + action = "delete-thread"; + key = "dT"; + map = ["pager" "index"]; + } + { + action = "delete-subthread"; + key = "dt"; + map = ["pager" "index"]; + } + { + action = "next-thread"; + key = "gt"; + map = ["pager" "index"]; + } + { + action = "previous-thread"; + key = "gT"; + map = ["pager" "index"]; + } + { + action = "collapse-thread"; + key = "za"; + map = ["index"]; + } + { + # Missing: folddisable/foldenable + action = "collapse-all"; + key = "zA"; + map = ["index"]; + } + + { + action = "search-next"; + key = "l"; + map = ["index"]; + } + { + action = "limit"; + key = "f"; + map = ["index"]; + } + ]; + }; +} diff --git a/hm/soispha/conf/nheko/default.nix b/hm/soispha/conf/nheko/default.nix new file mode 100644 index 00000000..fd147c0b --- /dev/null +++ b/hm/soispha/conf/nheko/default.nix @@ -0,0 +1,13 @@ +{ + config, + nixosConfig, + lib, + ... +}: { + config = lib.mkIf nixosConfig.soispha.secrets.enable { + xdg.configFile."nheko/nheko.conf".source = config.lib.file.mkOutOfStoreSymlink nixosConfig.age.secrets.nheko.path; + programs.nheko = { + enable = true; + }; + }; +} diff --git a/hm/soispha/conf/npm/.npmrc b/hm/soispha/conf/npm/.npmrc new file mode 100644 index 00000000..d0d846bd --- /dev/null +++ b/hm/soispha/conf/npm/.npmrc @@ -0,0 +1,6 @@ +scripts-prepend-node-path=true +node_gyp= +prefix=${XDG_DATA_HOME}/npm +cache=${XDG_CACHE_HOME}/npm +tmp=${XDG_RUNTIME_DIR}/npm +init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/hm/soispha/conf/npm/default.nix b/hm/soispha/conf/npm/default.nix new file mode 100644 index 00000000..7b4bb6a1 --- /dev/null +++ b/hm/soispha/conf/npm/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."npm/.npmrc".source = ./.npmrc; +} diff --git a/hm/soispha/conf/nvim/autocmds/default.nix b/hm/soispha/conf/nvim/autocmds/default.nix new file mode 100644 index 00000000..cb0311fb --- /dev/null +++ b/hm/soispha/conf/nvim/autocmds/default.nix @@ -0,0 +1,99 @@ +{config, ...}: { + programs.nixvim = { + autoGroups = { + cursor_off = {clear = true;}; + colorcolumn_toggle = {clear = true;}; + numbertoggle = {clear = true;}; + coloroverride = {clear = true;}; + highlight_on_yank = {clear = true;}; + }; + autoCmd = [ + { + event = ["TextYankPost"]; + pattern = ["*"]; + callback = { + __raw = '' + function() + vim.highlight.on_yank() + end + ''; + }; + group = "highlight_on_yank"; + description = "Highlight the yanked text"; + } + { + event = ["BufWritePre"]; + pattern = ["*"]; + command = '' + ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's + ''; + description = '' + Remove trailing whitespace on safe + :%s/\s\+$\| \+\ze\t//g >> For trailing spaces and spaces before tabstops + ''; + } + + { + event = ["WinLeave"]; + pattern = ["*"]; + command = "set nocursorline"; # TODO: possible also nocursorcolumn + group = "cursor_off"; + description = "Display cursorline and cursorcolumn ONLY in active window."; + } + { + event = ["WinEnter"]; + pattern = ["*"]; + command = "set cursorline"; # TODO: possible also cursorcolumn + group = "cursor_off"; + description = "Display cursorline and cursorcolumn ONLY in active window."; + } + + { + event = ["InsertEnter"]; + pattern = ["*"]; + command = "set colorcolumn=${config.programs.nixvim.options.colorcolumn}"; + group = "colorcolumn_toggle"; + description = "Only activate the colorcolumn when focused"; + } + { + event = ["BufLeave" "FocusLost" "InsertLeave" "WinLeave"]; + pattern = ["*"]; + command = "set colorcolumn=0"; + group = "colorcolumn_toggle"; + description = "Only activate the colorcolumn when focused"; + } + + { + event = ["BufEnter" "FocusGained" "InsertLeave" "WinEnter"]; + pattern = ["*"]; + command = "if &nu && mode() != \"i\" | set rnu | endif"; + group = "numbertoggle"; + description = "Change line numbers, when not focused"; + } + { + event = ["BufLeave" "FocusLost" "InsertEnter" "WinLeave"]; + pattern = ["*"]; + command = "if &nu | set nornu | endif"; + group = "numbertoggle"; + description = "Change line numbers, when not focused"; + } + + { + # Override LineNr + event = ["ColorScheme"]; + pattern = ["*"]; + command = "highlight LineNr ctermfg=DarkGrey guifg=DarkGrey "; + group = "coloroverride"; + description = "Changes Line number colors"; + } + { + # Override CursorLineNr + event = ["ColorScheme"]; + pattern = ["*"]; + command = "highlight CursorLineNr ctermfg=White guifg=White "; + group = "coloroverride"; + description = "Changes Line number colors"; + } + ]; + }; +} diff --git a/hm/soispha/conf/nvim/clipboard/default.nix b/hm/soispha/conf/nvim/clipboard/default.nix new file mode 100644 index 00000000..0a686190 --- /dev/null +++ b/hm/soispha/conf/nvim/clipboard/default.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + clipboard.providers = { + wl-copy.enable = true; + }; + }; +} diff --git a/hm/soispha/conf/nvim/default.nix b/hm/soispha/conf/nvim/default.nix new file mode 100644 index 00000000..61467618 --- /dev/null +++ b/hm/soispha/conf/nvim/default.nix @@ -0,0 +1,48 @@ +{ + pkgs, + lib, + ... +}: { + imports = [ + ./autocmds + ./clipboard + ./files + ./mappings + ./options + ./plugins + ]; + programs.nixvim = { + enable = true; + + # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim + extraConfigLuaPre = lib.mkBefore '' + --------------------------------------------------------------------------- + -- + -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ + -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ + -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ + -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ + -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ + -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ + -- + --------------------------------------------------------------------------- + ''; + + extraPackages = with pkgs; [ + /* + These are mostly linters and formatters used for different file types. + Including them here is fine, as they are not necessarily sync able to different people. + */ + # nix + alejandra + statix + + # yaml + yamllint + + # shell + shellcheck + shfmt + ]; + }; +} diff --git a/hm/soispha/conf/nvim/files/default.nix b/hm/soispha/conf/nvim/files/default.nix new file mode 100644 index 00000000..5045eb9f --- /dev/null +++ b/hm/soispha/conf/nvim/files/default.nix @@ -0,0 +1,17 @@ +{ + lib, + pkgs, + ... +}: { + programs.nixvim = { + extraPlugins = [ + pkgs.vimExtraPlugins.gruvbox + ]; + extraFiles = { + path = "ftplugin/tex.lua"; + content = '' + ${lib.strings.fileContents ./ftplugin/tex.lua} + ''; + }; + }; +} diff --git a/hm/soispha/conf/nvim/files/ftplugin/tex.lua b/hm/soispha/conf/nvim/files/ftplugin/tex.lua new file mode 100644 index 00000000..8f39d7bb --- /dev/null +++ b/hm/soispha/conf/nvim/files/ftplugin/tex.lua @@ -0,0 +1,78 @@ +-- local used = false; +-- vim.keymap.set('n', 't', function() +-- used = not used; +-- if used then +-- require('nvim-treesitter.configs').setup { +-- highlight = { +-- additional_vim_regex_highlighting = { "latex", "markdown" }, +-- }, +-- } +-- else +-- require('nvim-treesitter.configs').setup { +-- highlight = { +-- additional_vim_regex_highlighting = { "" }, +-- }, +-- } +-- end +-- end +-- ); +-- +-- +-- Set non-treesitter colorscheme +require("gruvbox").setup({ + undercurl = true; + underline = true; + bold = true; + italic = { strings = true; comments = true; operators = false; folds = true; }; + strikethrough = true; + invert_selection = false; + invert_signs = false; + invert_tabline = false; + invert_intend_guides = false; + inverse = true; -- invert background for search, diffs, statuslines and errors + contrast = ""; -- can be "hard", "soft" or empty string + palette_overrides = {}; + overrides = {}; + dim_inactive = false; + transparent_mode = false; +}) +vim.cmd("colorscheme gruvbox") + +require("lualine").setup({ options = { theme = "gruvbox"; }; }) + +-- Set tex specific telescope extension +require("telescope").setup({ + extensions = { + bibtex = { + -- Depth for the *.bib file + depth = 1; + -- Path to global bibliographies (placed outside of the project) + global_files = {}; + -- Define the search keys to use in the picker + search_keys = { "author"; "year"; "title"; }; + -- Template for the formatted citation + citation_format = "{{author}} ({{year}}), {{title}}."; + -- Only use initials for the authors first name + citation_trim_firstname = true; + -- Max number of authors to write in the formatted citation + -- following authors will be replaced by "et al." + citation_max_auth = 2; + -- Wrapping in the preview window is disabled by default + wrap = false; + -- Custom format for citation label + custom_formats = { + { id = "tex_autocite"; cite_marker = "\\autocite{%s}"; }; + }; + format = "tex_autocite"; + -- Use context awareness + context = true; + -- Fallback to global/directory .bib files if context not found + -- This setting has no effect if context = false + context_fallback = true; + }; + }; +}) +require("telescope").load_extension("bibtex") +vim.api.nvim_set_keymap("n", "ib", function() + require("telescope").extensions.bibtex.bibtex() + end, { noremap = true; silent = true; desc = "list bibtex entries in telescope"; }) diff --git a/hm/soispha/conf/nvim/mappings/default.nix b/hm/soispha/conf/nvim/mappings/default.nix new file mode 100644 index 00000000..1d00b0a4 --- /dev/null +++ b/hm/soispha/conf/nvim/mappings/default.nix @@ -0,0 +1,222 @@ +{lib, ...}: { + programs.nixvim = { + globals = { + mapleader = " "; + maplocalleader = " "; + }; + maps = let + normal_and_insert = { + "" = { + action = "noh"; + desc = "Disable the search highlighting and send Escape"; + }; + }; + in { + insert = + lib.recursiveUpdate { + "hh" = { + action = '' + function() + local cmp = require('cmp'); + local luasnip = require('luasnip'); + + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end + ''; + lua = true; + desc = "completion trigger/ forward in completen menu"; + }; + "cc" = { + action = '' + function() + local cmp = require('cmp'); + cmp.confirm() + end + ''; + lua = true; + desc = "confirm the selected item"; + }; + } + normal_and_insert; + normalVisualOp = { + # yank/ cut to the system clipboard + "y" = { + action = "\"+y"; + desc = "yank to the system clipboard"; + }; + "Y" = { + action = "\"+Y"; + desc = "yank until the end of the line to the system clipboard"; + }; + + # Unmap some old keys + #"s" = "''"; + #"t" = "''"; + "" = ""; + "" = ""; + "" = ""; + "" = ""; + + # Center the cursor vertically when moving to the next word during a search. + "l" = { + action = "nzzzv"; + desc = "Center the cursor vertically when moving to the next word during a + search."; + }; + "L" = { + action = "Nzzzv"; + desc = "Center the cursor vertically when moving to the next word during a + search."; + }; + # remap the other keys to dvorak + "k" = { + action = "t"; + desc = "go the the right on char"; + }; + "K" = { + action = "T"; + desc = "go to the left on char"; + }; + "j" = { + action = "k"; + desc = "go to the right before the char"; + }; + "J" = { + action = "K"; + desc = "go to the left before the char"; + }; + + # Change Vim-keys + "h" = { + action = ""; + desc = "go left"; + }; + "t" = { + action = "g"; + desc = "go down, with displaylines"; + }; + "n" = { + action = "g"; + desc = "go up, with displaylines"; + }; + "s" = { + action = ""; + desc = "go right"; + }; + + # Move display lines + "0" = { + action = "g0"; + desc = "go to the leftmost character in the screen line"; + }; + "$" = { + action = "g$"; + desc = "go to the rightmost character in the screen line"; + }; + }; + normal = + lib.recursiveUpdate { + "" = { + action = ":"; + desc = "jump to command line"; + }; + + "\\f" = { + action = "function() require('lf').start() end"; + lua = true; + desc = "open lf in a floating window"; + }; + + # Splits + "" = { + action = "p"; + desc = "go to previous split"; + }; + "" = { + action = "w"; + desc = "go to next split"; + }; + "-" = { + action = "s"; + desc = "New horizontal split"; + }; + "|" = { + action = "v"; + desc = "New vertical split"; + }; + + # Exit insert mode after creating a new line above or below the current line."; + "o" = { + action = "o"; + desc = "add new line below"; + }; + "O" = { + action = "O"; + desc = "add new line above"; + }; + + "p" = { + action = "\"_dP"; + desc = "keep the cut thing in the base register"; + }; + + "d" = { + action = "\"_d"; + desc = "delete without saving to register"; + }; + "dd" = { + action = '' + function() + if vim.api.nvim_get_current_line():match("^%s*$") then + return '"_dd' + else + return "dd" + end + end + ''; + lua = true; + desc = "Pipe all blank line deletions to the blackhole register"; + expr = true; + silent = true; + }; + + "s" = { + action = ":%s/\\<\\>//gI"; + desc = "replace for the word under the cursor"; + }; + + "" = { + action = "mksession! "; + desc = "overwrite/create a session"; + }; + + "X" = { + action = "!!$SHELL "; + desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; + }; + } + normal_and_insert; + terminal = { + "" = { + action = ""; + desc = "Exit terminal mode with "; + }; + }; + visual = { + # move selected lines in visual mode + "T" = { + action = ":m '>+1gv=gv"; + desc = "move selected lines in visual mode down"; + }; + "N" = { + action = ":m '<-2gv=gv"; + desc = "move selected lines in visual mode up"; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/options/default.nix b/hm/soispha/conf/nvim/options/default.nix new file mode 100644 index 00000000..879a5cd1 --- /dev/null +++ b/hm/soispha/conf/nvim/options/default.nix @@ -0,0 +1,105 @@ +{nixosConfig, ...}: { + programs.nixvim.options = { + autoindent = true; # copy indent from previous line + cindent = true; # use c like indenting rules + breakindent = true; # continue indent visually + showbreak = "↳ "; # downwards arrow with tip rightwards(U+21B3, UTF-8: E2 86 B3) + breakindentopt = { + shift = 2; # wrapped line's beginning will be shifted by the given number of + }; + + incsearch = true; # show search results while typing + inccommand = "split"; # line preview of :s results + ignorecase = true; # ignore case when searching + smartcase = true; # if a capital letter is used in search, overwrite ignorecase + showmatch = true; # show matching words during a search. + hlsearch = true; # highlight when searching + + confirm = true; # confirm to save changes before closing modified buffer + colorcolumn = "+1"; # show a +1 before the 'textwidth' + completeopt = ["menuone" "noselect"]; # have a better completion experience + + # https://www.compart.com/en/unicode/U+XXXX (unicode character code) + # stylua: ignore + fillchars = { + fold = "·"; # MIDDLE DOT (U+00B7, UTF-8: C2 B7) + horiz = "━"; # BOX DRAWINGS HEAVY HORIZONTAL (U+2501, UTF-8: E2 94 81) + horizdown = "┳"; # BOX DRAWINGS HEAVY DOWN AND HORIZONTAL (U+2533, UTF-8: E2 94 B3) + horizup = "┻"; # BOX DRAWINGS HEAVY UP AND HORIZONTAL (U+253B, UTF-8: E2 94 BB) + vert = "┃"; # BOX DRAWINGS HEAVY VERTICAL (U+2503, UTF-8: E2 94 83) + vertleft = "┫"; # BOX DRAWINGS HEAVY VERTICAL AND LEFT (U+252B, UTF-8: E2 94 AB) + vertright = "┣"; # BOX DRAWINGS HEAVY VERTICAL AND RIGHT (U+2523, UTF-8: E2 94 A3) + verthoriz = "╋"; # BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL (U+254B, UTF-8: E2 95 8B) + }; + listchars = builtins.concatStringsSep "," [ + "nbsp:⦸" # CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8) + "tab:▷┅" # WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) + "extends:»" # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB) + "precedes:«" # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB) + "trail:•" # BULLET (U+2022, UTF-8: E2 80 A2) + ]; + + # shell-like autocomplete to unambiguous portions + wildmode = builtins.concatStringsSep "," [ + "longest" + "list" + "full" + ]; + + grepformat = "%f:%l:%c:%m"; # the default format for rg in vimgrep mode + grepprg = "rg --vimgrep"; # use rg as grep implementation in `:grep` + + hidden = true; # allows you to hide buffers with unsaved changes without being prompted + + laststatus = 3; # use global statusline # TODO: + + list = true; # show whitespace + + mouse = ""; # disables the mouse + + number = true; # line numbers + relativenumber = true; # relative line numbers + + # vim.opt.shada:append {'%'}; -- store buffers in the shada file and reopen them if nvim has been started without file name argument + + shell = nixosConfig.users.users.soispha.shell.pname; # try to use default shell for the default user as a shell for ":!" + + spell = true; # activate spell checking + spelllang = "en_us,de_de"; # set spell languages + spelloptions = "camel"; # CamelCase check if both camel and case are correct words + + syntax = "ON"; # use syntax highlighting and let nvim figure out which + + shiftwidth = 0; # use tabstop setting as shiftwidth + tabstop = 4; # use 4 spaces in place of a tab + expandtab = true; # expand tabs to spaces + + showtabline = 2; # always show the tabline + + timeoutlen = 500; # wait 500 msec for the next char in an input sequence + ttyfast = true; # let vim know that I am using a fast term + + undofile = true; # use a undofile, to save the undos + undolevels = 10000; # keep nearly all undo things stored + + virtualedit = "block"; # allow the cursor to move beyond actual character in visual block mode + + textwidth = 120; # automatically hard wrap at 120 columns by default + + foldmethod = "marker"; # use markers to specify folds + + termguicolors = true; + cursorline = true; + # vim.opt.cursorcolumn = true; + + scrolloff = 999; # try to keep at least 999 lines above and below the cursor (this effectively keeps the screen centered) + + linebreak = true; # break to long lines, but do only break them at [[::space::]] + + showcmd = true; # show partial command, being typed + showmode = true; # show the mode (Visual, Insert, Command) + + wildmenu = true; # shell completion + wildignore = "*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx"; # ignore binary files + }; +} diff --git a/hm/soispha/conf/nvim/plugins/colorscheme/default.nix b/hm/soispha/conf/nvim/plugins/colorscheme/default.nix new file mode 100644 index 00000000..21069752 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/colorscheme/default.nix @@ -0,0 +1,17 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package nightfox though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/nightfox.lua} + ${lib.strings.fileContents ./lua/mk_todos_readable.lua} + ''; + colorscheme = "duskfox"; + extraPlugins = [ + pkgs.vimExtraPlugins.nightfox-nvim + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua b/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua new file mode 100644 index 00000000..0145ec19 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/colorscheme/lua/mk_todos_readable.lua @@ -0,0 +1,5 @@ +local opts = { bg = "NONE"; fg = "fg"; } +vim.api.nvim_set_hl(0, "@text.danger", opts) +vim.api.nvim_set_hl(0, "@text.note", opts) +vim.api.nvim_set_hl(0, "@text.todo", opts) +vim.api.nvim_set_hl(0, "@text.warning", opts) diff --git a/hm/soispha/conf/nvim/plugins/colorscheme/lua/nightfox.lua b/hm/soispha/conf/nvim/plugins/colorscheme/lua/nightfox.lua new file mode 100644 index 00000000..025eb133 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/colorscheme/lua/nightfox.lua @@ -0,0 +1,44 @@ +require("nightfox").setup({ + options = { + -- Compiled file's destination location + compile_path = vim.fn.stdpath("cache") .. "/nightfox"; + compile_file_suffix = "_compiled"; -- Compiled file suffix + transparent = true; -- Disable setting background + terminal_colors = true; -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` + dim_inactive = true; -- Non focused panes set to alternative background + module_default = true; -- Default enable value for modules + colorblind = { + enable = true; -- Enable colorblind support + simulate_only = false; -- Only show simulated colorblind colors and not diff shifted + severity = { + protan = 0.3; -- Severity [0,1] for protan (red) + deutan = 0.9; -- Severity [0,1] for deutan (green) + tritan = 0; -- Severity [0,1] for tritan (blue) + }; + }; + styles = { -- Style to be applied to different syntax groups + comments = "italic"; -- Value is any valid attr-list value `:help attr-list` + conditionals = "NONE"; + constants = "NONE"; + functions = "bold"; + keywords = "bold"; + numbers = "NONE"; + operators = "NONE"; + strings = "NONE"; + types = "NONE"; + variables = "NONE"; + }; + inverse = { -- Inverse highlight for different types + match_paren = false; + visual = false; + search = false; + }; + modules = { -- List of various plugins and additional options + diagnostic = { enable = true; background = false; }; + native_lsp = { enable = true; background = false; }; + }; + }; + palettes = {}; + specs = {}; + groups = {}; +}) diff --git a/hm/soispha/conf/nvim/plugins/default.nix b/hm/soispha/conf/nvim/plugins/default.nix new file mode 100644 index 00000000..796ae3f2 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/default.nix @@ -0,0 +1,23 @@ +{...}: { + imports = [ + #./lsp-progress-nvim + ./colorscheme + ./femaco + ./goto-preview + ./harpoon + ./leap + ./lf-nvim + ./lsp + ./lspkind + ./lualine + ./luasnip + ./nvim-cmp + ./nvim-lint + ./raw_plugins + ./telescope + ./todo-comments + ./treesitter + ./vim-tex + ./which-key + ]; +} diff --git a/hm/soispha/conf/nvim/plugins/femaco/default.nix b/hm/soispha/conf/nvim/plugins/femaco/default.nix new file mode 100644 index 00000000..6d7ec16a --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/femaco/default.nix @@ -0,0 +1,24 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package femaco though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/femaco.lua} + ''; + extraPlugins = [ + pkgs.vimPlugins.nvim-FeMaco-lua + ]; + maps = { + normal = { + "cc" = { + action = "require('femaco.edit').edit_code_block()"; + lua = true; + desc = "edit a [c]ode blo[c]k with femaco"; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/femaco/lua/femaco.lua b/hm/soispha/conf/nvim/plugins/femaco/lua/femaco.lua new file mode 100644 index 00000000..12171793 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/femaco/lua/femaco.lua @@ -0,0 +1,49 @@ +require("femaco").setup({ + -- should prepare a new buffer and return the winid + -- by default opens a floating window + -- provide a different callback to change this behaviour + -- @param opts: the return value from float_opts + prepare_buffer = function(opts) + local buf = vim.api.nvim_create_buf(false, false) + return vim.api.nvim_open_win(buf, true, opts) + end; + -- should return options passed to nvim_open_win + -- @param code_block: data about the code-block with the keys + -- * range + -- * lines + -- * lang + float_opts = function(code_block) + return { + relative = "cursor"; + width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10); -- TODO: how to offset sign column etc? + height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6); + anchor = "NW"; + row = 0; + col = 0; + style = "minimal"; + border = "rounded"; + zindex = 1; + } + end; + -- return filetype to use for a given lang + -- lang can be nil + ft_from_lang = function(lang) + return lang + end; + -- what to do after opening the float + post_open_float = function(winnr) + vim.wo.signcolumn = "no" + end; + -- create the path to a temporary file + create_tmp_filepath = function(filetype) + return os.tmpname() + end; + -- if a newline should always be used, useful for multiline injections + -- which separators needs to be on separate lines such as markdown, neorg etc + -- @param base_filetype: The filetype which FeMaco is called from, not the + -- filetype of the injected language (this is the current buffer so you can + -- get it from vim.bo.filetyp). + ensure_newline = function(base_filetype) + return false + end; +}) diff --git a/hm/soispha/conf/nvim/plugins/goto-preview/default.nix b/hm/soispha/conf/nvim/plugins/goto-preview/default.nix new file mode 100644 index 00000000..740bb04c --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/goto-preview/default.nix @@ -0,0 +1,42 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package goto-preview though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/goto-preview.lua} + ''; + extraPlugins = [ + pkgs.vimExtraPlugins.goto-preview + ]; + maps.normal = { + "gd" = { + action = "require('goto-preview').goto_preview_definition"; + lua = true; + desc = "[G]oto [D]efinition"; + }; + "gtd" = { + action = "require('goto-preview').goto_preview_type_definition"; + lua = true; + desc = "[G]oto the [t]ype [D]efinition"; + }; + "gi" = { + action = "require('goto-preview').goto_preview_implementation"; + lua = true; + desc = "[G]oto [I]mplementations"; + }; + "gr" = { + action = "require('goto-preview').goto_preview_references"; + lua = true; + desc = "[G]o to all [R]eferences of the symbol"; + }; + "\\" = { + action = "require('goto-preview').close_all_win"; + lua = true; + desc = "close all preview windows"; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/goto-preview/lua/goto-preview.lua b/hm/soispha/conf/nvim/plugins/goto-preview/lua/goto-preview.lua new file mode 100644 index 00000000..cde50d3e --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/goto-preview/lua/goto-preview.lua @@ -0,0 +1,21 @@ +require("goto-preview").setup({ + width = 120; -- Width of the floating window + height = 15; -- Height of the floating window + border = { "↖"; "─"; "┐"; "│"; "┘"; "─"; "└"; "│"; }; -- Border characters of the floating window + default_mappings = false; -- Bind default mappings + debug = false; -- Print debug information + opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. + resizing_mappings = false; -- Binds arrow keys to resizing the floating window. + post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. + post_close_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. + references = { -- Configure the telescope UI for slowing the references cycling window. + telescope = {}; -- require("telescope.themes").get_dropdown({ hide_preview = false }) + }; + -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. + focus_on_open = true; -- Focus the floating window when opening it. + dismiss_on_move = false; -- Dismiss the floating window when moving the cursor. + force_close = true; -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close + bufhidden = "wipe"; -- the bufhidden option to set on the floating window. See :h bufhidden + stack_floating_preview_windows = true; -- Whether to nest floating windows + preview_window_title = { enable = true; position = "left"; }; -- Whether to set the preview window title as the filename +}) diff --git a/hm/soispha/conf/nvim/plugins/harpoon/default.nix b/hm/soispha/conf/nvim/plugins/harpoon/default.nix new file mode 100644 index 00000000..ecd1d6cb --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/harpoon/default.nix @@ -0,0 +1,95 @@ +{...}: let + numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; + mkNumberedCommand = { + command_template, + prefix, + number, + desc_template, + }: { + name = "${prefix}${number}"; + value = { + action = '' + function() + ${command_template number} + end + ''; + lua = true; + desc = "${desc_template number}"; + }; + }; + mkGotoTerminalCommand = number: let + desc_template = number: "Goto terminal number ${number}"; + command_template = number: ''require("harpoon.term").gotoTerminal(${number})''; + prefix = "gt"; + in + mkNumberedCommand {inherit desc_template command_template prefix number;}; + mkGotoFileCommand = number: let + desc_template = number: "Goto Buffer number ${number}"; + command_template = number: ''require("harpoon.ui").nav_file(${number})''; + prefix = "gf"; + in + mkNumberedCommand {inherit desc_template command_template prefix number;}; + + gotoTerminalMappings = builtins.listToAttrs (builtins.map mkGotoTerminalCommand numbers); + gotoFileMappings = builtins.listToAttrs (builtins.map mkGotoFileCommand numbers); +in { + programs.nixvim = { + plugins.harpoon = { + enable = true; + # menu.width = "vim.api.nvim_win_get_width(0) - 4"; # TODO: integrate that + keymaps = { + tmuxGotoTerminal = null; # TODO: + }; + }; + maps.normalVisualOp = + { + "-" = { + action = '' + function() + require("harpoon.ui").nav_next() + end + ''; + lua = true; + desc = "go to the next marked file"; + }; + "_" = { + action = '' + function() + require("harpoon.ui").nav_prev() + end + ''; + lua = true; + desc = "go to the previous marked file"; + }; + "" = { + action = '' + function() + require("harpoon.mark").add_file() + end + ''; + lua = true; + desc = "add a mark to the open file in harpoon."; + }; + "gqc" = { + action = '' + function() + require("harpoon.cmd-ui").toggle_quick_menu() + end + ''; + lua = true; + desc = "toggle the harpoon command quick menu to see all commands."; + }; + "q" = { + action = '' + function() + require("harpoon.ui").toggle_quick_menu() + end + ''; + lua = true; + desc = "toggle the harpoon normal quick menu to see all marks."; + }; + } + // gotoFileMappings + // gotoTerminalMappings; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/leap/default.nix b/hm/soispha/conf/nvim/plugins/leap/default.nix new file mode 100644 index 00000000..bffdf33c --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/leap/default.nix @@ -0,0 +1,58 @@ +{...}: { + programs.nixvim = { + plugins.leap = { + enable = true; + addDefaultMappings = false; # They don't work with dvorak. + safeLabels = [ + "f" + "j" + "k" + "l" + "/" + "z" + "S" + "F" + "J" + "K" + "L" + "H" + "W" + "E" + "M" + "B" + "U" + "X" + "?" + "Z" + ]; + }; + maps = { + normalVisualOp = { + "m" = { + action = "(leap-forward-to)"; + desc = "leap forward to"; + }; + "M" = { + action = "(leap-backward-to)"; + desc = "leap backward to"; + }; + "gs" = { + action = "(leap-from-window)"; + desc = "leap to enterable windows"; + }; + }; + visual = { + /* + "x" = { + action = "(leap-forward-till)"; + desc = "leap forward till"; + }; + "X" = { + action = "(leap-backward-till)"; + desc = "leap backward till"; + }; + */ + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lf-nvim/default.nix b/hm/soispha/conf/nvim/plugins/lf-nvim/default.nix new file mode 100644 index 00000000..c562f400 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lf-nvim/default.nix @@ -0,0 +1,18 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package lf-nvim though a module + # FIXME: change the nvim path, when I change the path with lf + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/lf-nvim.lua} + ''; + extraPlugins = [ + pkgs.vimExtraPlugins.lf-nvim + + pkgs.vimExtraPlugins.nvim-toggleterm-lua # required by lf-nvim + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lf-nvim/lua/lf-nvim.lua b/hm/soispha/conf/nvim/plugins/lf-nvim/lua/lf-nvim.lua new file mode 100644 index 00000000..8a0cf817 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lf-nvim/lua/lf-nvim.lua @@ -0,0 +1,43 @@ +local fn = vim.fn + +-- Defaults +require("lf").setup({ + default_action = "drop"; -- default action when `Lf` opens a file + -- TODO: what do these mappings do? + default_actions = { -- default action keybindings + [""] = "tabedit"; + [""] = "split"; + [""] = "vsplit"; + [""] = "tab drop"; + }; + + winblend = 10; -- psuedotransparency level + dir = ""; -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) + direction = "float"; -- window type: float horizontal vertical + border = "rounded"; -- border kind: single double shadow curved + height = fn.float2nr(fn.round(0.75 * vim.o.lines)); -- height of the *floating* window + width = fn.float2nr(fn.round(0.75 * vim.o.columns)); -- width of the *floating* window + escape_quit = true; -- map escape to the quit command (so it doesn't go into a meta normal mode) + focus_on_open = true; -- focus the current file when opening Lf (experimental) + mappings = true; -- whether terminal buffer mapping is enabled + tmux = false; -- tmux statusline can be disabled on opening of Lf + default_file_manager = true; -- make lf default file manager + disable_netrw_warning = true; -- don't display a message when opening a directory with `default_file_manager` as true + highlights = { -- highlights passed to toggleterm + Normal = { link = "Normal"; }; + NormalFloat = { link = "Normal"; }; + FloatBorder = { guifg = "#cdcbe0"; guibg = "#191726"; }; + }; + + -- Layout configurations + layout_mapping = ""; -- resize window with this key + views = { -- window dimensions to rotate through + { width = 0.800; height = 0.800; }; + { width = 0.600; height = 0.600; }; + { width = 0.950; height = 0.950; }; + { width = 0.500; height = 0.500; col = 0; row = 0; }; + { width = 0.500; height = 0.500; col = 0; row = 0.5; }; + { width = 0.500; height = 0.500; col = 0.5; row = 0; }; + { width = 0.500; height = 0.500; col = 0.5; row = 0.5; }; + }; +}) diff --git a/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/default.nix b/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/default.nix new file mode 100644 index 00000000..6602ceb6 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/default.nix @@ -0,0 +1,50 @@ +{ + lib, + pkgs, + ... +}: { + programs.nixvim = { + # TODO: package lsp-progress-nvim though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/lsp-progress-nvim.lua} + ''; + extraPlugins = [ + pkgs.vimExtraPlugins.lsp-progress-nvim + ]; + + # Status line setup + autoGroups.lsp_refresh.clear = true; + autoCmd = [ + { + event = ["User LspProgressStatusUpdated"]; + pattern = ["*"]; + callback = + /* + lua + */ + { + __raw = '' + require("lualine").refresh + ''; + }; + group = "lsp_refresh"; + description = "Refresh the statusbar when the lsp status was updated."; + } + ]; + plugins.lualine = let + get_lsp_progress = { + __raw = + /* + lua + */ + '' + require('lsp-progress').progress + ''; + }; + in { + sections = { + lualine_c = [{name = get_lsp_progress;}]; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua new file mode 100644 index 00000000..4273085c --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua @@ -0,0 +1,150 @@ +--- @type table +require("lsp-progress").setup({ + -- Spinning icons. + -- + --- @type string[] + spinner = { "⣾"; "⣽"; "⣻"; "⢿"; "⡿"; "⣟"; "⣯"; "⣷"; }; + + -- Spinning update time in milliseconds. + -- + --- @type integer + spin_update_time = 200; + + -- Last message cached decay time in milliseconds. + -- + -- Message could be really fast(appear and disappear in an + -- instant) that user cannot even see it, thus we cache the last message + -- for a while for user view. + -- + --- @type integer + decay = 700; + + -- User event name. + -- + --- @type string + event = "LspProgressStatusUpdated"; + + -- Event update time limit in milliseconds. + -- + -- Sometimes progress handler could emit many events in an instant, while + -- refreshing statusline cause too heavy synchronized IO, so we limit the + -- event rate to reduce this cost. + -- + --- @type integer + event_update_time_limit = 100; + + -- Max progress string length, by default -1 is unlimited. + -- + --- @type integer + max_size = -1; + + -- Regular internal update time. + -- + -- Emit user event to update the lsp progress status, even there's no new + -- message. + -- + --- @type integer + regular_internal_update_time = 500; + + -- Disable emitting events on specific mode/filetype. + -- User events would interrupt insert mode, thus break which-key like plugins behaviour. + -- See: + -- * https://github.com/linrongbin16/lsp-progress.nvim/issues/50 + -- * https://neovim.io/doc/user/builtin.html#mode() + -- + --- @type table[] + disable_events_opts = { { mode = "i"; filetype = "TelescopePrompt"; }; }; + + -- Format series message. + -- + -- By default it looks like: `formatting isort (100%) - done`. + -- + --- @param title string|nil + --- Message title. + --- @param message string|nil + --- Message body. + --- @param percentage number|nil + --- Progress in percentage numbers: 0-100. + --- @param done boolean + --- Indicate whether this series is the last one in progress. + --- @return string|nil messages + --- The returned value will be passed to function `client_format` as + --- one of the `series_messages` array, or ignored if return nil. + series_format = function(title, message, percentage, done) + local builder = {} + local has_title = false + local has_message = false + if title and title ~= "" then + table.insert(builder, title) + has_title = true + end + if message and message ~= "" then + table.insert(builder, message) + has_message = true + end + if percentage and (has_title or has_message) then + table.insert(builder, string.format("(%.0f%%%%)", percentage)) + end + if done and (has_title or has_message) then + table.insert(builder, "- done") + end + return table.concat(builder, " ") + end; + + -- Format client message. + -- + -- By default it looks like: + -- `[null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)`. + -- + --- @param client_name string + --- Client name. + --- @param spinner string + --- Spinner icon. + --- @param series_messages string[]|table[] + --- Messages array. + --- @return string|nil messages + --- The returned value will be passed to function `format` as one of the + --- `client_messages` array, or ignored if return nil. + client_format = function(client_name, spinner, series_messages) + return #series_messages > 0 + and ("[" .. client_name .. "] " .. spinner .. " " .. table.concat(series_messages, ", ")) + or nil + end; + + -- Format (final) message. + -- + -- By default it looks like: + -- ` LSP [null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)` + -- + --- @param client_messages string[]|table[] + --- Client messages array. + --- @return nil|string message + --- The returned value will be returned from `progress` API. + format = function(client_messages) + local sign = " LSP" -- nf-fa-gear \uf013 + return #client_messages > 0 and (sign .. " " .. table.concat(client_messages, " ")) or sign + end; + + -- Enable debug. + -- + --- @type boolean + debug = false; + + -- Print log to console(command line). + -- + --- @type boolean + console_log = false; + + -- Print log to file. + -- + --- @type boolean + file_log = true; + + -- Log file to write, work with `file_log=true`. + -- + -- For Windows: `$env:USERPROFILE\AppData\Local\nvim-data\lsp-progress.log`. + -- For *NIX: `~/.local/share/nvim/lsp-progress.log`. + -- + --- @type string + file_log_name = "lsp-progress.log"; +}) diff --git a/hm/soispha/conf/nvim/plugins/lsp/default.nix b/hm/soispha/conf/nvim/plugins/lsp/default.nix new file mode 100644 index 00000000..b7c1e174 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/default.nix @@ -0,0 +1,29 @@ +{...}: { + imports = [ + ./keymaps + ./servers + ]; + programs.nixvim.plugins.lsp = { + enable = true; + onAttach = + "" + # + '' + # function(client, bufnr) + # -- Enable completion triggered by + # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + # end + # '' + ; + preConfig = '' + vim.diagnostic.config({ + underline = true, + -- virtual_text = true, + virtual_text = { + source = "always", -- Or "if_many" + }, + update_in_insert = true, + severity_sort = true, + }, nil); + ''; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/keymaps/default.nix b/hm/soispha/conf/nvim/plugins/lsp/keymaps/default.nix new file mode 100644 index 00000000..4017521d --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/keymaps/default.nix @@ -0,0 +1,72 @@ +{...}: { + programs.nixvim = { + plugins.lsp.keymaps = { + diagnostic = { + "N" = { + action = "goto_prev"; + desc = "go to previous diagnostic message"; + }; + "T" = { + action = "goto_next"; + desc = "go to next diagnostic message"; + }; + "e" = { + action = "open_float"; + desc = "open float for the symbol"; + }; + "gq" = { + action = "setloclist"; + desc = "add buffer diagnostic to the location list (quick-fix)"; + }; + }; + lspBuf = { + "gD" = { + action = "declaration"; + desc = "[G]o to [d]eclaration"; + }; + "hi" = { + action = "hover"; + desc = "Display [h]over [i]nformation"; + }; + "sh" = { + action = "signature_help"; + desc = "Display [s]ignature [h]elp"; + }; + "wa" = { + action = "add_workspace_folder"; + desc = "[W]orkspace folder [a]dd"; + }; + "wr" = { + action = "remove_workspace_folder"; + desc = "[W]orkspace folder [r]emove"; + }; + "rn" = { + action = "rename"; + desc = "[R]e[n]ame the item under the cursor"; + }; + "ca" = { + action = "code_action"; + desc = "Open the [c]ode [a]ction menu"; + }; + }; + }; + maps = { + normal = { + "f" = { + action = "function() vim.lsp.buf.format { async = true } end"; + lua = true; + desc = "[F]ormat the current buffer (asynchronously)"; + }; + "wl" = { + action = '' + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end + ''; + lua = true; + desc = "[W]orkspace folders [l]ist"; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/default.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/default.nix new file mode 100644 index 00000000..8ffac2e1 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/default.nix @@ -0,0 +1,11 @@ +{...}: { + imports = [ + ./servers/bashls.nix + ./servers/ltex.nix + ./servers/lua-ls.nix + ./servers/nil_ls.nix + ./servers/rust-analyzer.nix + ./servers/texlab.nix + ./servers/ccls.nix + ]; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/bashls.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/bashls.nix new file mode 100644 index 00000000..0577a335 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/bashls.nix @@ -0,0 +1,5 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + bashls.enable = true; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ccls.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ccls.nix new file mode 100644 index 00000000..0698bcce --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ccls.nix @@ -0,0 +1,5 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + ccls.enable = true; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ltex.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ltex.nix new file mode 100644 index 00000000..0d039f82 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/ltex.nix @@ -0,0 +1,39 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + ltex = let + filetypes = [ + "rust" + "java" + "cpp" + "shell" + "bash" + + "bibtex" + "context" + "context.tex" + "latex" + "tex" + + "html" + "markdown" + "org" + "restructuredtext" + "rsweave" + + "git-commit" + "gitcommit" + ]; + in { + enable = true; + inherit filetypes; + settings = { + enabled = filetypes; + completionEnabled = false; + language = "en-CA"; + additionalRules = { + enablePickyRules = true; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/lua-ls.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/lua-ls.nix new file mode 100644 index 00000000..5a44b500 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/lua-ls.nix @@ -0,0 +1,8 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + lua-ls = { + enable = true; + settings.telemetry.enable = false; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/nil_ls.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/nil_ls.nix new file mode 100644 index 00000000..f0cccbdc --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/nil_ls.nix @@ -0,0 +1,10 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + nil_ls = { + enable = true; + settings = { + formatting.command = ["alejandra"]; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/rust-analyzer.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/rust-analyzer.nix new file mode 100644 index 00000000..943a8c80 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/rust-analyzer.nix @@ -0,0 +1,10 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + rust-analyzer = { + enable = true; + settings = { + typing.autoClosingAngleBrackets.enable = true; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lsp/servers/servers/texlab.nix b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/texlab.nix new file mode 100644 index 00000000..59af8d39 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lsp/servers/servers/texlab.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim.plugins.lsp.servers = { + texlab = { + enable = true; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lspkind/default.nix b/hm/soispha/conf/nvim/plugins/lspkind/default.nix new file mode 100644 index 00000000..ed7d411b --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lspkind/default.nix @@ -0,0 +1,6 @@ +{...}: { + programs.nixvim.plugins.lspkind = { + enable = true; + preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. + }; +} diff --git a/hm/soispha/conf/nvim/plugins/lualine/default.nix b/hm/soispha/conf/nvim/plugins/lualine/default.nix new file mode 100644 index 00000000..0b789558 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/lualine/default.nix @@ -0,0 +1,114 @@ +{...}: { + programs.nixvim.plugins.lualine = let + get_location_of_file = { + __raw = '' + function() + local file_lines = vim.fn.line('$'); + local file_current_cursor_positon = vim.fn.getcurpos(); + return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines + end + ''; + }; + + get_trailing_whitespace = { + __raw = '' + function() + local space = vim.fn.search([[\s\+$]], 'nwc') + return space ~= 0 and "TW:" .. space or "" + end + ''; + }; + get_mixed_indent = { + __raw = + /* + lua + */ + '' + function() + local space_pat = [[\v^ +]] + local tab_pat = [[\v^\t+]] + local space_indent = vim.fn.search(space_pat, 'nwc') + local tab_indent = vim.fn.search(tab_pat, 'nwc') + local mixed = (space_indent > 0 and tab_indent > 0) + local mixed_same_line + if not mixed then + mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') + mixed = mixed_same_line > 0 + end + if not mixed then return "" end + if mixed_same_line ~= nil and mixed_same_line > 0 then + return 'MI:' .. mixed_same_line + end + local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total + local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total + if space_indent_cnt > tab_indent_cnt then + return 'MI:' .. tab_indent + else + return 'MI:' .. space_indent + end + end + ''; + }; + in { + enable = true; + iconsEnabled = true; + theme = "nightfox"; + componentSeparators = { + left = ""; + right = ""; + }; + sectionSeparators = { + left = ""; + right = ""; + }; + disabledFiletypes = { + statusline = []; + winbar = []; + }; + ignoreFocus = []; + alwaysDivideMiddle = true; + globalstatus = false; + refresh = { + statusline = 1000; + tabline = 1000; + winbar = 1000; + }; + sections = { + lualine_a = ["mode"]; + lualine_b = [ + { + name = "FugitiveHead"; + icon = ""; + } + "diff" + "diagnostics" + ]; + lualine_c = ["filename"]; + lualine_x = ["searchcount" "filetype"]; + lualine_y = [ + "encoding" + "fileformat" + {name = get_mixed_indent;} + {name = get_trailing_whitespace;} + ]; + lualine_z = [{name = get_location_of_file;}]; + }; + inactiveSections = { + lualine_a = []; + lualine_b = []; + lualine_c = ["filename"]; + lualine_x = [{name = get_location_of_file;}]; + lualine_y = []; + lualine_z = []; + }; + tabline = {}; + winbar = {}; + inactiveWinbar = {}; + + # TODO: add all installed and supported extensions here + extensions = [ + "toggleterm" + #"fugitive" # TODO: maybe add this? + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/luasnip/default.nix b/hm/soispha/conf/nvim/plugins/luasnip/default.nix new file mode 100644 index 00000000..50a0b94c --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/default.nix @@ -0,0 +1,12 @@ +{lib, ...}: { + programs.nixvim = { + plugins.luasnip = { + enable = true; + }; + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/luasnip.lua} + require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"}) + require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"}) + ''; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/luasnip/lua/luasnip.lua b/hm/soispha/conf/nvim/plugins/luasnip/lua/luasnip.lua new file mode 100644 index 00000000..0a603692 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/lua/luasnip.lua @@ -0,0 +1,7 @@ +require("luasnip").config.set_config({ + -- Enable auto triggered snippets + enable_autosnippets = true; + + -- Use Tab (or some other key if you prefer) to trigger visual selection + store_selection_keys = ""; +}) diff --git a/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/all.lua b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/all.lua new file mode 100644 index 00000000..5ce91a87 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/all.lua @@ -0,0 +1,60 @@ +local get_visual = function(args, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) + else + return sn(nil, i(1, "")) + end +end +local function char_count_same(c1, c2) + local line = vim.api.nvim_get_current_line() + -- '%'-escape chars to force explicit match (gsub accepts patterns). + -- second return value is number of substitutions. + local _, ct1 = string.gsub(line, "%" .. c1, "") + local _, ct2 = string.gsub(line, "%" .. c2, "") + return ct1 == ct2 +end + +local function even_count(c) + local line = vim.api.nvim_get_current_line() + local _, ct = string.gsub(line, c, "") + return ct % 2 == 0 +end + +local function neg(fn, ...) + return not fn(...) +end + +local function part(fn, ...) + local args = { ...; } + return function() + return fn(unpack(args)) + end +end + +-- This makes creation of pair-type snippets easier. +local function pair(pair_begin, pair_end, expand_func, ...) + -- triggerd by opening part of pair, wordTrig=false to trigger anywhere. + -- ... is used to pass any args following the expand_func to it. + return s( + { trig = pair_begin; wordTrig = false; snippetType = "autosnippet"; }, + { t({ pair_begin; }); d(1, get_visual); t({ pair_end; }); }, + { condition = part(expand_func, part(..., pair_begin, pair_end)); } + ) +end + +local maybe = { pair = nil; } +if vim.bo.filetype == "tex" then + maybe.pair = pair("<", ">", neg, char_count_same) +end + +local output_table = { + pair("(", ")", neg, char_count_same); + pair("{", "}", neg, char_count_same); + pair("[", "]", neg, char_count_same); + pair("'", "'", neg, even_count); + pair('"', '"', neg, even_count); + pair("`", "`", neg, even_count); +} +output_table[#output_table + 1] = maybe.pair + +return output_table diff --git a/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/html/html.lua b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/html/html.lua new file mode 100644 index 00000000..c467dd68 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/html/html.lua @@ -0,0 +1,108 @@ +local get_visual = function(args, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) + else + return sn(nil, i(1)) + end +end + +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +return { + -- HEADER + s( + { + trig = "h([123456])"; + regTrig = true; + wordTrig = false; + snippetType = "autosnippet"; + }, + fmt( + [[ + {} + ]], + { + f(function(_, snip) + return snip.captures[1] + end); + d(1, get_visual); + f(function(_, snip) + return snip.captures[1] + end); + } + ), + { condition = line_begin; } + ); -- PARAGRAPH + s( + { trig = "pp"; snippetType = "autosnippet"; }, + fmt( + [[ +

{}

+ ]], + { d(1, get_visual); } + ), + { condition = line_begin; } + ); -- UNORDERED LIST + s( + { trig = "itt"; snippetType = "autosnippet"; }, + fmt( + [[ +
    +
  • {}
  • {} +
+ ]], + { i(1); i(0); } + ), + { condition = line_begin; } + ); -- LIST ITEM + s( + { trig = "ii"; snippetType = "autosnippet"; }, + fmt( + [[ +
  • {}
  • + ]], + { d(1, get_visual); } + ), + { condition = line_begin; } + ); + -- DOCUMENT TEMPLATE + s( + { trig = "base"; }, + fmt( + [[ + + + + + {} + + + {} + + + ]], + { i(1, "FooBar"); i(0); } + ), + { condition = line_begin; } + ); -- ANCHOR TAG + s( + { + trig = "([^%l])aa"; + regTrig = true; + wordTrig = false; + snippetType = "autosnippet"; + }, + fmt( + [[ + {}{} + ]], + { + f(function(_, snip) + return snip.captures[1] + end); + i(1); + d(2, get_visual); + } + ) + ); +} diff --git a/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/delimiter.lua b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/delimiter.lua new file mode 100644 index 00000000..e50898fc --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/delimiter.lua @@ -0,0 +1,34 @@ +local get_visual = function(args, parent) + if #parent.snippet.env.SELECT_RAW > 0 then + return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) + else + return sn(nil, i(1, "")) + end +end + +local translation_table = { ["("] = ")"; ["{"] = "}"; ["["] = "]"; } + +-- Return snippet tables +return { + -- LEFT/RIGHT ALL BRACES + s( + { + trig = "([^%a])l([%(%[%{])"; + regTrig = true; + wordTrig = false; + snippetType = "autosnippet"; + }, + fmta("<>\\left<><>\\right<>", { + f(function(_, snip) + return snip.captures[1] + end); + f(function(_, snip) + return snip.captures[2] + end); + d(1, get_visual); + f(function(_, snip) + return translation_table[snip.captures[2]] + end); + }) + ); +} diff --git a/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/greek.lua b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/greek.lua new file mode 100644 index 00000000..19989093 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/luasnip/lua/snippets/tex/greek.lua @@ -0,0 +1,37 @@ +-- Return snippet tables +return { + s({ trig = ";a"; snippetType = "autosnippet"; }, { t("\\alpha"); }); + s({ trig = ";b"; snippetType = "autosnippet"; }, { t("\\beta"); }); + s({ trig = ";g"; snippetType = "autosnippet"; }, { t("\\gamma"); }); + s({ trig = ";G"; snippetType = "autosnippet"; }, { t("\\Gamma"); }); + s({ trig = ";d"; snippetType = "autosnippet"; }, { t("\\delta"); }); + s({ trig = ";D"; snippetType = "autosnippet"; }, { t("\\Delta"); }); + s({ trig = ";e"; snippetType = "autosnippet"; }, { t("\\epsilon"); }); + s({ trig = ";ve"; snippetType = "autosnippet"; }, { t("\\varepsilon"); }); + s({ trig = ";z"; snippetType = "autosnippet"; }, { t("\\zeta"); }); + s({ trig = ";h"; snippetType = "autosnippet"; }, { t("\\eta"); }); + s({ trig = ";o"; snippetType = "autosnippet"; }, { t("\\theta"); }); + s({ trig = ";vo"; snippetType = "autosnippet"; }, { t("\\vartheta"); }); + s({ trig = ";O"; snippetType = "autosnippet"; }, { t("\\Theta"); }); + s({ trig = ";k"; snippetType = "autosnippet"; }, { t("\\kappa"); }); + s({ trig = ";l"; snippetType = "autosnippet"; }, { t("\\lambda"); }); + s({ trig = ";L"; snippetType = "autosnippet"; }, { t("\\Lambda"); }); + s({ trig = ";m"; snippetType = "autosnippet"; }, { t("\\mu"); }); + s({ trig = ";n"; snippetType = "autosnippet"; }, { t("\\nu"); }); + s({ trig = ";x"; snippetType = "autosnippet"; }, { t("\\xi"); }); + s({ trig = ";X"; snippetType = "autosnippet"; }, { t("\\Xi"); }); + s({ trig = ";i"; snippetType = "autosnippet"; }, { t("\\pi"); }); + s({ trig = ";I"; snippetType = "autosnippet"; }, { t("\\Pi"); }); + s({ trig = ";r"; snippetType = "autosnippet"; }, { t("\\rho"); }); + s({ trig = ";s"; snippetType = "autosnippet"; }, { t("\\sigma"); }); + s({ trig = ";S"; snippetType = "autosnippet"; }, { t("\\Sigma"); }); + s({ trig = ";t"; snippetType = "autosnippet"; }, { t("\\tau"); }); + s({ trig = ";f"; snippetType = "autosnippet"; }, { t("\\phi"); }); + s({ trig = ";vf"; snippetType = "autosnippet"; }, { t("\\varphi"); }); + s({ trig = ";F"; snippetType = "autosnippet"; }, { t("\\Phi"); }); + s({ trig = ";c"; snippetType = "autosnippet"; }, { t("\\chi"); }); + s({ trig = ";p"; snippetType = "autosnippet"; }, { t("\\psi"); }); + s({ trig = ";P"; snippetType = "autosnippet"; }, { t("\\Psi"); }); + s({ trig = ";w"; snippetType = "autosnippet"; }, { t("\\omega"); }); + s({ trig = ";W"; snippetType = "autosnippet"; }, { t("\\Omega"); }); +} diff --git a/hm/soispha/conf/nvim/plugins/nvim-cmp/default.nix b/hm/soispha/conf/nvim/plugins/nvim-cmp/default.nix new file mode 100644 index 00000000..2fd35272 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/nvim-cmp/default.nix @@ -0,0 +1,47 @@ +{...}: { + programs.nixvim.plugins.nvim-cmp = { + /* + TODO:; integrate this: + ```lua + enabled = { + function() + -- disable completion in comments + local context = require 'cmp.config.context' + -- keep command mode completion enabled when cursor is in a comment + -- te + if vim.api.nvim_get_mode().mode == 'c' then + return true + else + return not context.in_treesitter_capture("comment") + and not context.in_syntax_group("Comment") + end + end + }, + ``` + */ + enable = true; + + mapping = { + # TODO: add support for desc and which key here + "" = { + action = "cmp.mapping.scroll_docs(-4)"; + #desc = "Scroll up by four lines"; + }; + "" = { + action = "cmp.mapping.scroll_docs(4)"; + #desc = "Scroll down by four lines"; + }; + "HH" = { + action = "cmp.mapping.complete()"; + #desc = "Confirm snipped"; + }; + }; + + snippet.expand = "luasnip"; + + sources = [ + {name = "nvim_lsp";} + {name = "luasnip";} + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/nvim-lint/default.nix b/hm/soispha/conf/nvim/plugins/nvim-lint/default.nix new file mode 100644 index 00000000..c583ebf6 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/nvim-lint/default.nix @@ -0,0 +1,15 @@ +{ + pkgs, + lib, + ... +}: { + programs.nixvim = { + # TODO: package nvim-lint though a module + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/nvim-lint.lua} + ''; + extraPlugins = [ + pkgs.vimExtraPlugins.nvim-lint + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/nvim-lint/lua/nvim-lint.lua b/hm/soispha/conf/nvim/plugins/nvim-lint/lua/nvim-lint.lua new file mode 100644 index 00000000..582da638 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/nvim-lint/lua/nvim-lint.lua @@ -0,0 +1,20 @@ +require("lint").linters_by_ft = { + -- text + markdown = {}; + -- tex = {'chktex'}, -- maybe add some text linters ? + + -- shell + sh = { "shellcheck"; }; + bash = { "shellcheck"; }; + zsh = { "shellcheck"; }; + dash = { "shellcheck"; }; + + yaml = { "yamllint"; }; + nix = { "nix"; "statix"; }; +} + +vim.api.nvim_create_autocmd({ "BufEnter"; "BufWritePost"; }, { + callback = function() + require("lint").try_lint() + end; +}) diff --git a/hm/soispha/conf/nvim/plugins/raw_plugins/default.nix b/hm/soispha/conf/nvim/plugins/raw_plugins/default.nix new file mode 100644 index 00000000..941cb7cb --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/raw_plugins/default.nix @@ -0,0 +1,11 @@ +{...}: { + programs.nixvim = { + # Not all plugins have own modules + # You can add missing plugins here + # `pkgs.vimExtraPlugins` is added by the overlay you added at the beginning + # For a list of available plugins, look here: + # https://github.com/jooooscha/nixpkgs-vim-extra-plugins/blob/main/plugins.md + extraPlugins = [ + ]; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/default.nix b/hm/soispha/conf/nvim/plugins/telescope/default.nix new file mode 100644 index 00000000..b5054ed0 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/default.nix @@ -0,0 +1,10 @@ +{...}: { + imports = [ + ./defaults + ./keymaps + ./extensions + ]; + programs.nixvim.plugins.telescope = { + enable = true; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix b/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix new file mode 100644 index 00000000..1d88aad8 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/defaults/default.nix @@ -0,0 +1,30 @@ +{...}: { + programs.nixvim.plugins.telescope.defaults = { + mappings = let + insert_and_normal_mappings = { + # map actions.which_key to (default: ) + # actions.which_key shows the mappings for your picker, + # e.g. git_{create, delete, ...}_branch for the git_branches picker + "" = "which_key"; + }; + in { + i = + insert_and_normal_mappings; + n = + { + "t" = "move_selection_next"; + "n" = "move_selection_previous"; + "" = "toggle_all"; + + "" = "preview_scrolling_up"; + "" = "preview_scrolling_down"; + "" = "preview_scrolling_left"; + "" = "preview_scrolling_right"; + + "" = "close"; + "q" = "close"; + } + // insert_and_normal_mappings; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix new file mode 100644 index 00000000..12c9736c --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/bibtex/default.nix @@ -0,0 +1,13 @@ +{pkgs, ...}: { + # WARNING: This is only activated in tex files via the ftplugin. + programs.nixvim = { + extraPlugins = [ + pkgs.vimExtraPlugins.telescope-bibtex-nvim + ]; + maps.normal = { + "ib" = { + desc = "[i]nsert a [b]atex citation"; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix new file mode 100644 index 00000000..0b1e033a --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/default.nix @@ -0,0 +1,9 @@ +{...}: { + imports = [ + ./bibtex + ./frecency + ./fzy-native + ./rooter + ./symbols + ]; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix new file mode 100644 index 00000000..4a4c22be --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/frecency/default.nix @@ -0,0 +1,22 @@ +{...}: { + programs.nixvim = { + maps = { + normal = { + "gff" = { + action = "function() require('telescope').extensions.frecency.frecency() end"; + lua = true; + desc = "activate the frecency file selection"; + }; + }; + }; + plugins.telescope = { + extensions.frecency = { + enable = true; + showUnindexed = true; + showScores = true; + # TODO: add this: + #db_safe_mode = true; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix new file mode 100644 index 00000000..ce0bdccc --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/fzy-native/default.nix @@ -0,0 +1,5 @@ +{...}: { + programs.nixvim.plugins.telescope.extensions.fzy-native = { + enable = true; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix new file mode 100644 index 00000000..779448cc --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + programs.nixvim = { + extraConfigLuaPost = '' + ${lib.strings.fileContents ./lua/rooter.lua} + ''; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua new file mode 100644 index 00000000..eaf68ecf --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/rooter/lua/rooter.lua @@ -0,0 +1,84 @@ +-- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua +local has_telescope, telescope = pcall(require, "telescope") +if not has_telescope then + error("This extension requires telescope.nvim") + return +end + +local has_plenary, plenary = pcall(require, "plenary") +if not has_plenary then + error("This extension requires plenary") + return +end + +local log = plenary.log.new({ plugin = "telescope_rooter"; level = "info"; }) + +-- TODO: expose this function +local toggle = function(_) + vim.g["Telescope#rooter#enabled"] = not vim.g["Telescope#rooter#enabled"] + print("Telescope#rooter#enabled=" .. vim.inspect(vim.g["Telescope#rooter#enabled"])) +end + +local config = { patterns = { ".git"; }; enable = true; debug = false; } + +-- default enabled +vim.g["Telescope#rooter#enabled"] = vim.F.if_nil(config.enable, true) + +-- redefine log if debug enabled +if vim.F.if_nil(config.debug, false) then + log = plenary.log.new({ plugin = "telescope_rooter"; level = "debug"; }) +end + +local group = vim.api.nvim_create_augroup("TelescopeRooter", { clear = true; }) + +vim.api.nvim_create_autocmd({ "DirChangedPre"; }, { + callback = function() + if vim.g["Telescope#rooter#enabled"] ~= true then + return + end + + if vim.g["Telescope#rooter#oldpwd"] == nil then + vim.g["Telescope#rooter#oldpwd"] = vim.loop.cwd() + log.debug("before " .. vim.inspect(vim.loop.cwd())) + end + end; + group = group; +}) + +vim.api.nvim_create_autocmd({ "BufEnter"; "BufWinEnter"; }, { + callback = function() + if vim.g["Telescope#rooter#enabled"] ~= true then + return + end + + vim.schedule(function() + if vim.bo.filetype == "TelescopePrompt" then + local rootdir = vim.fs.dirname(vim.fs.find(config.patterns, { upward = true; })[1]) + if rootdir ~= nil then + vim.api.nvim_set_current_dir(rootdir) + log.debug("changing dir to " .. rootdir) + end + end + end) + end; + group = group; +}) + +vim.api.nvim_create_autocmd({ "BufWinLeave"; }, { + callback = function() + if vim.g["Telescope#rooter#enabled"] ~= true then + return + end + + vim.schedule(function() + if vim.bo.filetype ~= "TelescopePrompt" then + if vim.g["Telescope#rooter#oldpwd"] ~= nil then + log.debug("restoring " .. vim.g["Telescope#rooter#oldpwd"]) + vim.api.nvim_set_current_dir(vim.g["Telescope#rooter#oldpwd"]) + vim.g["Telescope#rooter#oldpwd"] = nil + end + end + end) + end; + group = group; +}) diff --git a/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix b/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix new file mode 100644 index 00000000..1a679776 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/extensions/symbols/default.nix @@ -0,0 +1,51 @@ +{pkgs, ...}: { + programs.nixvim = { + extraPlugins = [ + # Source of symbols for telescope symbols + pkgs.vimExtraPlugins.telescope-symbols-nvim + ]; + maps = { + normal = { + "il" = { + action = '' + function() + require('telescope.builtin').symbols{ sources = { + 'latex' + }} + end + ''; + lua = true; + desc = "[i]nsert a [l]atex symbol"; + }; + "ie" = { + action = '' + function() + require('telescope.builtin').symbols{ sources = { + 'emoji', + }} + end + ''; + lua = true; + desc = "[i]nsert a [e]moji"; + }; + "is" = { + action = '' + function() + require('telescope.builtin').symbols{ sources = { + 'emoji', + 'gitmoji', + 'julia', + 'kaomoji', + 'latex', + 'math', + 'nerd', + }} + end + ''; + lua = true; + desc = "[i]nsert a [s]ymbol (like emojis)"; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix b/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix new file mode 100644 index 00000000..f0745f73 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/telescope/keymaps/default.nix @@ -0,0 +1,8 @@ +{...}: { + programs.nixvim.plugins.telescope.keymaps = { + "rg" = { + action = "live_grep"; + desc = "[rg] in a live session"; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/todo-comments/default.nix b/hm/soispha/conf/nvim/plugins/todo-comments/default.nix new file mode 100644 index 00000000..9ed6cc87 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/todo-comments/default.nix @@ -0,0 +1,49 @@ +{...}: { + programs.nixvim.plugins.todo-comments = { + enable = true; + guiStyle = { + fg = "BOLD"; + bg = "NONE"; + }; + highlight = { + keyword = "wide_fg"; + }; + keywords = { + /* + # Defaults: + FIX = { + icon = " "; # Icon used for the sign, and in search results. + color = "error"; # Can be a hex color, or a named color. + alt = ["FIXME" "BUG" "FIXIT" "ISSUE"]; # A set of other keywords that all map to this FIX keywords. + }; + TODO = { + icon = " "; + color = "info"; + }; + HACK = { + icon = " "; + color = "warning"; + }; + WARN = { + icon = " "; + color = "warning"; + alt = ["WARNING" "XXX"]; + }; + PERF = { + icon = " "; + alt = ["OPTIM" "PERFORMANCE" "OPTIMIZE"]; + }; + NOTE = { + icon = " "; + color = "hint"; + alt = ["INFO"]; + }; + TEST = { + icon = "⏲ "; + color = "test"; + alt = ["TESTING" "PASSED" "FAILED"]; + }; + */ + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/treesitter/default.nix b/hm/soispha/conf/nvim/plugins/treesitter/default.nix new file mode 100644 index 00000000..9d30d6b9 --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/treesitter/default.nix @@ -0,0 +1,40 @@ +{...}: { + programs.nixvim.plugins.treesitter = { + enable = true; + + ensureInstalled = "all"; + indent = true; + + # inject nixvim specific highlighting (eg in extraConfigLua). + nixvimInjections = true; + + # TODO: It would we wonderfull, if we could use treesitter in latex + disabledLanguages = ["latex"]; + + /* + # TODO: this is not supported by the nixVim modlue, nixNeovim supports this though .. + highlight = { + # `false` will disable the whole extension + enable = true; + disable = ["latex"]; + + # Setting this to true will run `:h syntax` and tree-sitter at the same time. + # Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + # Using this option may slow down your editor; and you may see some duplicate highlights. + # Instead of true it can also be a list of languages + additionalVimRegexHighlighting = [""]; + }; + */ + + incrementalSelection = { + enable = true; + keymaps = { + # TODO: include these + initSelection = "gnn"; # set to `false` to disable one of the mappings + nodeIncremental = "grn"; + scopeIncremental = "grc"; + nodeDecremental = "grm"; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/vim-tex/default.nix b/hm/soispha/conf/nvim/plugins/vim-tex/default.nix new file mode 100644 index 00000000..9b5cea5e --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/vim-tex/default.nix @@ -0,0 +1,59 @@ +{...}: { + programs.nixvim = { + options.conceallevel = 0; + + # globals.tex_conceal = "abdmg"; + # globals.tex_flavor = "latex"; + + plugins.vimtex = { + enable = true; + extraConfig = { + view_method = "zathura"; + quickfix_mode = -1; + view_enabled = -1; + tex_conceal = "abdmg"; + tex_flavor = "latex"; + + # Useful if treesitter is the highlighter + #syntax_enabled = 0; + #syntax_conceal_disable = 1; + + mappings_disable = { + n = ["tsf" "tsc" "tse" "ts$" "tsd" "tsD"]; + x = ["tsd" "tsD" "tsf"]; + }; + + toc_config = { + name = "TOC"; + layers = ["content" "todo" "include"]; + resize = false; + split_width = 49; + todo_sorted = -1; + show_help = false; + show_numbers = false; + mode = true; + layer_keys = { + content = "C"; + label = "L"; + todo = "j"; + include = "I"; + }; + }; + + compiler_latexmk = { + build_dir = "build"; + callback = false; + continuous = true; + executable = "latexmk"; + hooks = []; + options = [ + "-verbose" + "-file-line-error" + "-synctex=0" + "-interaction=nonstopmode" + ]; + }; + }; + }; + }; +} diff --git a/hm/soispha/conf/nvim/plugins/which-key/default.nix b/hm/soispha/conf/nvim/plugins/which-key/default.nix new file mode 100644 index 00000000..be63f7ac --- /dev/null +++ b/hm/soispha/conf/nvim/plugins/which-key/default.nix @@ -0,0 +1,5 @@ +{...}: { + programs.nixvim.plugins.which-key = { + enable = true; + }; +} diff --git a/hm/soispha/conf/python/default.nix b/hm/soispha/conf/python/default.nix new file mode 100644 index 00000000..eeaccdcf --- /dev/null +++ b/hm/soispha/conf/python/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."python/pythonrc".source = ./pythonrc; +} diff --git a/hm/soispha/conf/python/pythonrc b/hm/soispha/conf/python/pythonrc new file mode 100644 index 00000000..38c48e0f --- /dev/null +++ b/hm/soispha/conf/python/pythonrc @@ -0,0 +1,11 @@ +import os +import atexit +import readline + +history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history') +readline.read_history_file(history) + +def write_history(): + readline.write_history_file(history) + +atexit.register(write_history) diff --git a/hm/soispha/conf/rclone/default.nix b/hm/soispha/conf/rclone/default.nix new file mode 100644 index 00000000..bd0c1ac2 --- /dev/null +++ b/hm/soispha/conf/rclone/default.nix @@ -0,0 +1,7 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."rclone/rclone.conf".source = ./rclone.conf; +} diff --git a/hm/soispha/conf/rclone/rclone.conf b/hm/soispha/conf/rclone/rclone.conf new file mode 100644 index 00000000..9e1c4f08 --- /dev/null +++ b/hm/soispha/conf/rclone/rclone.conf @@ -0,0 +1,10 @@ +[vhack1] +type = sftp +host = server1.vhack.eu +user = soispha +key_use_agent = true +known_hosts_file = ~/.local/share/ssh/known_hosts +shell_type = unix +md5sum_command = md5sum +sha1sum_command = sha1sum + diff --git a/hm/soispha/conf/ssh/default.nix b/hm/soispha/conf/ssh/default.nix new file mode 100644 index 00000000..1359e4ab --- /dev/null +++ b/hm/soispha/conf/ssh/default.nix @@ -0,0 +1,15 @@ +{config, ...}: { + programs.ssh = { + enable = true; + compression = true; + hashKnownHosts = false; + serverAliveInterval = 240; + userKnownHostsFile = "${config.xdg.dataHome}/ssh/known_hosts"; + matchBlocks = { + "codeberg.org" = { + # TODO:: Remove this once they fix their ipv6 config + addressFamily = "inet"; + }; + }; + }; +} diff --git a/hm/soispha/conf/swayidle/config b/hm/soispha/conf/swayidle/config new file mode 100644 index 00000000..8ba07850 --- /dev/null +++ b/hm/soispha/conf/swayidle/config @@ -0,0 +1,5 @@ +timeout 180 'swaylock -fFu' + +timeout 360 'systemctl suspend-then-hibernate' + +before-sleep 'swaylock -f' diff --git a/hm/soispha/conf/swayidle/default.nix b/hm/soispha/conf/swayidle/default.nix new file mode 100644 index 00000000..6b8a7d80 --- /dev/null +++ b/hm/soispha/conf/swayidle/default.nix @@ -0,0 +1,29 @@ +{ + config, + pkgs, + ... +}: { + xdg.configFile."swayidle/config".source = ./config; + + # services.swayidle = { + # enable = true; + # events = [ + # { + # event = "before-sleep"; + # command = "${pkgs.swaylock}/bin/swaylock -f "; + # } + # ]; + # timeouts = [ + # { + # timeout = 180; + # command = "${pkgs.swaylock}/bin/swaylock -fFu "; + # } + # { + # timeout = 360; + # # TODO: systemctl is installed? + # command = "systemctl suspend-then-hibernate"; + # } + # ]; + # # systemdTarget = ""; # TODO: this might be usefull + # }; +} diff --git a/hm/soispha/conf/swaylock/commands.jpg b/hm/soispha/conf/swaylock/commands.jpg new file mode 100644 index 00000000..54016503 Binary files /dev/null and b/hm/soispha/conf/swaylock/commands.jpg differ diff --git a/hm/soispha/conf/swaylock/default.nix b/hm/soispha/conf/swaylock/default.nix new file mode 100644 index 00000000..7c3762cc --- /dev/null +++ b/hm/soispha/conf/swaylock/default.nix @@ -0,0 +1,10 @@ +{...}: { + programs.swaylock = { + enable = true; + settings = { + #image = "$WALLPAPER"; + image = "${./commands.jpg}"; + color = "000000"; + }; + }; +} diff --git a/hm/soispha/conf/swaylock/gnu.png b/hm/soispha/conf/swaylock/gnu.png new file mode 100644 index 00000000..d07dee3e Binary files /dev/null and b/hm/soispha/conf/swaylock/gnu.png differ diff --git a/hm/soispha/conf/tridactyl/config.vim b/hm/soispha/conf/tridactyl/config.vim new file mode 100644 index 00000000..84e290cb --- /dev/null +++ b/hm/soispha/conf/tridactyl/config.vim @@ -0,0 +1,47 @@ +" vim: filetype=vim + +" This wipes all existing settings. This means that if a setting in this file +" is removed, then it will return to default. In other words, this file serves +" as an enforced single point of truth for Tridactyl's configuration. +sanitize tridactyllocal tridactylsync + +" Just use a blank page for new tab. It would be nicer to use the standard +" Firefox homepage, but Tridactyl doesn't support this yet. +"TODO: use custome file +"set newtab file:///home/soispha/new.html + +" Set a nice colorscheme +colorscheme midnight + +" Delete temp files after use +alias editor_rm composite editor | jsb -p tri.native.run(`rm -f '${JS_ARG[0]}'`) +bind --mode=insert editor_rm +bind --mode=input editor_rm + +" Use vim in tmux for editor. +set editorcmd alacritty -e nvim + +" Ctrl-F should use the browser's native 'find' functionality. +unbind + +" But also support Tridactyl search too. +bind / fillcmdline find +bind ? fillcmdline find -? +bind l findnext 1 +bind L findnext -1 +" Remove search highlighting. +bind , nohlsearch +" Use sensitive case. Smart case would be nice here, but it doesn't work. +set findcase smartcase + +" Smooth scrolling, yes please. This is still a bit janky in Tridactyl. +set smoothscroll true + +" The default jump of 10 is a bit much. +bind t scrollline 5 +bind n scrollline -5 + +" K and J should move between tabs. x should close them. +bind T tabprev +bind N tabnext +bind x tabclose diff --git a/hm/soispha/conf/tridactyl/default.nix b/hm/soispha/conf/tridactyl/default.nix new file mode 100644 index 00000000..23307cfe --- /dev/null +++ b/hm/soispha/conf/tridactyl/default.nix @@ -0,0 +1,3 @@ +{...}: { + xdg.configFile."tridactyl/tridactylrc".source = ./config.vim; +} diff --git a/hm/soispha/conf/yambar/config/config.yml b/hm/soispha/conf/yambar/config/config.yml new file mode 100644 index 00000000..bb742fd3 --- /dev/null +++ b/hm/soispha/conf/yambar/config/config.yml @@ -0,0 +1,234 @@ +--- +# Config file for yambar +# Note that this may be version-dependent, this file is written for v1.8.0 + + +# Font anchors +font-main: &fontmain Source Code Pro:pixelsize=26 +font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=23 + +# Color anchors +fg-none: &fgnone 00000000 +fg-1: &fg1 c6ceefff +fg-blue: &fgblue 99d1dbff +fg-sapphire: &fgsapp 74c7ecdd +fg-green: &fggreen a6e3a1dd +fg-peach: &fgpeach fab387dd +fg-mauve: &fgmauve cba6f7dd +fg-teal: &fgteal 94e2d5dd +fg-lavendar: &fglav b4befedd +fg-focus: &fgfocus e78284ff +bg-1: &bg1 303446ff +bg-tag: &bgtag 585b70ff +bg-tag2: &bgtag2 45475aff +bg-urgent: &bgurgent e78284ff + +# Background blocks +background-block: &bgcblock {background: {color: *bg1 }} +background-block-urgent: &bgcurg {background: {color: *bgurgent }} + +# Underlines +underline-focused: &line {underline: { size: 3, color: *fgfocus}} +underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} +underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} +underline-resources: &linemem {underline: { size: 3, color: *fggreen}} +underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} +underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} +underline-weather: &linewea {underline: { size: 3, color: *fglav}} +underline-title: &linetitle {underline: { size: 3, color: *bgtag}} + +# Combined decorations +combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} +combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} +combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} +combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} +combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} + + +### Main + +bar: + location: top + height: 45 + layer: bottom + spacing: 0 + margin: 10 + border: {margin: 0, top-margin: 10} + foreground: *fg1 + background: *fgnone + font: *fontmain + + ### Left, river tags + left: + - river: + anchors: + - id: &name { text: "{id}" } + - string: &focus { stack: [ {background: {color: *bg1}} ] } + - string: &normal { string: { <<: *name, margin: 10 } } + - string: + &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } + - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } + - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - base: &river_base + default: *normal + conditions: + state == focused: *focused + state == unfocused: *unfocused + state == urgent: *urgent + state == invisible: + map: + conditions: + occupied: *occupied + ~occupied: *normal + content: + map: + on-click: + left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" + right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" + middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" + conditions: + id == 1: { map: { <<: *river_base } } + id == 2: { map: { <<: *river_base } } + id == 3: { map: { <<: *river_base } } + id == 4: { map: { <<: *river_base } } + id == 5: { map: { <<: *river_base } } + id == 6: { map: { <<: *river_base } } + id == 7: { map: { <<: *river_base } } + id == 8: { map: { <<: *river_base } } + id == 9: { map: { <<: *river_base } } + title: + map: + default: + { + string: + { + text: "{title}", + left-margin: 12, + right-margin: 12, + # max: 35, + deco: *linetitle + }, + } + conditions: + title == "": { string: { text: "" } } + + ### Center, clock & weather gadget + center: + - clock: + time-format: "%H:%M:%S %Z" + date-format: "%d/%m/%y (%a)" + foreground: *fgblue + content: + string: + text: " {date} {time} " + deco: *combclock + + ### Right, system tray + right: + #- network: + # name: wlp5s0 + # poll-interval: 10 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: {empty: {}} + # carrier: + # string: {text: "  {ssid} ", deco: *combutil} + #- network: + # name: enp4s0 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: + # string: {text: "  Eth failed ", deco: *combutil} + # carrier: {empty: {}} + + - script: # Sound volume + path: @volume_script@ + content: + map: + on-click: /bin/sh -c "pavucontrol" + conditions: + muted: + string: + text: " ﱝ " + deco: *bgcurg + ~muted: + string: {text: "  {volume}% ", deco: *combutil} + + - script: # Grade average + path: @grade_average_script@ + content: + string: + text: "  {grade} " + deco: *combmem + + #- backlight: + # name: intel_backlight + # content: + # - string: {text: "  {percent}% ", deco: *combutil} + + - script: # CPU + path: @cpu_script@ + content: + string: + text: "  {cpu}% " + deco: *combmem + + - script: # Memory info + path: @memory_script@ + content: + map: + conditions: + swapstate: + string: + text: "  {memperc}%({swapperc}%) " + deco: *combmem + ~swapstate: + string: + text: "  {memperc}% " + deco: *combmem + - script: # Disk space + path: @disk_script@ + content: + string: + text: "  {diskspace}({diskperc})" + deco: *combmem + #- battery: + # name: BAT0 + # poll-interval: 30 + # content: + # list: + # items: + # - ramp: + # tag: capacity + # items: + # - string: + # text: "  {capacity}%({estimate}) " + # deco: *bgcurg + # - string: + # text: "  {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: "  {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: "  {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + # - string: + # text: "  {capacity}%({estimate}) " + # deco: {stack: [ <<: *bgcblock, <<: *linebat]} + #- script: # tray + # path: /home/dt/.config/yambar/scripts/yambar-tray + # content: + # empty: {} + #- script: + # path: /home/dt/.config/yambar/scripts/yambar-tray-width + # poll-interval: 10 + # content: + # string: + # text: "{padding}" + # deco: *combmem diff --git a/hm/soispha/conf/yambar/config/laptop.yml b/hm/soispha/conf/yambar/config/laptop.yml new file mode 100644 index 00000000..805ffe5b --- /dev/null +++ b/hm/soispha/conf/yambar/config/laptop.yml @@ -0,0 +1,234 @@ +--- +# Config file for yambar +# Note that this may be version-dependent, this file is written for v1.8.0 + + +# Font anchors +font-main: &fontmain Source Code Pro:pixelsize=22 +font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=20 + +# Color anchors +fg-none: &fgnone 00000000 +fg-1: &fg1 c6ceefff +fg-blue: &fgblue 99d1dbff +fg-sapphire: &fgsapp 74c7ecdd +fg-green: &fggreen a6e3a1dd +fg-peach: &fgpeach fab387dd +fg-mauve: &fgmauve cba6f7dd +fg-teal: &fgteal 94e2d5dd +fg-lavendar: &fglav b4befedd +fg-focus: &fgfocus e78284ff +bg-1: &bg1 303446ff +bg-tag: &bgtag 585b70ff +bg-tag2: &bgtag2 45475aff +bg-urgent: &bgurgent e78284ff + +# Background blocks +background-block: &bgcblock {background: {color: *bg1 }} +background-block-urgent: &bgcurg {background: {color: *bgurgent }} + +# Underlines +underline-focused: &line {underline: { size: 3, color: *fgfocus}} +underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} +underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} +underline-resources: &linemem {underline: { size: 3, color: *fggreen}} +underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} +underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} +underline-weather: &linewea {underline: { size: 3, color: *fglav}} +underline-title: &linetitle {underline: { size: 3, color: *bgtag}} + +# Combined decorations +combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} +combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} +combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} +combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} +combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} + + +### Main + +bar: + location: top + height: 25 + layer: bottom + spacing: 0 + margin: 10 + border: {margin: 0, top-margin: 5} + foreground: *fg1 + background: *fgnone + font: *fontmain + + ### Left, river tags + left: + - river: + anchors: + - id: &name { text: "{id}" } + - string: &focus { stack: [ {background: {color: *bg1}} ] } + - string: &normal { string: { <<: *name, margin: 10 } } + - string: + &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } + - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } + - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } + - base: &river_base + default: *normal + conditions: + state == focused: *focused + state == unfocused: *unfocused + state == urgent: *urgent + state == invisible: + map: + conditions: + occupied: *occupied + ~occupied: *normal + content: + map: + on-click: + left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" + right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" + middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" + conditions: + id == 1: { map: { <<: *river_base } } + id == 2: { map: { <<: *river_base } } + id == 3: { map: { <<: *river_base } } + id == 4: { map: { <<: *river_base } } + id == 5: { map: { <<: *river_base } } + id == 6: { map: { <<: *river_base } } + id == 7: { map: { <<: *river_base } } + id == 8: { map: { <<: *river_base } } + id == 9: { map: { <<: *river_base } } + title: + map: + default: + { + string: + { + text: "{title}", + left-margin: 12, + right-margin: 12, + # max: 35, + deco: *linetitle + }, + } + conditions: + title == "": { string: { text: "" } } + + ### Center, clock & weather gadget + center: + - clock: + time-format: "%H:%M:%S %Z" + date-format: "%d/%m/%y (%a)" + foreground: *fgblue + content: + string: + text: " {date} {time} " + deco: *combclock + + ### Right, system tray + right: + #- network: + # name: wlp5s0 + # poll-interval: 10 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: {empty: {}} + # carrier: + # string: {text: "  {ssid} ", deco: *combutil} + #- network: + # name: enp4s0 + # content: + # map: + # on-click: /bin/sh -c "nmtui" + # conditions: + # ~carrier: + # string: {text: "  Eth failed ", deco: *combutil} + # carrier: {empty: {}} + + - script: # Sound volume + path: @volume_script@ + content: + map: + on-click: /bin/sh -c "pavucontrol" + conditions: + muted: + string: + text: " ﱝ " + deco: *bgcurg + ~muted: + string: {text: "  {volume}% ", deco: *combutil} + + - script: # Grade average + path: @grade_average_script@ + content: + string: + text: "  {grade} " + deco: *combmem + + - backlight: + name: @backlight@ + content: + - string: {text: "  {percent}% ", deco: *combutil} + + - script: # CPU + path: @cpu_script@ + content: + string: + text: "  {cpu}% " + deco: *combmem + + - script: # Memory info + path: @memory_script@ + content: + map: + conditions: + swapstate: + string: + text: "  {memperc}%({swapperc}%) " + deco: *combmem + ~swapstate: + string: + text: "  {memperc}% " + deco: *combmem + - script: # Disk space + path: @disk_script@ + content: + string: + text: "  {diskspace}({diskperc})" + deco: *combmem + - battery: + name: BAT0 + poll-interval: 300 + content: + list: + items: + - ramp: + tag: capacity + items: + - string: + text: "  {capacity}%({estimate}) " + deco: *bgcurg + - string: + text: "  {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: "  {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: "  {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + - string: + text: "  {capacity}%({estimate}) " + deco: {stack: [ <<: *bgcblock, <<: *linebat]} + #- script: # tray + # path: /home/dt/.config/yambar/scripts/yambar-tray + # content: + # empty: {} + #- script: + # path: /home/dt/.config/yambar/scripts/yambar-tray-width + # poll-interval: 10 + # content: + # string: + # text: "{padding}" + # deco: *combmem diff --git a/hm/soispha/conf/yambar/default.nix b/hm/soispha/conf/yambar/default.nix new file mode 100644 index 00000000..0bcf8419 --- /dev/null +++ b/hm/soispha/conf/yambar/default.nix @@ -0,0 +1,53 @@ +{ + nixosConfig, + sysLib, + system, + pkgs, + grades, + yambar_cpu, + yambar_memory, + ... +}: let + makeScript = { + file, + dependencies, + ... + }: + sysLib.writeShellScriptWithLibrary { + name = "${builtins.baseNameOf file}"; + src = file; + dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); + } + + "/bin/${builtins.baseNameOf file}"; +in { + xdg.configFile."yambar/config.yml".source = pkgs.substituteAll { + src = + if nixosConfig.soispha.laptop.enable + then ./config/laptop.yml + else ./config/config.yml; + + backlight = + if nixosConfig.soispha.laptop.enable + then nixosConfig.soispha.laptop.backlight + else ""; + volume_script = makeScript { + dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;}; + file = ./scripts/sound-volume; + }; + grade_average_script = makeScript { + dependencies = + [ + grades.outputs.packages.${system}.default + ] + ++ (builtins.attrValues {inherit (pkgs) coreutils gawk;}); + file = ./scripts/grades-average; + }; + cpu_script = yambar_cpu.app.${system}.default.program; + memory_script = yambar_memory.app.${system}.default.program; + + disk_script = makeScript { + dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;}; + file = ./scripts/disk; + }; + }; +} diff --git a/hm/soispha/conf/yambar/scripts/disk b/hm/soispha/conf/yambar/scripts/disk new file mode 100755 index 00000000..83b23ad9 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/disk @@ -0,0 +1,22 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# Main loop +while true; do + # vars + used_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) + all_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") + + + # Check space available (4) and percentage used (5) + spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') + + echo "diskspace|string|$used_space" + echo "diskperc|string|$spaceperc" + echo "" + sleep 1 +done + +# vim: ft=sh diff --git a/hm/soispha/conf/yambar/scripts/grades-average b/hm/soispha/conf/yambar/scripts/grades-average new file mode 100755 index 00000000..20de5684 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/grades-average @@ -0,0 +1,15 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while true; do + grade="$(grades list average | awk '{print $2}')"; + + echo "grade|string|$grade"; + echo ""; + + sleep 1; +done + +# vim: ft=sh diff --git a/hm/soispha/conf/yambar/scripts/network b/hm/soispha/conf/yambar/scripts/network new file mode 100755 index 00000000..8e02d6dc --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/network @@ -0,0 +1,47 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +retest=120 +retest_if_con_fails=10 +backend=nmcli + +case "$backend" in + "nmcli") # Test for connectivity with nmcli + while true; do + connection_status=$(nmcli networking connectivity) + if [ "$connection_status" = "full" ]; then + echo "internet|string|Connected" + echo "" + sleep $retest + else + echo "internet|string|Disconnected" + echo "" + sleep $retest_if_con_fails + fi + done + ;; + "ping") # Test for connectivity with ping + ip_address='8.8.8.8' + ping_number=3 + + while true; do + + ping_result=$(mktmp) + ping $ip_address -c $ping_number -q | awk 'BEGIN {FS="/"} END {print $5}' > "$ping_result" + + if [ "$(cat "$ping_result" | wc -l)" -eq 0 ]; then + echo "med|string|No connection" + echo "" + sleep $retest_if_con_fails + else + echo "med|string|$(cat "$ping_result") ms" + echo "" + sleep $retest + fi + done + ;; +esac + +# vim: ft=sh diff --git a/hm/soispha/conf/yambar/scripts/old/amixer-monitor b/hm/soispha/conf/yambar/scripts/old/amixer-monitor new file mode 100755 index 00000000..9e75acfa --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/amixer-monitor @@ -0,0 +1,24 @@ +#!/bin/sh +# An improved amixer script that actually detects volume beyond 100% + + +SLEEPTIME=1 + + +while true; do + + volume=$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/"} {print $2 }' | tr -d "%" | tr -d ' ') + + if [ "$volume" -eq 0 ]; then + echo "muted|bool|true" + + else + # Read sink volume in percentages + echo "volume|string|$volume" + echo "muted|bool|false" + fi + + echo "" + sleep "$SLEEPTIME" + +done diff --git a/hm/soispha/conf/yambar/scripts/old/cpu b/hm/soispha/conf/yambar/scripts/old/cpu new file mode 100755 index 00000000..bae820d0 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/cpu @@ -0,0 +1,126 @@ +#!/bin/bash +# I didn't write this script; this is almost directly copied from the dnkl/yambar github. + + +# cpu.sh - measures CPU usage at a configurable sample interval +# +# Usage: cpu.sh INTERVAL_IN_SECONDS +# +# This script will emit the following tags on stdout (N is the number +# of logical CPUs): +# +# Name Type +# -------------------- +# cpu range 0-100 +# cpu0 range 0-100 +# cpu1 range 0-100 +# ... +# cpuN-1 range 0-100 +# +# I.e. ‘cpu’ is the average (or aggregated) CPU usage, while cpuX is a +# specific CPU’s usage. +# +# Example configuration (update every second): +# +# - script: +# path: /path/to/cpu.sh +# args: [1] +# content: {string: {text: "{cpu}%"}} +# + +interval=2 + +case ${interval} in + ''|*[!0-9]*) + echo "interval must be an integer" + exit 1 + ;; + *) + ;; +esac + +# Get number of CPUs, by reading /proc/stat +# The output looks like: +# +# cpu A B C D ... +# cpu0 A B C D ... +# cpu1 A B C D ... +# cpuN A B C D ... +# +# The first line is a summary line, accounting *all* CPUs +IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) +cpu_count=$((${#all_cpu_stats[@]} - 1)) + +# Arrays of ‘previous’ idle and total stats, needed to calculate the +# difference between each sample. +prev_idle=() +prev_total=() +for i in $(seq ${cpu_count}); do + prev_idle+=(0) + prev_total+=(0) +done + +prev_average_idle=0 +prev_average_total=0 + +while true; do + IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) + + usage=() # CPU usage in percent, 0 <= x <= 100 + + average_idle=0 # All CPUs idle time since boot + average_total=0 # All CPUs total time since boot + + for i in $(seq 0 $((cpu_count - 1))); do + # Split this CPUs stats into an array + stats=($(echo "${all_cpu_stats[$((i + 1))]}")) + + # man procfs(5) + user=${stats[1]} + nice=${stats[2]} + system=${stats[3]} + idle=${stats[4]} + iowait=${stats[5]} + irq=${stats[6]} + softirq=${stats[7]} + steal=${stats[8]} + guest=${stats[9]} + guestnice=${stats[10]} + + # Guest time already accounted for in user + user=$((user - guest)) + nice=$((nice - guestnice)) + + idle=$((idle + iowait)) + + total=$((user + nice + system + irq + softirq + idle + steal + guest + guestnice)) + + average_idle=$((average_idle + idle)) + average_total=$((average_total + total)) + + # Diff since last sample + diff_idle=$((idle - prev_idle[i])) + diff_total=$((total - prev_total[i])) + + usage[i]=$((100 * (diff_total - diff_idle) / diff_total)) + + prev_idle[i]=${idle} + prev_total[i]=${total} + done + + diff_average_idle=$((average_idle - prev_average_idle)) + diff_average_total=$((average_total - prev_average_total)) + + average_usage=$((100 * (diff_average_total - diff_average_idle) / diff_average_total)) + + prev_average_idle=${average_idle} + prev_average_total=${average_total} + + echo "cpu|range:0-100|${average_usage}" + for i in $(seq 0 $((cpu_count - 1))); do + echo "cpu${i}|range:0-100|${usage[i]}" + done + + echo "" + sleep "${interval}" +done diff --git a/hm/soispha/conf/yambar/scripts/old/dfspace b/hm/soispha/conf/yambar/scripts/old/dfspace new file mode 100755 index 00000000..0b262481 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/dfspace @@ -0,0 +1,23 @@ +#!/bin/sh + +# Sleep seconds +timer="60" + +# Main loop +while true; do + + # vars + used_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) + all_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") + + + # Check space available (4) and percentage used (5) + spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') + + echo "diskspace|string|$used_space" + echo "diskperc|string|$spaceperc" + echo "" + sleep $timer + +done + diff --git a/hm/soispha/conf/yambar/scripts/old/grades-average b/hm/soispha/conf/yambar/scripts/old/grades-average new file mode 100755 index 00000000..a04b958c --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/grades-average @@ -0,0 +1,12 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + +grade=$(grades list average | awk '{print $2}'); + +echo "grade|string|$grade"; +echo ""; + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/hm/soispha/conf/yambar/scripts/old/meminfo b/hm/soispha/conf/yambar/scripts/old/meminfo new file mode 100755 index 00000000..0156e94c --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/meminfo @@ -0,0 +1,37 @@ +#!/bin/sh +# Checks memory usage + +# Number of seconds to retest +timer=5 + +# Main loop +while true; do + + mem_total=$(LANG=C free -b|awk '/^Mem:/{print $2}') + mem_used=$(LANG=C free -b|awk '/^Mem:/{print $3}') + swap_total=$(LANG=C free -b|awk '/^Swap:/{print $2}') + swap_used=$(LANG=C free -b|awk '/^Swap:/{print $3}') + + + memperc=$(echo "$mem_used" "$mem_total" | awk '{ div = 100 * ($1 / $2)} { printf "%.0f ", div }' | tr -d ' ' ) + swapperc=$(echo "$swap_used" "$swap_total" | awk '{ + if ( $1 == 0 || $2 == 0 ) { + print "%" + } else { + div = 100 * ($1 / $2); + printf "%.0f ", div +} +}' | tr -d ' ' ) + + +echo "memperc|string|$memperc" +if [ "$swapperc" = "%" ];then + echo "swapstate|bool|false" +else + echo "swapperc|string|$swapperc" + echo "swapstate|bool|true" +fi +echo "" +sleep "$timer" + +done diff --git a/hm/soispha/conf/yambar/scripts/old/nmclitest b/hm/soispha/conf/yambar/scripts/old/nmclitest new file mode 100755 index 00000000..3e8bc73a --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/nmclitest @@ -0,0 +1,23 @@ +#!/bin/sh +# Test for connectivity with nmcli + +Timer=${1:-120} # Number of seconds to retest +Timer2=${2:-10} # Number of seconds to retest if connection fails + +# Main loop +while true; do + + CONN=$(nmcli networking connectivity) + + if [[ "$CONN" == "full" ]]; then + echo "internet|string|Connected" + echo "" + sleep $Timer + else + echo "internet|string|Disconnected" + echo "" + sleep $Timer2 + fi + +done + diff --git a/hm/soispha/conf/yambar/scripts/old/pingtest b/hm/soispha/conf/yambar/scripts/old/pingtest new file mode 100755 index 00000000..2b5f9998 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/pingtest @@ -0,0 +1,28 @@ +#!/bin/sh +# Test for connectivity with ping + +Timer=${1:-120} # Number of seconds to retest +Timer2=${2:-10} # Number of seconds to retest if connection fails +IP=${3:-'8.8.8.8'} # IP address to test, defaults to Google +PCount=${4:-3} # Number of pings to send + +# Main loop +while true; do + + # Pings the IP address for five times + PINGSTR=$(ping $IP -c $PCount -q) + # Use text formatting to get min/max ms delays + MED=$(echo $PINGSTR | sed 's/min\/avg\/max\/mdev = /\n/g' | tail -n 1 | sed 's/\//\t/g' | cut -f2) + + if [[ "$MED" == "" ]]; then + echo "med|string|No connection" + echo "" + sleep $Timer2 + else + echo "med|string|$MED ms" + echo "" + sleep $Timer + fi + +done + diff --git a/hm/soispha/conf/yambar/scripts/old/yambar-tray b/hm/soispha/conf/yambar/scripts/old/yambar-tray new file mode 100755 index 00000000..1704c6dd --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/yambar-tray @@ -0,0 +1,27 @@ +#!/bin/sh + + +pkill stalonetray +pkill trayer + +# launch a tray. +echo + +sleep 0.1 # make sure yambar starts first so we can draw on tpo of it + +# trayer-srg fork! +trayer \ + --edge top \ + --tint 0x24242400 \ + --align right \ + --height 20 \ + --expand false \ + --transparent true \ + --alpha 0 \ + --width 20 \ + --monitor primary \ + --widthtype request + # &>/dev/null + + + diff --git a/hm/soispha/conf/yambar/scripts/old/yambar-tray-width b/hm/soispha/conf/yambar/scripts/old/yambar-tray-width new file mode 100755 index 00000000..00544e70 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/old/yambar-tray-width @@ -0,0 +1,28 @@ +#!/bin/sh +# shellcheck disable=SC2086 +# shellcheck source=/dev/null +. ~/.local/lib/shell/lib + + +CHARWIDTH=8 # i guess? + +tray_width_px() { + xwininfo -name panel | # trayer names its window "panel" + grep -i width: | + awk '{print $2}' +} + +px_to_spaces() { + spaces="$((1 + ${1:-0} / $CHARWIDTH))" + printf "% *s\n" $spaces +} + +sleep 0.2 # be sure trayer is already up + +output="$(px_to_spaces `tray_width_px`)" +echo "padding|string|$output" +echo "" + + + +if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/hm/soispha/conf/yambar/scripts/sound-volume b/hm/soispha/conf/yambar/scripts/sound-volume new file mode 100755 index 00000000..8494cbd5 --- /dev/null +++ b/hm/soispha/conf/yambar/scripts/sound-volume @@ -0,0 +1,20 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +while true; do + volume="$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/" } {gsub("%","",$2); gsub(" ","",$2)} {printf $2}')" + + if [ "$volume" -eq 0 ]; then + echo "muted|bool|true" + else + echo "volume|string|$volume" + echo "muted|bool|false" + fi + echo "" + + sleep 1; +done + +# vim: ft=sh diff --git a/hm/soispha/conf/zsh/config/custom_cursor.sh b/hm/soispha/conf/zsh/config/custom_cursor.sh new file mode 100644 index 00000000..9a6da012 --- /dev/null +++ b/hm/soispha/conf/zsh/config/custom_cursor.sh @@ -0,0 +1,40 @@ +# Change cursor shape for different vi modes. +function zle-keymap-select { + if [[ ${KEYMAP} == vicmd ]] || + [[ $1 = 'block' ]]; then + echo -ne '\e[1 q' + elif [[ ${KEYMAP} == main ]] || + [[ ${KEYMAP} == viins ]] || + [[ ${KEYMAP} = '' ]] || + [[ $1 = 'beam' ]]; then + echo -ne '\e[5 q' + fi +} +zle -N zle-keymap-select + +# ci", ci', ci`, di", etc +autoload -U select-quoted +zle -N select-quoted +for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done +done + +# ci{, ci(, ci<, di{, etc +autoload -U select-bracketed +zle -N select-bracketed +for m in visual viopp; do + for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do + bindkey -M $m $c select-bracketed + done +done + +zle-line-init() { + zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) + echo -ne "\e[5 q" +} +zle -N zle-line-init + +echo -ne '\e[5 q' # Use beam shape cursor on startup. +precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. diff --git a/hm/soispha/conf/zsh/config/zsh-init.sh b/hm/soispha/conf/zsh/config/zsh-init.sh new file mode 100644 index 00000000..4d54d058 --- /dev/null +++ b/hm/soispha/conf/zsh/config/zsh-init.sh @@ -0,0 +1,39 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +# Flex on the ubuntu users +[ "$NVIM" ] || hyfetch +#loginctl show-session $XDG_SESSION_ID + +## Enable colors and change prompt: +#autoload -Uz colors && colors +#autoload -Uz compinit && compinit -u +## Edit line in vim buffer ctrl-v +autoload -Uz edit-command-line; zle -N edit-command-line +## Enter vim buffer from normal mode +#autoload -Uz edit-command-line && zle -N edit-command-line +bindkey "^V" edit-command-line + +## zstyles +#zstyle ':completion:*' menu select +## Auto complete with case insensitivity +#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + +#zmodload zsh/complist +#fpath+=/home/dt/.config/zsh/comp +#compinit +#_comp_options+=(globdots) # Include hidden files. +# +## Source configs +#source "${ZDOTDIR}/ali.sh" +#source "${ZDOTDIR}/prompt.sh" +#source "${ZDOTDIR}/hotkeys.sh" +#source "./${path_custom_cursor}" +#source ~/.local/lib/shell/lib +# +## Load zsh-syntax-highlighting +#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +## Suggest aliases for commands +#source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh +# +##eval "$(lua ~/scripts/z.lua --init zsh enhanced)" diff --git a/hm/soispha/conf/zsh/config/zsh-prompt.sh b/hm/soispha/conf/zsh/config/zsh-prompt.sh new file mode 100644 index 00000000..26d478ef --- /dev/null +++ b/hm/soispha/conf/zsh/config/zsh-prompt.sh @@ -0,0 +1,63 @@ +#vim:ft=zsh +_command_time_preexec() { + timer=${timer:-$SECONDS} +} + +_command_time_precmd() { + PROMPT_TMP_DIR=$(mktemp) + if [ $timer ]; then + ts=$(($SECONDS - $timer)) + tts=$ts + mi=0 + ho=0 + if [ $ts -ge 3 ];then + while [ $ts -ge 60 ];do + ts=$((ts-60)) + mi=$((mi+1)) + done + + while [ $mi -ge 60 ];do + mi=$((mi-60)) + ho=$((ho+1)) + done + + if [ $tts -ge 3600 ];then + out=$(printf '%dh %dm %ds\n' $ho $mi $ts) + elif [ $tts -ge 60 ];then + out=$(printf '%dm %ds\n' $mi $ts) + elif [ $tts -lt 60 ];then + out=$(printf '%ds\n' $ts) + fi + + export psvar[1]="took $(printf '%s ' "$out")" + echo $psvar[1] > $PROMPT_TMP_DIR + fi + + unset timer + unset ts + unset tts + unset mi + unset ho +fi +} + +_command_ro_precmd() { +if ! [ -w $(pwd) ];then + echo " " +fi +} + +preexec_functions+=(_command_time_preexec) +precmd_functions+=(_command_time_precmd) + +blue="14" +red="9" +white="15" +setopt PROMPT_SUBST +export PROMPT='%(?.%F{$blue}.%F{$red})%B%3~%(!. %F{$red}as root %f. )%F{$white}$(if [ -n $PROMPT_TMP_DIR ];then cat $PROMPT_TMP_DIR 2>/dev/null; rm $PROMPT_TMP_DIR 2>/dev/null;fi)%f%(?.%F{$blue}.%F{$red})%F{$red}$(_command_ro_precmd)%F{$blue}❯ %b%f' +export RPROMPT='' + +#%(2V.%F{$red}%2v%f$(export psvar[2]="") .) + +# TODO:: +# Add git support diff --git a/hm/soispha/conf/zsh/default.nix b/hm/soispha/conf/zsh/default.nix new file mode 100644 index 00000000..11011977 --- /dev/null +++ b/hm/soispha/conf/zsh/default.nix @@ -0,0 +1,139 @@ +{ + config, + pkgs, + lib, + shell_library, + system, + osConfig, + ... +}: { + # TODO: ADD THIS ADDON + # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it. + # TODO: find something better for this use case + # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed + home.sessionPath = []; + programs.zsh = { + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + + autocd = true; + + dotDir = ".config/zsh"; + + history = { + extended = true; + ignoreDups = false; + expireDuplicatesFirst = false; + ignoreSpace = false; # TODO: I might change that + + path = "${config.xdg.dataHome}/zsh/history"; + save = 9000000; # number of lines to save + size = 9000000; # number of lines to keep + share = false; # share between sessions + }; + historySubstringSearch = { + enable = true; + searchDownKey = "^[[B"; # DOWN Arrow key + searchUpKey = "^[[A"; # UP Arrow key + }; + + loginExtra = + '' + eval $(ssh-agent -s) > /dev/null # start ssh agent + '' + + lib.concatStringsSep "\nsetopt " [ + "setopt AUTO_CD" # This is needed as first item + "AUTO_PUSHD" + "CHASE_DOTS" + + "ALWAYS_TO_END" + + "EXTENDED_HISTORY" + "HIST_ALLOW_CLOBBER" + "HIST_VERIFY" + "HIST_FCNTL_LOCK" + "APPEND_HISTORY" + + "DVORAK" + "CORRECT" + + "PROMPT_SUBST" + "TRANSIENT_RPROMPT" # maybe? + + "COMBINING_CHARS" + "VI" + ]; + + initExtraFirst = + builtins.readFile ./config/zsh-init.sh + + builtins.readFile ./config/zsh-prompt.sh + + builtins.readFile ./config/custom_cursor.sh + + builtins.readFile "${pkgs.fzf}/share/fzf/key-bindings.zsh" + + "SHELL_LIBRARY_VERSION=\"1.1.4\" source ${shell_library.rawLib.${system}}"; + shellAliases = { + ll = ". ll"; + hisea = "history 0 | grep"; + }; + sessionVariables = { + EDITOR = "nvim"; + IVIEWER = "imv"; + READER = "zathura"; + VISUAL = "nvim"; + CODEEDITOR = "nvim"; + TERMINAL = "alacritty"; + BROWSER = "firefox"; + COLORTERM = "truecolor"; + PAGER = "less -R"; + WM = "river"; + WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper"; + + # FUNCNEST for more functions in functions + #FUNCNEST = "2000"; + + WALLPAPERDIR = "$HOME/media/pictures/wallpapers/"; + LESS = "R"; + MANPAGER = "less -R --use-color -Dd+r -Du+b"; + LIBVIRT_DEFAULT_URI = "qemu:///system"; + + BEMENU_SCALE = "1.5"; + BEMENU_BACKEND = "wayland"; + BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff"; + + MPD_HOST = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd/socket"; + + # Clean the home dir {{{ + CARGO_HOME = "${config.xdg.dataHome}/cargo"; + + #_JAVA_OPTIONS = lib.concatStringsSep " " [ + # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"'' + # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"'' + # ]; + #GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle"; + #GOPATH = "${config.xdg.dataHome}/go"; + #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + #LESSHISFILE = "${config.xdg.cacheHome}/less/history"; + #LESSKEYIN = "${config.xdg.configHome}/less/lesskey"; + #RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; + #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; + #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages"; + #PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc"; + #XAUTHORITY = "${config.xdg.stateHome}/Xauthority"; + #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}"; + #IPYTHONDIR = "${config.xdg.configHome}/ipython"; + #PARALLEL_HOME = "${config.xdg.configHome}/parallel"; + #STACK_XDG = "1"; + #WINEPREFIX = "${config.xdg.dataHome}/wine"; + # }}} + + # Export Wayland env Vars {{{ + QT_QPA_PLATFORM = "wayland"; + QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct + CLUTTER_BACKEND = "wayland"; + SDL_VIDEODRIVER = "wayland"; # might brake some things + MOZ_ENABLE_WAYLAND = "1"; + # }}} + }; + }; +} diff --git a/hm/soispha/default.nix b/hm/soispha/default.nix new file mode 100644 index 00000000..b6a00038 --- /dev/null +++ b/hm/soispha/default.nix @@ -0,0 +1,61 @@ +{ + impermanence, + nixNeovim, + nixVim, + ... +}: let + # TODO: actually use this in the user config + username = "soispha"; + homeDirectory = "/home/${username}"; + + # xdg + configHome = "${homeDirectory}/.config"; + dataHome = "${homeDirectory}/.local/share"; + stateHome = "${homeDirectory}/.local/state"; + cacheHome = "${homeDirectory}/.cache"; + binHome = "${homeDirectory}/.local/bin"; + # TODO: add XDG_RUNTIME_DIR +in { + imports = [ + ./conf + ./files + ./impermanence + ./pkgs + ./wms + + impermanence.nixosModules.home-manager.impermanence + nixNeovim.nixosModules.default + nixVim.homeManagerModules.nixvim + ]; + + # I don't know what this does, but I've seen it a lot online, so it should be good, right? + programs.home-manager.enable = true; + + home = { + inherit username homeDirectory; + stateVersion = "23.05"; + enableNixpkgsReleaseCheck = true; + }; + xdg = { + inherit configHome dataHome stateHome cacheHome; #binHome; # TODO: add binHome, when the standart is extended + enable = true; + + /* + TODO: add this + desktopEntries = {}; + */ + + userDirs = { + enable = true; + createDirectories = true; + desktop = null; + documents = "${homeDirectory}/school/general"; + download = "${homeDirectory}/media/downloads"; + music = "${homeDirectory}/media/music"; + pictures = "${homeDirectory}/media/pictures"; + videos = "${homeDirectory}/media/videos"; + templates = "${homeDirectory}/media/templates"; + publicShare = "${homeDirectory}/media/public"; + }; + }; +} diff --git a/hm/soispha/files/default.nix b/hm/soispha/files/default.nix new file mode 100644 index 00000000..4e16077c --- /dev/null +++ b/hm/soispha/files/default.nix @@ -0,0 +1,5 @@ +{config, ...}: { + imports = [ + ./wallpaper + ]; +} diff --git a/hm/soispha/files/wallpaper/abstract-nord.png b/hm/soispha/files/wallpaper/abstract-nord.png new file mode 100644 index 00000000..5ef498bf Binary files /dev/null and b/hm/soispha/files/wallpaper/abstract-nord.png differ diff --git a/hm/soispha/files/wallpaper/default.nix b/hm/soispha/files/wallpaper/default.nix new file mode 100644 index 00000000..2c9b3368 --- /dev/null +++ b/hm/soispha/files/wallpaper/default.nix @@ -0,0 +1,8 @@ +{config, ...}: { + home.file = { + wallpaper = { + source = ./abstract-nord.png; + target = "media/pictures/wallpaper"; + }; + }; +} diff --git a/hm/soispha/impermanence/default.nix b/hm/soispha/impermanence/default.nix new file mode 100644 index 00000000..d0cd1ff1 --- /dev/null +++ b/hm/soispha/impermanence/default.nix @@ -0,0 +1,31 @@ +{ + lib, + nixosConfig, + ... +}: { + config = lib.mkIf nixosConfig.soispha.impermanence.enable { + home.persistence."/srv/home/soispha" = { + allowOther = true; + directories = [ + ".local/share" + + ".local/state/nvim" + ".local/state/wireplumber" + + ".config/Signal" + ".config/Element" + ".config/iamb/profiles" + + ".cache" + ".mozilla" + + "media" + "repos" + "school" + ]; + files = [ + ".local/state/lesshst" + ]; + }; + }; +} diff --git a/hm/soispha/pkgs/default.nix b/hm/soispha/pkgs/default.nix new file mode 100644 index 00000000..c8135d21 --- /dev/null +++ b/hm/soispha/pkgs/default.nix @@ -0,0 +1,164 @@ +{ + pkgs, + sysLib, + grades, + snap-sync, + system, + flake_update, + ... +}: +with pkgs; let + snap-sync-pkgs = pkgs.writeShellScriptBin "snap-sync" (builtins.readFile "${snap-sync}/bin/snap-sync"); + shell-scripts = (import ./scripts.nix) {inherit pkgs sysLib;}; + + Gui = { + Terminals = [ + # foot # wayland native terminal + alacritty # default terminal + ]; + Browsers = [ + #ungoogled-chromium # web browser (only for web programming) + #brave + ]; + + ImageManipulation = [ + #krita # new, and better (KDE) + #gimp # conservative, and old (GNOME) + ]; + + Social = [ + mumble # voice chat software (client) + lutris # multiple game store clients + + # nheko # best matrix client (as of today) + # element-desktop # nheko didn't work + signal-desktop # to avoid encryption problems with signal-bridge + ]; + + Misc = [ + #kalzium # Periodic Table of Elements (`element` is [sort of] better) + keepassxc # password manager + #onlykey # OnlyKey Chrome Desktop App + anki-bin # spaced repetition + ]; + }; + + TuiCli = { + EyeCandy = [ + #banner # Print large banners to ASCII terminals + cmatrix # A curses-based scrolling 'Matrix'-like screen + hyfetch # Neofetch with LGBTQ pride flags. + ]; + + Social = [ + iamb # best tui matrix client (as of today) + ]; + + Misc = [ + android-file-transfer # Android MTP client with minimalistic UI + #xdg-ninja # A shell script which checks your $HOME for unwanted files and directories. + xdg-utils # open urls and such things + yokadi # Command line oriented, sqlite powered, todo list + killall # kill a application by name + ]; + + WM = { + river = [river]; # A dynamic tiling wayland compositor + + CLITools = [ + lswt # List Wayland toplevels + wl-clipboard # Command-line copy/paste utilities + swaylock # lockscreen + ]; + + Media = [ + wf-recorder # Screen recorder + ]; + }; + + Media = { + View = [ + imv # Image viewer + ]; + + Listen = [ + pulseaudio # set the volume with pactl + ncmpc # mpd player client + mpc-cli # a cli mpd client + ]; + }; + + Hardware = { + Storage = [ + #compsize # Calculate compression ratio of a set of files on Btrfs + # TODO: smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives + ]; + + Input = [ + #piper # GTK application to configure gaming mice + ]; + + Printer = [ + # TODO: sane-airscan # SANE - SANE backend for AirScan (eSCL) and WSD document scanners + ]; + }; + + FileListers = [ + tree # A directory listing program displaying a depth indented list of files + fd # Simple, fast and user-friendly alternative to find + ripgrep # A search tool that combines the usability of ag with the raw speed of grep + fzf # used to quickly move around with its keybindings + ]; + + Editors = [ + ed # A POSIX-compliant line-oriented text editor + #sed # GNU stream editor + vim # The original ex/vi text editor (this is `vim` and not `vi`, as `vi` is unfree) + #neovim # Fork of Vim aiming to improve user experience, plugins, and GUIs + ]; + + Programming = { + GeneralTools = [ + git # the fast distributed version control system + git-crypt # mostly here to avoid problems in repositories, where the flake can't be loaded + glow # Command-line markdown renderer + ]; + }; + }; + # TODO: unmaintained, find sth else: + # handlr # Powerful alternative to xdg-utils written in Rust + mapFun = x: + if builtins.isAttrs x + then + if lib.isDerivation x + then [x] + else builtins.attrValues x + else [x]; +in { + home.packages = + [ + snap-sync-pkgs + flake_update.outputs.packages.${system}.default + grades.outputs.packages.${system}.default + ] + ++ shell-scripts + ++ (with builtins; + concatLists + (concatLists [ + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (attrValues Gui))))))) + + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (concatMap mapFun + (attrValues TuiCli))))))) + ])); +} diff --git a/hm/soispha/pkgs/scripts.nix b/hm/soispha/pkgs/scripts.nix new file mode 100644 index 00000000..544975c5 --- /dev/null +++ b/hm/soispha/pkgs/scripts.nix @@ -0,0 +1,97 @@ +{ + pkgs, + sysLib, + ... +}: let + write_script = { + name, + path, + dependencies, + }: + sysLib.writeShellScriptWithLibrary { + inherit name; + src = ./scripts/${path}/${name}; + dependencies = dependencies ++ [pkgs.dash]; + }; + aumo-scr = write_script { + name = "aumo"; + path = "apps"; + dependencies = builtins.attrValues {inherit (pkgs) udisks gawk gnused gnugrep sudo;}; + }; + con2pdf-scr = write_script { + name = "con2pdf"; + path = "apps"; + dependencies = builtins.attrValues {inherit (pkgs) sane-backends imagemagick coreutils fd;}; + }; + + dldragon-scr = write_script { + name = "dldragon"; + path = "small_functions"; + dependencies = builtins.attrValues {inherit (pkgs) curl xdragon;}; + }; + gtk-themes-scr = write_script { + name = "gtk-themes"; + path = "small_functions"; + dependencies = builtins.attrValues {inherit (pkgs) glib;}; + }; + screen_shot-scr = write_script { + name = "screen_shot"; + path = "small_functions"; + dependencies = builtins.attrValues {inherit (pkgs) grim slurp alacritty;}; # TODO: add llp + }; + mocs-scr = write_script { + name = "mocs"; + path = "small_functions"; + dependencies = builtins.attrValues {inherit (pkgs) ncmpc procps;}; # TODO: add mymocp + }; + update-sys-scr = write_script { + name = "update-sys"; + path = "small_functions"; + dependencies = builtins.attrValues {inherit (pkgs) git git-crypt nixos-rebuild sudo openssh coreutils mktemp gnugrep gnused;}; + }; + + backsnap-scr = write_script { + name = "backsnap"; + path = "wrappers"; + dependencies = builtins.attrValues {}; # TODO: add snap-sync + }; + ll-scr = sysLib.writeShellScriptWithLibraryUnwrapped { + name = "ll"; + src = ./scripts/wrappers/ll; + }; + # TODO: this need to be replaced with a wayland alternative + # llp-scr = write_script { + # name = "llp"; + # path = "wrappers"; + # dependencies = builtins.attrValues {inherit (pkgs) lf ueberzug;}; + # }; + spodi-scr = write_script { + name = "spodi"; + path = "wrappers"; + dependencies = builtins.attrValues {inherit (pkgs) gawk expect spotdl fd coreutils;}; + }; + virsh-del-scr = write_script { + name = "virsh-del"; + path = "wrappers"; + dependencies = builtins.attrValues {inherit (pkgs) libvirt;}; + }; + yti-scr = write_script { + name = "yti"; + path = "wrappers"; + dependencies = builtins.attrValues {inherit (pkgs) gawk expect yt-dlp;}; + }; +in [ + aumo-scr + con2pdf-scr + dldragon-scr + gtk-themes-scr + screen_shot-scr + mocs-scr + update-sys-scr + backsnap-scr + ll-scr + # llp-scr # TODO: see above + spodi-scr + virsh-del-scr + yti-scr +] diff --git a/hm/soispha/pkgs/scripts/apps/aumo b/hm/soispha/pkgs/scripts/apps/aumo new file mode 100755 index 00000000..e49ac82d --- /dev/null +++ b/hm/soispha/pkgs/scripts/apps/aumo @@ -0,0 +1,54 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +# TODO: rewrite this + +if [ "$1" = "-u" ];then udisksctl unmount -b "$(cat "$HOME/.cache/aumo/mnt_disk")"; exit 0; fi +all_available_disks=$(mktemp) +awk '{print $4}' /proc/partitions | sed '1 s|.*||' > "$all_available_disks" + +mounted_disk=$(mktemp) +awk '{print $1}' /proc/mounts > "$mounted_disk" + +unmounted_disks=$(mktemp) + +for i in $(cat $all_available_disks);do + if ! grep -qw "/dev/$i" $mounted_disk && ! ls /sys/block/$i/*/partition > /dev/null 2> /dev/null;then echo $i >> $unmounted_disks;fi +done + + +u=1 +disk=-1 +while [ $disk -lt 0 ] || [ $disk -gt $(wc -l $unmounted_disks | awk '{print $1}') ];do + + [ "$1" = "-v" ] && for i in $(cat $unmounted_disks);do + sudo fdisk -l "/dev/$i" + done + + for i in $(cat $unmounted_disks);do + printf "%4s) %s\n" "$u" "$i" + u=$(( u + 1 )) + done + + printf "%4s) Exit\n" "0" + printf "Input number: " + read -r disk + + [ $disk -lt 0 ] || [ $disk -gt $(wc -l $unmounted_disks | awk '{print $1}') ] && printf "Wrong number. Please retry\n" + [ $disk -eq 0 ] && exit 0 +done + +mnt_disk="/dev/$(awk -v n=$disk 'NR==n' $unmounted_disks)" + +if ! [ "$1" = "-v" ] && [ -n "$1" ];then sudo mount "$mnt_disk" "$1" && exit 0;fi +[ -n "$2" ] && sudo mount "$mnt_disk" "$1" && exit 0 +if mount | grep -q ~/mnt ;then dien "Something is mounted at ~/mnt";else udisksctl mount -b "$mnt_disk";fi + +[ -e $HOME/.cache/aumo/mnt_disk ] || mkdir -p $HOME/.cache/aumo +echo $mnt_disk >> $HOME/.cache/aumo/mnt_disk +rm $all_available_disks +rm $mounted_disk +rm $unmounted_disks +[ -d /tmp/LIB_FILE_TEMP_DIR/ ] && rm -r /tmp/LIB_FILE_TEMP_DIR/ diff --git a/hm/soispha/pkgs/scripts/apps/con2pdf b/hm/soispha/pkgs/scripts/apps/con2pdf new file mode 100755 index 00000000..9cadc376 --- /dev/null +++ b/hm/soispha/pkgs/scripts/apps/con2pdf @@ -0,0 +1,152 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + + +# needed for help() and version +# shellcheck disable=2034 +AUTHORS="Soispha"; +# shellcheck disable=2034 +YEARS="2023"; +# shellcheck disable=2034 +VERSION="1.0.0"; + +help() { +cat << EOF +Scan images and turn them into a pdf. + +Usage: + $NAME [--help|--version|--out-dir|--num-pages|--method] --name --device + +Options: + --out-dir | -o + Path to place the generated pdf files (default: ./pdf). + --name | -n + Name for the pdf files (e.g. "\$name"_1.pdf). + --num-pages | -p + Number of pages to merge into one pdf (default: 1). + --device | -d + Device used for scanning. + --method | -m + Method to use for scanning (default: ADF). + --help | -h + Display this help and exit. + --version | -v + Display version and copyright information and exit. +EOF +} + +scan() { + number_of_pages="$1"; + device="$2"; + output_directory="$3"; + name="$4"; + method="$5"; + + [ -z "$number_of_pages" ] && die "Parameter 'number_of_pages' is not set!" + [ -z "$device" ] && die "Parameter 'device' is not set!" + [ -z "$output_directory" ] && die "Parameter 'output_directory' is not set!" + [ -z "$name" ] && die "Parameter 'name' is not set!" + [ -z "$method" ] && die "Parameter 'method' is not set!" + + tiff_temp_path="$(mktmp -d)"; + cd "$tiff_temp_path" || die "Bug" + + msg "Started scanning..."; + if [ "$method" = "Flatbed" ]; then + do_until_success \ + "scanimage --format=tiff --progress --source='$method' --device='$device' --output-file=1.tiff" \ + "warn 'Retrying scan, as we assume a network error!'" + else + for i in $(seq "$number_of_pages");do + do_until_success \ + "scanimage --format=tiff --progress --source='$method' --device='$device' --batch=%d.tif --batch-increment='$number_of_pages' --batch-start='$i'" \ + "warn 'Retrying scan, as we assume a network error!'" + + + if [ "$number_of_pages" -ne 1 ];then + msg "Finished turn, please change side!"; + readp "Press enter to continue" noop + fi + done + fi + + msg "Creating output directory..."; + mkdir "$output_directory"; + cd "$output_directory" || die "Bug" + + counter=0; + msg "Converting images to pdfs..."; + while read -r scanned_image_a;do + if [ "$number_of_pages" -ne 1 ];then + scanned_image_b_set=false; + if [ -z "$scanned_image_b" ];then + scanned_image_b="$i" + scanned_image_b_set=true; + : $((counter += 1)) + fi + + if [ -n "$scanned_image_a" ] && [ "$scanned_image_b_set" = false ];then + convert "$scanned_image_b" "$scanned_image_a" -compress jpeg -quality 100 "$name"_"$counter".pdf + fi + else + : $((counter += 1)) + convert "$scanned_image_a" -compress jpeg -quality 100 "$name"_"$counter".pdf + fi + + done < "$(tmp "fd . '$tiff_temp_path' | sort -n")" +} + +for input in "$@"; do + case "$input" in + "--help" | "-h") + help; + exit 0; + ;; + "--version" | "-v") + version; + exit 0; + ;; + esac +done + +number_of_pages="1"; +unset device; +output_directory="$(pwd)/pdf"; +unset name; +method="ADF"; + +while [ "$#" -ne 0 ]; do + case "$1" in + "--help" | "-h") + ;; + "--version" | "-v") + ;; + "--out-dir" | "-o") + shift 1; + output_directory="$1"; + ;; + "--name" | "-n") + shift 1; + name="$1"; + ;; + "--num-pages" | "-p") + shift 1; + number_of_pages="$1"; + ;; + "--device" | "-d") + shift 1; + device="$1"; + ;; + "--method" | "-m") + shift 1; + method="$1"; + ;; + *) + die "Command line arg $1 does not exist. See --help for a list."; + ;; + esac + shift 1; +done +scan "$number_of_pages" "$device" "$output_directory" "$name" "$method"; diff --git a/hm/soispha/pkgs/scripts/small_functions/dldragon b/hm/soispha/pkgs/scripts/small_functions/dldragon new file mode 100755 index 00000000..ea75c362 --- /dev/null +++ b/hm/soispha/pkgs/scripts/small_functions/dldragon @@ -0,0 +1,28 @@ +#! /usr/bin/env dash +# Provides the ability to download a file by dropping it into a window + +url=$(dragon -t -x) + +if [ -n "$url" ]; then + printf "File Name: " + name="" + while [ -z $name ] || [ -e $name ] + do + read -r name + if [ -e "$name" ]; then + printf "File already exists, overwrite (y|n): " + read -r ans + + if [ "$ans" = "y" ]; then + break + else + printf "File Name: " + fi + fi + done + + # Download the file with curl + [ -n "$name" ] && curl -o "$name" "$url" || exit 1 +else + exit 1 +fi diff --git a/hm/soispha/pkgs/scripts/small_functions/gtk-themes b/hm/soispha/pkgs/scripts/small_functions/gtk-themes new file mode 100755 index 00000000..457bc35a --- /dev/null +++ b/hm/soispha/pkgs/scripts/small_functions/gtk-themes @@ -0,0 +1,21 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + + +# TODO: document, what this does + +# usage: import-gsettings +config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" +if [ ! -f "$config" ]; then exit 1; fi + +gnome_schema="org.gnome.desktop.interface" +gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')" +icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')" +cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')" +font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')" +gsettings set "$gnome_schema" gtk-theme "$gtk_theme" +gsettings set "$gnome_schema" icon-theme "$icon_theme" +gsettings set "$gnome_schema" cursor-theme "$cursor_theme" +gsettings set "$gnome_schema" font-name "$font_name" diff --git a/hm/soispha/pkgs/scripts/small_functions/mocs b/hm/soispha/pkgs/scripts/small_functions/mocs new file mode 100755 index 00000000..e14a84c8 --- /dev/null +++ b/hm/soispha/pkgs/scripts/small_functions/mocs @@ -0,0 +1,15 @@ +#! /bin/bash +if [[ "$(pgrep mocp)" -eq 0 ]]; +then + mocp -M "${XDG_CONFIG_HOME}"/moc -S + if [[ $1 -eq 0 ]]; + then + mocp -M "${XDG_CONFIG_HOME}"/moc -v 12 + else + mocp -M "${XDG_CONFIG_HOME}"/moc -v "$1" + fi + mocp -M "${XDG_CONFIG_HOME}"/moc -p + mymocp& +else + mocp -M "${XDG_CONFIG_HOME}"/moc -G +fi diff --git a/hm/soispha/pkgs/scripts/small_functions/screen_shot b/hm/soispha/pkgs/scripts/small_functions/screen_shot new file mode 100755 index 00000000..73eb2ee4 --- /dev/null +++ b/hm/soispha/pkgs/scripts/small_functions/screen_shot @@ -0,0 +1,10 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +date="$(date +%s)" +grim -g "$(slurp)" "$HOME/media/pictures/screenshots/$date.png" && + alacritty -e ll -command ":{{ set sortby atime; set reverse!; }}" "$HOME/media/pictures/screenshots/$date.png" + +# vim: ft=sh diff --git a/hm/soispha/pkgs/scripts/small_functions/update-sys b/hm/soispha/pkgs/scripts/small_functions/update-sys new file mode 100755 index 00000000..355682d1 --- /dev/null +++ b/hm/soispha/pkgs/scripts/small_functions/update-sys @@ -0,0 +1,78 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +help() { + cat << EOF +This is a NixOS System flake update manager. + +Usage: + $NAME [--branch ] [--help] + +Options: + --branch | -b BRANCHNAME + select a branch to update from. + --mode | -m MODE + select a mode to update with + --help | -h + output this help. +EOF + exit "$1"; +} +default_branch=$(mktmp); +BRANCH=""; + +while [ "$#" -gt 0 ];do + case "$1" in + "--help" | "-h") + help 0; + ;; + "--branch" | "-b") + if [ -n "$2" ];then + BRANCH="$2"; + else + error "$1 requires an argument"; + help 1; + fi + shift 2; + ;; + "--mode" | "-m") + if [ -n "$2" ];then + MODE="$2"; + else + error "$1 requires an argument"; + help 1; + fi + shift 2; + ;; + *) + error "the option $1 does not exist!"; + help 1; + ;; + esac +done + + +cd /etc/nixos || die "No /etc/nixos"; +msg "Starting system update..."; +git remote update origin --prune > /dev/null 2>&1; +if ! [ "$BRANCH" = "" ];then + git switch "$BRANCH" > /dev/null 2>&1 && msg2 "Switched to branch '$BRANCH'"; +fi +msg2 "Updating git repository..."; +git pull --rebase; + +git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > "$default_branch" & + +msg2 "Updating system..."; +if [ -n "$MODE" ]; then + nixos-rebuild "$MODE"; +else + nixos-rebuild switch; +fi + +git switch "$(cat "$default_branch")" > /dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'"; +msg "Finished Update!"; + +# vim: ft=sh diff --git a/hm/soispha/pkgs/scripts/wrappers/backsnap b/hm/soispha/pkgs/scripts/wrappers/backsnap new file mode 100755 index 00000000..cd08045d --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/backsnap @@ -0,0 +1,3 @@ +#! /usr/bin/env dash +snap-sync --noconfirm -u d1c6e0f6-1837-40fd-bb29-251d5ea0ddb0 +umount /run/dt/d1c6e0f6-1837-40fd-bb29-251d5ea0ddb0 diff --git a/hm/soispha/pkgs/scripts/wrappers/ll b/hm/soispha/pkgs/scripts/wrappers/ll new file mode 100755 index 00000000..cb1fc0ea --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/ll @@ -0,0 +1,14 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +last_directory="$(mktemp)" + +command lf -last-dir-path="$last_directory" "$@" + +dir="$(cat "$last_directory")" +cd "$dir" || die "$dir does not exist!" +rm "$last_directory" + +# vim: ft=sh diff --git a/hm/soispha/pkgs/scripts/wrappers/llp b/hm/soispha/pkgs/scripts/wrappers/llp new file mode 100755 index 00000000..2a21450c --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/llp @@ -0,0 +1,19 @@ +#! /bin/bash + +export LLP=1 +cleanup() { + exec 3>&- + rm "$FIFO_UEBERZUG" +} + +if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then + lf "$@" +else + [ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf" + export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$" + mkfifo "$FIFO_UEBERZUG" + ueberzug layer -s <"$FIFO_UEBERZUG" -p json & + exec 3>"$FIFO_UEBERZUG" + trap cleanup EXIT + lf "$@" 3>&- +fi diff --git a/hm/soispha/pkgs/scripts/wrappers/spodi b/hm/soispha/pkgs/scripts/wrappers/spodi new file mode 100755 index 00000000..4ff53bff --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/spodi @@ -0,0 +1,45 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +DOWN_DIR="/home/soispha/media/music/down"; + +download_url="$1"; + + + +already_downloaded_files="$(mktmp)" +fd . "$DOWN_DIR" --exclude spotdl.log > "$already_downloaded_files"; + +config="$(mktmp)" +cat << EO > "$config" +--log-level INFO +--cache-path /home/soispha/.local/share/spotdl/.spotipy +--audio youtube-music youtube +--lyrics genius musixmatch azlyrics +--ffmpeg ffmpeg +--format mp3 +--output {artists}_-_{title} +--overwrite skip +--client-id 5f573c9620494bae87890c0f08a60293 +--client-secret 212476d9b0f3472eaa762d90b19b0ba8 +--threads 16 +--print-errors +--preload +EO + +if [ -z "$NO_CHECK" ] && [ "$(wc -l < "$already_downloaded_files" )" -ne 0 ];then + die "something is already downloaded" +fi + +rm "$DOWN_DIR/spotdl.log" +cd "$DOWN_DIR" || die "BUG: no $DOWN_DIR" + + +# The sub shell needs to be unquoted, as the arguments may not be treated as one. +# shellcheck disable=2046 +unbuffer spotdl $(cat "$config") download "$download_url" | tee "$DOWN_DIR/spotdl.log" + +[ -d ~/.spotdl ] && rm -r ~/.spotdl +# vim: ft=sh diff --git a/hm/soispha/pkgs/scripts/wrappers/virsh-del b/hm/soispha/pkgs/scripts/wrappers/virsh-del new file mode 100755 index 00000000..afcd87c1 --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/virsh-del @@ -0,0 +1,10 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +virsh destroy "$1" +virsh undefine "$1" --nvram +virsh vol-delete --pool default "$1".qcow2 + +# vim: ft=sh diff --git a/hm/soispha/pkgs/scripts/wrappers/yti b/hm/soispha/pkgs/scripts/wrappers/yti new file mode 100755 index 00000000..0b737b30 --- /dev/null +++ b/hm/soispha/pkgs/scripts/wrappers/yti @@ -0,0 +1,36 @@ +#! /usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +die "Use spodi instead!" # TODO: fix this script +DOWN_DIR=/home/soispha/media/playlist/down/ + + +tmp=$(mktmp) +config=$(mktmp) + +for e in "$DOWN_DIR"/*.mp3;do echo "$e" >> "$tmp";done +[ "$(wc -l "$tmp" | awk '{print $1}')" -gt 2 ] && die "something is already downloaded" + +cat << EO > "$config" +--paths home:"$DOWN_DIR" +#--output %(fulltitle) +--restrict-filenames +--no-overwrites +--no-write-info-json +--clean-info-json +--prefer-free-formats +#--format mp3 +--extract-audio +--audio-quality 0 +--audio-format best +EO + + +rm ${DOWN_DIR}yt-dlp.log +cd $DOWN_DIR || die "BUG: no $DOWN_DIR" + +unbuffer yt-dlp --config-location "$config" "$1" | tee $DOWN_DIR/yt-dlp.log + +# vim: ft=sh diff --git a/hm/soispha/wms/default.nix b/hm/soispha/wms/default.nix new file mode 100644 index 00000000..610ea2f4 --- /dev/null +++ b/hm/soispha/wms/default.nix @@ -0,0 +1,7 @@ +{config, ...}: { + imports = [ + # ./sway + ./river + # ./plasma + ]; +} diff --git a/hm/soispha/wms/plasma/default.nix b/hm/soispha/wms/plasma/default.nix new file mode 100644 index 00000000..f68ee272 --- /dev/null +++ b/hm/soispha/wms/plasma/default.nix @@ -0,0 +1,5 @@ +{config, ...}: { + services.xserver.enable = true; + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; +} diff --git a/hm/soispha/wms/river/default.nix b/hm/soispha/wms/river/default.nix new file mode 100644 index 00000000..d8bc4009 --- /dev/null +++ b/hm/soispha/wms/river/default.nix @@ -0,0 +1,68 @@ +{ + pkgs, + sysLib, + river_init_lesser, + nixosConfig, + system, + ... +}: let + inherit (nixosConfig.networking) hostName; + mappings = + if hostName == "tiamat" + then '' + err_fail riverctl keyboard-layout 'us' + err_fail river_init_lesser ~/.config/river/res/moonlander.ron + '' + else if hostName == "lahmu" || hostName == "apzu" || hostName == "mammun" || hostName == "isimud" + then '' + err_fail riverctl keyboard-layout 'us(dvorak)' + err_fail river_init_lesser ~/.config/river/res/keys.ron + '' + else builtins.throw "Host not covered in river mappings"; + screen_setup = + if hostName == "lahmu" + then '' + err_fail wlr-randr --output Virtual-1 --mode 1920x1080 + '' + else if hostName == "tiamat" + then '' + err_fail wlr-randr --output DP-2 --pos 2560,0 + err_fail wlr-randr --output DP-1 --scale 1.5 --pos 0,0 + err_fail gammastep & + '' + else if hostName == "apzu" || hostName == "mammun" || hostName == "isimud" + then '' + err_fail gammastep & + '' + else builtins.throw "Host not covered in river screen setup"; + init_scr = pkgs.substituteAll { + src = ./init; + inherit mappings screen_setup; + }; +in { + xdg.configFile."river/init".source = + sysLib.writeShellScriptWithLibraryAndKeepPath { + name = "river_init"; + src = init_scr; + dependencies = builtins.attrValues { + river_init_lesser = river_init_lesser.packages.${system}.default; + inherit + (pkgs) + dash + river + glib # gnome lib + gammastep + wlr-randr + yambar + mako + swaybg + swayidle + swaylock + alacritty + ; + }; + } + + /bin/river_init; + + xdg.configFile."river/res".source = ./res; +} diff --git a/hm/soispha/wms/river/init b/hm/soispha/wms/river/init new file mode 100755 index 00000000..599992e6 --- /dev/null +++ b/hm/soispha/wms/river/init @@ -0,0 +1,80 @@ +#!/usr/bin/env dash + +# shellcheck source=/dev/null +SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH + +err_fail() { + if ! "$@";then + warning "\"$*\" failed!\n" >> ~/river_log + # msg "Executing the safe init!" + # exec ~/.config/river/res/safe_init + fi +} +err_fail rm ~/river_log +exec 1>> "$HOME"/river_log +exec 2>> "$HOME"/river_log + +#trap err_fail ERR + +#Setup of environment variables {{{ +err_fail riverctl spawn "exec dbus-update-activation-environment SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" +err_fail export XDG_CURRENT_DESKTOP=river +#}}} + +# Setup of mappings {{{ +@mappings@ +# }}} + +# Setup of Rules {{{ +err_fail riverctl float-filter-add app-id float +err_fail riverctl float-filter-add app-id mpv +err_fail riverctl float-filter-add app-id ModernGL +err_fail riverctl float-filter-add title "Manim Slides" + +err_fail riverctl csd-filter-add app-id firefox +# }}} + +# Set riverctl settings {{{ +# background +err_fail riverctl background-color 0x002b36 +err_fail riverctl border-color-focused 0x93a1a1 +err_fail riverctl border-color-unfocused 0x586e75 + +# keyboard repeat rate +err_fail riverctl set-repeat 50 300 + +# Cursor +err_fail riverctl focus-follows-cursor normal +#riverctl hide-cursor timeout 2000 +err_fail riverctl hide-cursor when-typing enabled +err_fail riverctl set-cursor-warp on-output-change +err_fail riverctl xcursor-theme Nordzy-cursors 24 + +err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 pointer-accel 0 +err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 accel-profile none + +err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I pointer-accel 0 +err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I accel-profile none +# }}} + +# Setup of general apps {{{ +@screen_setup@ + +err_fail yambar & + +err_fail mako & +err_fail swaybg -i "$WALLPAPER" & +err_fail swayidle & +err_fail alacritty & +# }}} + + + +# Setup of layout [acts as exec!] {{{ +err_fail riverctl default-layout rivertile +err_fail rivertile -main-ratio 0.5 -view-padding 1 -outer-padding 0 + +#riverctl default-layout luatile +#river-luatile +# }}} +# vim: ft=sh diff --git a/hm/soispha/wms/river/res/keys.ron b/hm/soispha/wms/river/res/keys.ron new file mode 100644 index 00000000..a4ad6988 --- /dev/null +++ b/hm/soispha/wms/river/res/keys.ron @@ -0,0 +1,57 @@ +#![enable(implicit_some)] +RiverctlCommandArray( + commands: [ + // Focus change + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super", command: "focus-view", command_args: "next",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super", command: "focus-view", command_args: "previous",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Control", command: "focus-output", command_args: "next",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Control", command: "focus-output", command_args: "previous",), + + // Standard program + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super", command: "spawn", command_args: "alacritty",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "q", mods: "Super+Shift", command: "exit", command_args: None,), + + // Screenshot + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Print", mods: "None", command: "spawn", command_args: "~/repos/shell/scripts/screen_shot",), + + // Audio + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "XF86AudioRaiseVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 +5%",), + RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioLowerVolume", mods: "None", command: "spawn", command_args: "~/.local/bin/ytcs",), + RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioMute", mods: "None", command: "spawn", command_args: "~/repos/shell/scripts/mocs",), + + // Launcher + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Super", command: "spawn", command_args: "bemenu-run",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F1", mods: "Super", command: "spawn", command_args: "firefox",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F2", mods: "Super", command: "spawn", command_args: "keepassxc",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F3", mods: "Super", command: "spawn", command_args: "nheko",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F4", mods: "Super", command: "spawn", command_args: "steam",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "swaylock -f",), + + // Client + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "f", mods: "Super", command: "toggle-fullscreen", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "c", mods: "Super+Shift", command: "close", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "space", mods: "Super+Control", command: "toggle-float", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super+Control", command: "zoom", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "o", mods: "Super", command: "send-to-output", command_args: "next",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Shift", command: "swap", command_args: "next",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Shift", command: "swap", command_args: "previous",), + + // Toggle all tags + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super", command: "set-focused-tags", command_args: "4294967295"), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super+Shift", command: "set-view-tags", command_args: "4294967295"), + + // Mouse + RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), + RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), + + ], + // Set these mappings for the tags 0-8 with key [1-9] + tags_number: 9, + tag_commands: [ + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super", command: "set-focused-tags",), + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift", command: "set-view-tags",), + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), + ], +) + diff --git a/hm/soispha/wms/river/res/moonlander.ron b/hm/soispha/wms/river/res/moonlander.ron new file mode 100644 index 00000000..7a0c7298 --- /dev/null +++ b/hm/soispha/wms/river/res/moonlander.ron @@ -0,0 +1,64 @@ +#![enable(implicit_some)] +RiverctlCommandArray( + // TODO: add toggle-focus mapping + commands: [ + // Movement + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "A", mods: "Alt+Control+Super+Shift", command: "exit", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "B", mods: "Alt+Control+Super+Shift", command: "close", command_args: None,), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "C", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "previous",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "D", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "next",), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "E", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "previous",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "next",), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "G", mods: "Alt+Control+Super+Shift", command: "zoom", command_args: None,), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "H", mods: "Alt+Control+Super+Shift", command: "toggle-fullscreen", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "I", mods: "Alt+Control+Super+Shift", command: "toggle-float", command_args: None,), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "J", mods: "Alt+Control+Super+Shift", command: "send-to-output", command_args: "next",), + + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "K", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "alacritty",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "screen_shot",), + + // Audio + RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "M", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "stop_playing_sound",), + RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "N", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "mpc toggle",), + + // Launcher + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "O", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "P", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "firefox",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Q", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "keepassxc",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "nheko",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "S", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "signal-desktop",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "swaylock -f",), + + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "U", mods: "Alt+Control+Super+Shift", command: "focus-output", command_args: "next",), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "V", mods: "Alt+Control+Super+Shift", command: "focus-previous-tags", command_args: None,), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "W", mods: "Alt+Control+Super+Shift", command: "send-to-previous-tags",command_args: None,), + //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "X", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), + //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Y", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), + //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Z", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), + + + // Toggle all tags + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Super+Shift", command: "set-focused-tags", command_args: "4294967295"), + RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Shift", command: "set-view-tags", command_args: "4294967295"), + + // Mouse + RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), + RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), + ], + + // Set these mappings for the tags 0-8 with key [1-9] + tags_number: 9, + tag_commands: [ + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Super+Shift", command: "set-focused-tags",), + RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Shift", command: "set-view-tags",), + // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), + // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), + ], +) + diff --git a/hm/soispha/wms/river/res/safe_init b/hm/soispha/wms/river/res/safe_init new file mode 100755 index 00000000..8e80026a --- /dev/null +++ b/hm/soispha/wms/river/res/safe_init @@ -0,0 +1,160 @@ +#!/bin/sh + +# This is the example configuration file for river. +# +# If you wish to edit this, you will probably want to copy it to +# $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first. +# +# See the river(1), riverctl(1), and rivertile(1) man pages for complete +# documentation. + +# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc. + +# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) +riverctl map normal Super Return spawn alacritty + +# Super+Q to close the focused view +riverctl map normal Super Q close + +# Super+Shift+E to exit river +riverctl map normal Super+Shift Q exit + +# Super+J and Super+K to focus the next/previous view in the layout stack +riverctl map normal Super J focus-view next +riverctl map normal Super K focus-view previous + +# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous +# view in the layout stack +riverctl map normal Super+Shift J swap next +riverctl map normal Super+Shift K swap previous + +# Super+Period and Super+Comma to focus the next/previous output +riverctl map normal Super Period focus-output next +riverctl map normal Super Comma focus-output previous + +# Super+Shift+{Period,Comma} to send the focused view to the next/previous output +riverctl map normal Super+Shift Period send-to-output next +riverctl map normal Super+Shift Comma send-to-output previous + +# Super+Return to bump the focused view to the top of the layout stack +riverctl map normal Super Return zoom + +# Super+H and Super+L to decrease/increase the main ratio of rivertile(1) +riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" +riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" + +# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) +riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" +riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" + +# Super+Alt+{H,J,K,L} to move views +riverctl map normal Super+Alt H move left 100 +riverctl map normal Super+Alt J move down 100 +riverctl map normal Super+Alt K move up 100 +riverctl map normal Super+Alt L move right 100 + +# Super+Alt+Control+{H,J,K,L} to snap views to screen edges +riverctl map normal Super+Alt+Control H snap left +riverctl map normal Super+Alt+Control J snap down +riverctl map normal Super+Alt+Control K snap up +riverctl map normal Super+Alt+Control L snap right + +# Super+Alt+Shift+{H,J,K,L} to resize views +riverctl map normal Super+Alt+Shift H resize horizontal -100 +riverctl map normal Super+Alt+Shift J resize vertical 100 +riverctl map normal Super+Alt+Shift K resize vertical -100 +riverctl map normal Super+Alt+Shift L resize horizontal 100 + +# Super + Left Mouse Button to move views +riverctl map-pointer normal Super BTN_LEFT move-view + +# Super + Right Mouse Button to resize views +riverctl map-pointer normal Super BTN_RIGHT resize-view + +for i in $(seq 1 9) +do + tags=$((1 << ($i - 1))) + + # Super+[1-9] to focus tag [0-8] + riverctl map normal Super $i set-focused-tags $tags + + # Super+Shift+[1-9] to tag focused view with tag [0-8] + riverctl map normal Super+Shift $i set-view-tags $tags + + # Super+Ctrl+[1-9] to toggle focus of tag [0-8] + riverctl map normal Super+Control $i toggle-focused-tags $tags + + # Super+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view + riverctl map normal Super+Shift+Control $i toggle-view-tags $tags +done + +# Super+0 to focus all tags +# Super+Shift+0 to tag focused view with all tags +all_tags=$(((1 << 32) - 1)) +riverctl map normal Super 0 set-focused-tags $all_tags +riverctl map normal Super+Shift 0 set-view-tags $all_tags + +# Super+Space to toggle float +riverctl map normal Super Space toggle-float + +# Super+F to toggle fullscreen +riverctl map normal Super F toggle-fullscreen + +# Super+{Up,Right,Down,Left} to change layout orientation +riverctl map normal Super Up send-layout-cmd rivertile "main-location top" +riverctl map normal Super Right send-layout-cmd rivertile "main-location right" +riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" +riverctl map normal Super Left send-layout-cmd rivertile "main-location left" + +# Declare a passthrough mode. This mode has only a single mapping to return to +# normal mode. This makes it useful for testing a nested wayland compositor +riverctl declare-mode passthrough + +# Super+F11 to enter passthrough mode +riverctl map normal Super F11 enter-mode passthrough + +# Super+F11 to return to normal mode +riverctl map passthrough Super F11 enter-mode normal + +# Various media key mapping examples for both normal and locked mode which do +# not have a modifier +for mode in normal locked +do + # Eject the optical drive (well if you still have one that is) + riverctl map $mode None XF86Eject spawn 'eject -T' + + # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) + riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5' + riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5' + riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute' + + # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) + riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' + riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' + riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' + riverctl map $mode None XF86AudioNext spawn 'playerctl next' + + # Control screen backlight brightness with light (https://github.com/haikarainen/light) + riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5' + riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5' +done + +# Set background and border color +riverctl background-color 0x002b36 +riverctl border-color-focused 0x93a1a1 +riverctl border-color-unfocused 0x586e75 + +# Set keyboard repeat rate +riverctl set-repeat 50 300 + +# Make certain views start floating +riverctl float-filter-add app-id float +riverctl float-filter-add title "popup title with spaces" + +# Set app-ids and titles of views which should use client side decorations +riverctl csd-filter-add app-id "gedit" + +# Set the default layout generator to be rivertile and start it. +# River will send the process group of the init executable SIGTERM on exit. +riverctl default-layout rivertile +rivertile -view-padding 6 -outer-padding 6 diff --git a/hm/soispha/wms/sway/default.nix b/hm/soispha/wms/sway/default.nix new file mode 100644 index 00000000..bb3ddb49 --- /dev/null +++ b/hm/soispha/wms/sway/default.nix @@ -0,0 +1,16 @@ +# also requires: +# security.polkit.enable = true; +{lib, ...}: { + wayland.windowManager.sway = { + enable = true; + config = { + modifier = "Mod4"; + # Use kitty as default terminal + terminal = "kitty"; + startup = [ + # Launch Firefox on start + {command = "firefox";} + ]; + }; + }; +} diff --git a/home-manager/default.nix b/home-manager/default.nix deleted file mode 100644 index 015cdeb2..00000000 --- a/home-manager/default.nix +++ /dev/null @@ -1,60 +0,0 @@ -{ - pkgs, - sysLib, - # extra information - system, - # bins - video_pause, - yambar_cpu, - yambar_memory, - lf_rename, - strip_js_comments, - river_init_lesser, - grades, - shell_library, - flake_update, - # external deps - user_js, - neovim_config, - snap-sync, - # modules - impermanence, - nixNeovim, - nixVim, -}: { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - users.soispha = import ./soispha; - extraSpecialArgs = { - inherit - pkgs - sysLib - # extra information - - system - # bins - - video_pause - yambar_cpu - yambar_memory - lf_rename - strip_js_comments - river_init_lesser - grades - shell_library - flake_update - # external deps - - user_js - neovim_config - snap-sync - # modules - - impermanence - nixNeovim - nixVim - ; - }; - }; -} diff --git a/home-manager/soispha/config/alacritty/alacritty.yml b/home-manager/soispha/config/alacritty/alacritty.yml deleted file mode 100644 index fdccac3f..00000000 --- a/home-manager/soispha/config/alacritty/alacritty.yml +++ /dev/null @@ -1,1003 +0,0 @@ ---- -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Import additional configuration files -# -# Imports are loaded in order, skipping all missing files, with the importing -# file being loaded last. If a field is already present in a previous import, it -# will be replaced. -# -# All imports must either be absolute paths starting with `/`, or paths relative -# to the user's home directory starting with `~/`. -#import: -# - /path/to/alacritty.yml - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. -env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. - TERM: alacritty - -window: - # Window dimensions (changes require restart) - # - # Number of lines/columns (not pixels) in the terminal. Both lines and columns - # must be non-zero for this to take effect. The number of columns must be at - # least `2`, while using a value of `0` for columns and lines will fall back - # to the window manager's recommended size - dimensions: - columns: 0 - lines: 0 - - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. - #position: - # x: 0 - # y: 0 - - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. - padding: - x: 5 - y: 5 - - # Spread additional padding evenly around the terminal content. - #dynamic_padding: false - - # Window decorations - # - # Values for `decorations`: - # - full: Borders and title bar - # - none: Neither borders nor title bar - # - # Values for `decorations` (macOS only): - # - transparent: Title bar, transparent background and title bar buttons - # - buttonless: Title bar, transparent background and no title bar buttons - decorations: none - - # Background opacity - # - # Window opacity as a floating point number from `0.0` to `1.0`. - # The value `0.0` is completely transparent and `1.0` is opaque. - opacity: 0.9 - - # Startup Mode (changes require restart) - # - # Values for `startup_mode`: - # - Windowed - # - Maximized - # - Fullscreen - # - # Values for `startup_mode` (macOS only): - # - SimpleFullscreen - startup_mode: Windowed - - # Window title - title: Alacritty - - # Allow terminal applications to change Alacritty's window title. - dynamic_title: true - - # Window class (Linux/BSD only): - class: - # Application instance name - instance: Alacritty - # General application class - general: Alacritty - - # Decorations theme variant - # - # Override the variant of the System theme/GTK theme/Wayland client side - # decorations. Commonly supported values are `Dark`, `Light`, and `None` for - # auto pick-up. Set this to `None` to use the default theme variant. - decorations_theme_variant: None - - # Resize increments - # - # Prefer resizing window by discrete steps equal to cell dimensions. - #resize_increments: false - - # Make `Option` key behave as `Alt` (macOS only): - # - OnlyLeft - # - OnlyRight - # - Both - # - None (default) - #option_as_alt: None - -scrolling: - # Maximum number of lines in the scrollback buffer. - # Specifying '0' will disable scrolling. - history: 10000 - - # Scrolling distance multiplier. - multiplier: 3 - -# Font configuration -font: - # Normal (roman) font face - normal: - # Font family - # - # Default: - # - (macOS) Menlo - # - (Linux/BSD) monospace - # - (Windows) Consolas - # family: Source Code Pro - #family: SauceCodePro Nerd Font # This is needed because of reserved font names - family: SauceCodePro Nerd Font Mono - - # The `style` can be specified to pick a specific face. - style: Regular - - # Bold font face - #bold: - # Font family - # - # If the bold family is not specified, it will fall back to the - # value specified for the normal font. - #family: Source Code Pro - - # The `style` can be specified to pick a specific face. - #style: Bold - - # Italic font face - #italic: - # Font family - # - # If the italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: Source Code Pro - - # The `style` can be specified to pick a specific face. - #style: Italic - - # Bold italic font face - #bold_italic: - # Font family - # - # If the bold italic family is not specified, it will fall back to the - # value specified for the normal font. - #family: Source Code Pro - - # The `style` can be specified to pick a specific face. - #style: Bold Italic - - # Point size - size: 12.0 - - # Offset is the extra space around each character. `offset.y` can be thought - # of as modifying the line spacing, and `offset.x` as modifying the letter - # spacing. - offset: - x: -1 - y: -1 - - # Glyph offset determines the locations of the glyphs within their cells with - # the default being at the bottom. Increasing `x` moves the glyph to the - # right, increasing `y` moves the glyph upward. - glyph_offset: - x: -1 - y: -1 - - # Use built-in font for box drawing characters. - # - # If `true`, Alacritty will use a custom built-in font for box drawing - # characters (Unicode points 2500 - 259f). - # - builtin_box_drawing: true # TODO: - -# If `true`, bold text is drawn using the bright color variants. -#draw_bold_text_with_bright_colors: true # TODO: - -# Colors (Tomorrow Night) -colors: - # Default colors - primary: - background: '#191919' - foreground: '#d8dee9' - - # Bright and dim foreground colors - # - # The dimmed foreground color is calculated automatically if it is not - # present. If the bright foreground color is not set, or - # `draw_bold_text_with_bright_colors` is `false`, the normal foreground - # color will be used. - #dim_foreground: '#828482' - #bright_foreground: '#eaeaea' - - # Cursor colors - # - # Colors which should be used to draw the terminal cursor. - # - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - cursor: - text: '#191919' - cursor: '#d8dee9' - - # Vi mode cursor colors - # - # Colors for the cursor when the vi mode is active. - # - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - vi_mode_cursor: - text: CellBackground - cursor: CellForeground - - # Search colors - # - # Colors used for the search bar and match highlighting. - search: - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - matches: - foreground: '#000000' - background: '#ffffff' - focused_match: - foreground: '#ffffff' - background: '#000000' - - # Keyboard hints - hints: - # First character in the hint label - # - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - start: - foreground: '#1d1f21' - background: '#e9ff5e' - - # All characters after the first one in the hint label - # - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - end: - foreground: '#e9ff5e' - background: '#1d1f21' - - # Line indicator - # - # Color used for the indicator displaying the position in history during - # search and vi mode. - # - # By default, these will use the opposing primary color. - #line_indicator: - # foreground: None - # background: None - - # Footer bar - # - # Color used for the footer bar on the bottom, used by search regex input, - # hyperlink URI preview, etc. - # - footer_bar: - background: '#c5c8c6' - foreground: '#1d1f21' - - # Selection colors - # - # Colors which should be used to draw the selection area. - # - # Allowed values are CellForeground/CellBackground, which reference the - # affected cell, or hexadecimal colors like #ff00ff. - selection: - text: '#191919' - background: '#d8dee9' - - # Normal colors - normal: - black: '#191919' - red: '#b02626' - green: '#40a62f' - yellow: '#f2e635' - blue: '#314ad0' - magenta: '#b30ad0' - cyan: '#32d0fc' - white: '#acadb1' - - # Bright colors - bright: - black: '#36393d' - red: '#ce2727' - green: '#47c930' - yellow: '#fff138' - blue: '#2e4bea' - magenta: '#cc15ed' - cyan: '#54d9ff' - white: '#dbdbdb' - - # Dim colors - # - # If the dim colors are not set, they will be calculated automatically based - # on the `normal` colors. - dim: - black: '#676f78' - red: '#b55454' - green: '#78a670' - yellow: '#faf380' - blue: '#707fd0' - magenta: '#c583d0' - cyan: '#8adaf1' - white: '#e0e3e7' - # Indexed Colors - # - # The indexed colors include all colors from 16 to 256. - # When these are not set, they're filled with sensible defaults. - # - # Example: - # `- { index: 16, color: '#ff00ff' }` - # - #indexed_colors: [] - - # Transparent cell backgrounds - # - # Whether or not `window.opacity` applies to all cell backgrounds or only to - # the default background. When set to `true` all cells will be transparent - # regardless of their background color. - #transparent_background_colors: false # TODO: - -# Bell -# -# The bell is rung every time the BEL control character is received. -#bell: - # Visual Bell Animation - # - # Animation effect for flashing the screen when the visual bell is rung. - # - # Values for `animation`: - # - Ease - # - EaseOut - # - EaseOutSine - # - EaseOutQuad - # - EaseOutCubic - # - EaseOutQuart - # - EaseOutQuint - # - EaseOutExpo - # - EaseOutCirc - # - Linear - #animation: EaseOutExpo - - # Duration of the visual bell flash in milliseconds. A `duration` of `0` will - # disable the visual bell animation. - duration: 0 - - # Visual bell animation color. - #color: '#ffffff' - - # Bell Command - # - # This program is executed whenever the bell is rung. - # - # When set to `command: None`, no command will be executed. - # - # Example: - # command: - # program: notify-send - # args: ["Hello, World!"] - # - #command: None - -selection: - # This string contains all characters that are used as separators for - # "semantic words" in Alacritty. - semantic_escape_chars: ",│`|:\"' ()[]{}<>\t" - - # When set to `true`, selected text will be copied to the primary clipboard. - save_to_clipboard: false - -cursor: - # Cursor style - style: - # Cursor shape - # - # Values for `shape`: - # - ▇ Block - # - _ Underline - # - | Beam - shape: Beam - - # Cursor blinking state - # - # Values for `blinking`: - # - Never: Prevent the cursor from ever blinking - # - Off: Disable blinking by default - # - On: Enable blinking by default - # - Always: Force the cursor to always blink - blinking: On - - # Vi mode cursor style - # - # If the vi mode cursor style is `None` or not specified, it will fall back to - # the style of the active value of the normal cursor. - # - # See `cursor.style` for available options. - vi_mode_style: None - - # Cursor blinking interval in milliseconds. - blink_interval: 750 - - # Time after which cursor stops blinking, in seconds. - # - # Specifying '0' will disable timeout for blinking. - blink_timeout: 5 - - # If this is `true`, the cursor will be rendered as a hollow box when the - # window is not focused. - unfocused_hollow: true - - # Thickness of the cursor relative to the cell width as floating point number - # from `0.0` to `1.0`. - thickness: 0.15 - -# Live config reload (changes require restart) -live_config_reload: true - -# Shell -# -# You can set `shell.program` to the path of your favorite shell, e.g. -# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the -# shell. -# -# Default: -# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset -# - (Windows) powershell -#shell: -# program: /bin/bash -# args: -# - --login - -# Startup directory -# -# Directory the shell is started in. If this is unset, or `None`, the working -# directory of the parent process will be used. -#working_directory: None - -# Offer IPC using `alacritty msg` (unix only) -ipc_socket: true - -mouse: - # Click settings - # - # The `double_click` and `triple_click` settings control the time - # alacritty should wait for accepting multiple clicks as one double - # or triple click. - double_click: { threshold: 300 } - triple_click: { threshold: 300 } - - # If this is `true`, the cursor is temporarily hidden when typing. - hide_when_typing: false - -# Hints -# -# Terminal hints can be used to find text or hyperlink in the visible part of -# the terminal and pipe it to other applications. -hints: - # Keys used for the hint labels. - alphabet: "jfkdls;ahgurieowpq" - - # List with all available hints - # - # Each hint must have any of `regex` or `hyperlinks` field and either an - # `action` or a `command` field. The fields `mouse`, `binding` and - # `post_processing` are optional. - # - # The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be - # highlighted. - # - # The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and - # `mouse.mods` accept the same values as they do in the `key_bindings` section. - # - # The `mouse.enabled` field controls if the hint should be underlined while - # the mouse with all `mouse.mods` keys held or the vi mode cursor is above it. - # - # If the `post_processing` field is set to `true`, heuristics will be used to - # shorten the match if there are characters likely not to be part of the hint - # (e.g. a trailing `.`). This is most useful for URIs and applies only to - # `regex` matches. - # - # Values for `action`: - # - Copy - # Copy the hint's text to the clipboard. - # - Paste - # Paste the hint's text to the terminal or search. - # - Select - # Select the hint's text. - # - MoveViModeCursor - # Move the vi mode cursor to the beginning of the hint. - enabled: - - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ - [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" - hyperlinks: true - command: xdg-open - post_processing: true - mouse: - enabled: true - mods: None - binding: - key: U - mods: Control|Shift - - - regex: "([^ '\"`=:\\[\\(]*/)([^/: '\"`\\)\\]]*)" - action: Paste - post_procesing: false - binding: - key: T - mods: Control|Shift - - - regex: "([a-z0-9]{7})\\s" - action: Paste - post_procesing: false - binding: - key: H - mods: Control|Shift - - # multi regex for different purposes: - # 2. UUIDs - # 3. hex (for example signatures) - # 4. IP addresses -# - regex: "([[:alnum:]_$%&+=/@-]+)\ -#|([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\ -#|([0-9a-f]{12,128})\ -#|([[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3})" -# action: Copy -# post_processing: false -# binding: -# key: U -# mods: Control|Shift - -# Mouse bindings -# -# Mouse bindings are specified as a list of objects, much like the key -# bindings further below. -# -# To trigger mouse bindings when an application running within Alacritty -# captures the mouse, the `Shift` modifier is automatically added as a -# requirement. -# -# Each mouse binding will specify a: -# -# - `mouse`: -# -# - Middle -# - Left -# - Right -# - Numeric identifier such as `5` -# -# - `action` (see key bindings for actions not exclusive to mouse mode) -# -# - Mouse exclusive actions: -# -# - ExpandSelection -# Expand the selection to the current mouse cursor location. -# -# And optionally: -# -# - `mods` (see key bindings) -mouse_bindings: -# - { mouse: Right, action: ExpandSelection } -# - { mouse: Right, mods: Control, action: ExpandSelection } - - { mouse: Middle, action: Copy } - -# Key bindings -# -# Key bindings are specified as a list of objects. For example, this is the -# default paste binding: -# -# `- { key: V, mods: Control|Shift, action: Paste }` -# -# Each key binding will specify a: -# -# - `key`: Identifier of the key pressed -# -# - A-Z -# - F1-F24 -# - Key0-Key9 -# -# A full list with available key codes can be found here: -# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants -# -# Instead of using the name of the keys, the `key` field also supports using -# the scancode of the desired key. Scancodes have to be specified as a -# decimal number. This command will allow you to display the hex scancodes -# for certain keys: -# -# `showkey --scancodes`. -# -# Then exactly one of: -# -# - `chars`: Send a byte sequence to the running application -# -# The `chars` field writes the specified string to the terminal. This makes -# it possible to pass escape sequences. To find escape codes for bindings -# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside -# of tmux. Note that applications use terminfo to map escape sequences back -# to keys. It is therefore required to update the terminfo when changing an -# escape sequence. -# -# - `action`: Execute a predefined action -# -# - ToggleViMode -# - SearchForward -# Start searching toward the right of the search origin. -# - SearchBackward -# Start searching toward the left of the search origin. -# - Copy -# - Paste -# - IncreaseFontSize -# - DecreaseFontSize -# - ResetFontSize -# - ScrollPageUp -# - ScrollPageDown -# - ScrollHalfPageUp -# - ScrollHalfPageDown -# - ScrollLineUp -# - ScrollLineDown -# - ScrollToTop -# - ScrollToBottom -# - ClearHistory -# Remove the terminal's scrollback history. -# - Hide -# Hide the Alacritty window. -# - Minimize -# Minimize the Alacritty window. -# - Quit -# Quit Alacritty. -# - ToggleFullscreen -# - ToggleMaximized -# - SpawnNewInstance -# Spawn a new instance of Alacritty. -# - CreateNewWindow -# Create a new Alacritty window from the current process. -# - ClearLogNotice -# Clear Alacritty's UI warning and error notice. -# - ClearSelection -# Remove the active selection. -# - ReceiveChar -# - None -# -# - Vi mode exclusive actions: -# -# - Open -# Perform the action of the first matching hint under the vi mode cursor -# with `mouse.enabled` set to `true`. -# - ToggleNormalSelection -# - ToggleLineSelection -# - ToggleBlockSelection -# - ToggleSemanticSelection -# Toggle semantic selection based on `selection.semantic_escape_chars`. -# - CenterAroundViCursor -# Center view around vi mode cursor -# -# - Vi mode exclusive cursor motion actions: -# -# - Up -# One line up. -# - Down -# One line down. -# - Left -# One character left. -# - Right -# One character right. -# - First -# First column, or beginning of the line when already at the first column. -# - Last -# Last column, or beginning of the line when already at the last column. -# - FirstOccupied -# First non-empty cell in this terminal row, or first non-empty cell of -# the line when already at the first cell of the row. -# - High -# Top of the screen. -# - Middle -# Center of the screen. -# - Low -# Bottom of the screen. -# - SemanticLeft -# Start of the previous semantically separated word. -# - SemanticRight -# Start of the next semantically separated word. -# - SemanticLeftEnd -# End of the previous semantically separated word. -# - SemanticRightEnd -# End of the next semantically separated word. -# - WordLeft -# Start of the previous whitespace separated word. -# - WordRight -# Start of the next whitespace separated word. -# - WordLeftEnd -# End of the previous whitespace separated word. -# - WordRightEnd -# End of the next whitespace separated word. -# - Bracket -# Character matching the bracket at the cursor's location. -# - SearchNext -# Beginning of the next match. -# - SearchPrevious -# Beginning of the previous match. -# - SearchStart -# Start of the match to the left of the vi mode cursor. -# - SearchEnd -# End of the match to the right of the vi mode cursor. -# -# - Search mode exclusive actions: -# - SearchFocusNext -# Move the focus to the next search match. -# - SearchFocusPrevious -# Move the focus to the previous search match. -# - SearchConfirm -# - SearchCancel -# - SearchClear -# Reset the search regex. -# - SearchDeleteWord -# Delete the last word in the search regex. -# - SearchHistoryPrevious -# Go to the previous regex in the search history. -# - SearchHistoryNext -# Go to the next regex in the search history. -# -# - macOS exclusive actions: -# - ToggleSimpleFullscreen -# Enter fullscreen without occupying another space. -# -# - Linux/BSD exclusive actions: -# -# - CopySelection -# Copy from the selection buffer. -# - PasteSelection -# Paste from the selection buffer. -# -# - `command`: Fork and execute a specified command plus arguments -# -# The `command` field must be a map containing a `program` string and an -# `args` array of command line parameter strings. For example: -# `{ program: "alacritty", args: ["-e", "vttest"] }` -# -# And optionally: -# -# - `mods`: Key modifiers to filter binding actions -# -# - Command -# - Control -# - Option -# - Super -# - Shift -# - Alt -# -# Multiple `mods` can be combined using `|` like this: -# `mods: Control|Shift`. -# Whitespace and capitalization are relevant and must match the example. -# -# - `mode`: Indicate a binding for only specific terminal reported modes -# -# This is mainly used to send applications the correct escape sequences -# when in different modes. -# -# - AppCursor -# - AppKeypad -# - Search -# - Alt -# - Vi -# -# A `~` operator can be used before a mode to apply the binding whenever -# the mode is *not* active, e.g. `~Alt`. -# -# Bindings are always filled by default, but will be replaced when a new -# binding with the same triggers is defined. To unset a default binding, it can -# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for -# a no-op if you do not wish to receive input characters for that binding. -# -# If the same trigger is assigned to multiple actions, all of them are executed -# in the order they were defined in. -key_bindings: -# -# - - { key: P, mods: Control, action: Paste } - - { key: Insert, mods: Shift, action: Paste } - - { key: Slash, mods: Control, chars: "gc" } - - { key: Y, mods: Control, action: Copy } - - { key: Key0, mods: Control, action: ResetFontSize } - - { key: Equals, mods: Control, action: IncreaseFontSize } - - { key: Plus, mods: Control, action: IncreaseFontSize } - - { key: Minus, mods: Control, action: DecreaseFontSize } - - # Vi Mode - - { key: Space, mods: Control, action: ToggleViMode } - - { key: Space, mods: Control, mode: Vi, action: ScrollToBottom } - - { key: I, mode: Vi, action: ScrollToBottom } - - { key: I, mode: Vi, action: ToggleViMode } - - { key: C, mods: Control, mode: Vi, action: ScrollToBottom } - - { key: C, mods: Control, mode: Vi, action: ToggleViMode } - - { key: Escape, mode: Vi, action: ClearSelection } - - { key: Y, mods: Control, mode: Vi, action: ScrollLineUp } - - { key: E, mods: Control, mode: Vi, action: ScrollLineDown } - - { key: G, mode: Vi, action: ScrollToTop } - - { key: G, mods: Shift, mode: Vi, action: ScrollToBottom } - - { key: B, mods: Control, mode: Vi, action: ScrollPageUp } - - { key: F, mods: Control, mode: Vi, action: ScrollPageDown } - - { key: U, mods: Control, mode: Vi, action: ScrollHalfPageUp } - - { key: D, mods: Control, mode: Vi, action: ScrollHalfPageDown } - - { key: Y, mode: Vi, action: Copy } - - { key: Y, mode: Vi, action: ClearSelection } - - { key: V, mode: Vi, action: ToggleNormalSelection } - - { key: V, mods: Shift, mode: Vi, action: ToggleLineSelection } - - { key: V, mods: Control, mode: Vi, action: ToggleBlockSelection } - - { key: V, mods: Alt, mode: Vi, action: ToggleSemanticSelection } - - { key: Return, mode: Vi, action: Open } - - { key: K, mode: Vi, action: Up } - - { key: J, mode: Vi, action: Down } - - { key: H, mode: Vi, action: Left } - - { key: L, mode: Vi, action: Right } - - { key: Up, mode: Vi, action: Up } - - { key: Down, mode: Vi, action: Down } - - { key: Left, mode: Vi, action: Left } - - { key: Right, mode: Vi, action: Right } - - { key: Key0, mode: Vi, action: First } - - { key: Key4, mode: Vi, action: Last } - - { key: Key6, mods: Shift, mode: Vi, action: FirstOccupied } - - { key: H, mods: Shift, mode: Vi, action: High } - - { key: M, mods: Shift, mode: Vi, action: Middle } - - { key: L, mods: Shift, mode: Vi, action: Low } - - { key: B, mode: Vi, action: SemanticLeft } - - { key: W, mode: Vi, action: SemanticRight } - - { key: E, mode: Vi, action: SemanticRightEnd } - - { key: B, mods: Shift, mode: Vi, action: WordLeft } - - { key: W, mods: Shift, mode: Vi, action: WordRight } - - { key: E, mods: Shift, mode: Vi, action: WordRightEnd } - - { key: Key5, mods: Shift, mode: Vi, action: Bracket } - - { key: Slash, mode: Vi, action: SearchForward } - - { key: Slash, mods: Shift, mode: Vi, action: SearchBackward } - - { key: N, mode: Vi, action: SearchNext } - - { key: N, mods: Shift, mode: Vi, action: SearchPrevious } -# -# -# - #- { key: Paste, action: Paste } - #- { key: Copy, action: Copy } - #- { key: L, mods: Control, action: ClearLogNotice } - #- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp } - #- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown } - #- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop } - #- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom } - - # Vi Mode - #- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode } - #- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom } - #- { key: Escape, mode: Vi|~Search, action: ClearSelection } - #- { key: I, mode: Vi|~Search, action: ToggleViMode } - #- { key: I, mode: Vi|~Search, action: ScrollToBottom } - #- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode } - #- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp } - #- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown } - #- { key: G, mode: Vi|~Search, action: ScrollToTop } - #- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom } - #- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp } - #- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown } - #- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp } - #- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown } - #- { key: Y, mode: Vi|~Search, action: Copy } - #- { key: Y, mode: Vi|~Search, action: ClearSelection } - #- { key: Copy, mode: Vi|~Search, action: ClearSelection } - #- { key: V, mode: Vi|~Search, action: ToggleNormalSelection } - #- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection } - #- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection } - #- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection } - #- { key: Return, mode: Vi|~Search, action: Open } - #- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor } - #- { key: K, mode: Vi|~Search, action: Up } - #- { key: J, mode: Vi|~Search, action: Down } - #- { key: H, mode: Vi|~Search, action: Left } - #- { key: L, mode: Vi|~Search, action: Right } - #- { key: Up, mode: Vi|~Search, action: Up } - #- { key: Down, mode: Vi|~Search, action: Down } - #- { key: Left, mode: Vi|~Search, action: Left } - #- { key: Right, mode: Vi|~Search, action: Right } - #- { key: Key0, mode: Vi|~Search, action: First } - #- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last } - #- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied } - #- { key: H, mods: Shift, mode: Vi|~Search, action: High } - #- { key: M, mods: Shift, mode: Vi|~Search, action: Middle } - #- { key: L, mods: Shift, mode: Vi|~Search, action: Low } - #- { key: B, mode: Vi|~Search, action: SemanticLeft } - #- { key: W, mode: Vi|~Search, action: SemanticRight } - #- { key: E, mode: Vi|~Search, action: SemanticRightEnd } - #- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft } - #- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight } - #- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd } - #- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket } - #- { key: Slash, mode: Vi|~Search, action: SearchForward } - #- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward } - #- { key: N, mode: Vi|~Search, action: SearchNext } - #- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious } - - # Search Mode - #- { key: Return, mode: Search|Vi, action: SearchConfirm } - #- { key: Escape, mode: Search, action: SearchCancel } - #- { key: C, mods: Control, mode: Search, action: SearchCancel } - #- { key: U, mods: Control, mode: Search, action: SearchClear } - #- { key: W, mods: Control, mode: Search, action: SearchDeleteWord } - #- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious } - #- { key: N, mods: Control, mode: Search, action: SearchHistoryNext } - #- { key: Up, mode: Search, action: SearchHistoryPrevious } - #- { key: Down, mode: Search, action: SearchHistoryNext } - #- { key: Return, mode: Search|~Vi, action: SearchFocusNext } - #- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious } - - # (Windows, Linux, and BSD only) - #- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste } - #- { key: C, mods: Control|Shift, action: Copy } - #- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward } - #- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward } - #- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection } - #- { key: Insert, mods: Shift, action: PasteSelection } - #- { key: Key0, mods: Control, action: ResetFontSize } - #- { key: Equals, mods: Control, action: IncreaseFontSize } - #- { key: Plus, mods: Control, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Control, action: IncreaseFontSize } - #- { key: Minus, mods: Control, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize } - - # (Windows only) - #- { key: Return, mods: Alt, action: ToggleFullscreen } - - # (macOS only) - #- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" } - #- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory } - #- { key: Key0, mods: Command, action: ResetFontSize } - #- { key: Equals, mods: Command, action: IncreaseFontSize } - #- { key: Plus, mods: Command, action: IncreaseFontSize } - #- { key: NumpadAdd, mods: Command, action: IncreaseFontSize } - #- { key: Minus, mods: Command, action: DecreaseFontSize } - #- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize } - #- { key: V, mods: Command, action: Paste } - #- { key: C, mods: Command, action: Copy } - #- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection } - #- { key: H, mods: Command, action: Hide } - #- { key: H, mods: Command|Alt, action: HideOtherApplications } - #- { key: M, mods: Command, action: Minimize } - #- { key: Q, mods: Command, action: Quit } - #- { key: W, mods: Command, action: Quit } - #- { key: N, mods: Command, action: CreateNewWindow } - #- { key: F, mods: Command|Control, action: ToggleFullscreen } - #- { key: F, mods: Command, mode: ~Search, action: SearchForward } - #- { key: B, mods: Command, mode: ~Search, action: SearchBackward } - -#debug: - # Display the time it takes to redraw each frame. - #render_timer: false - - # Keep the log file after quitting Alacritty. - #persistent_logging: false - - # Log level - # - # Values for `log_level`: - # - Off - # - Error - # - Warn - # - Info - # - Debug - # - Trace - #log_level: Warn - - # Renderer override. - # - glsl3 - # - gles2 - # - gles2_pure - #renderer: None - - # Print all received window events. - #print_events: false - - # Highlight window damage information. - #highlight_damage: false diff --git a/home-manager/soispha/config/alacritty/default.nix b/home-manager/soispha/config/alacritty/default.nix deleted file mode 100644 index 4e98f502..00000000 --- a/home-manager/soispha/config/alacritty/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{config, ...}: { - programs.alacritty = { - enable = true; - }; - xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml; -} diff --git a/home-manager/soispha/config/btop/default.nix b/home-manager/soispha/config/btop/default.nix deleted file mode 100644 index 06b56ea7..00000000 --- a/home-manager/soispha/config/btop/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{config, ...}: { - programs.btop = { - enable = true; - }; -} diff --git a/home-manager/soispha/config/dconf/default.nix b/home-manager/soispha/config/dconf/default.nix deleted file mode 100644 index dc439e1e..00000000 --- a/home-manager/soispha/config/dconf/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - # Also see: https://github.com/gvolpe/dconf2nix - dconf.settings = { - "org/gnome/desktop/wm/preferences" = { - # hide gtk buttons in titelbar - button-layout = ""; - }; - }; -} diff --git a/home-manager/soispha/config/default.nix b/home-manager/soispha/config/default.nix deleted file mode 100644 index c7db65f4..00000000 --- a/home-manager/soispha/config/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{...}: { - imports = [ - ./alacritty - ./btop - ./dconf - ./direnv - ./firefox - ./gammastep - ./git - ./gpg - ./grades - ./gtk - ./himalaya - ./iamb - ./keepassxc - ./latexindent - ./less - ./lf - ./mail - ./mako - ./mbsync - ./mpd - ./mpv - ./mumble - ./neomutt - ./neovim - ./nheko - ./npm - ./python - ./rclone - ./ssh - ./swayidle - ./swaylock - ./tridactyl - ./yambar - ./zsh - ]; -} diff --git a/home-manager/soispha/config/direnv/default.nix b/home-manager/soispha/config/direnv/default.nix deleted file mode 100644 index 3a7b8add..00000000 --- a/home-manager/soispha/config/direnv/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.direnv = { - enable = true; - nix-direnv.enable = true; - }; -} diff --git a/home-manager/soispha/config/firefox/config/bookmarks/default.nix b/home-manager/soispha/config/firefox/config/bookmarks/default.nix deleted file mode 100644 index 4de83ac9..00000000 --- a/home-manager/soispha/config/firefox/config/bookmarks/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - name = "Feed - Piped"; - url = "https://piped.video/feed"; - } - - { - name = "DeepL Translate"; - url = "https://www.deepl.com/translator"; - } - - { - name = "HM Options"; - url = "https://mipmip.github.io/home-manager-option-search/"; - } - - { - name = "Nix lib"; - url = "https://teu5us.github.io/nix-lib.html"; - } - - { - name = "Nixpkgs manual"; - url = "https://ryantm.github.io/nixpkgs/"; - } -] diff --git a/home-manager/soispha/config/firefox/config/chrome/userChrome.css b/home-manager/soispha/config/firefox/config/chrome/userChrome.css deleted file mode 100644 index 0b3aff77..00000000 --- a/home-manager/soispha/config/firefox/config/chrome/userChrome.css +++ /dev/null @@ -1,41 +0,0 @@ -/* thickness of tab when you have too many open tabs */ -.tabbrowser-tab:not([pinned="true"]) { - min-width: 10px !important; - min-height: 10px !important; -} - -/* tab height -#TabsToolbar .tabbrowser-tabs { -min-height: 10px !important; -} -*/ - -/* -.tabbrowser-tab {min-width: 016px !important;} -.tabbrowser-tab {clip-width: 016px !important;} -*/ - -/* the + button that opens new tabs */ -#TabsToolbar .tabs-newtab-button { - margin-left: 10px !important; - height: Auto !important; -} - -#main-window[privatebrowsingmode="temporary"] #navigator-toolbox { - background-color: #c40944 !important; -} - -/* close button inside a tab */ -.tab-close-button * { - width: 10px !important; - height: 10px !important; -} - -/* bookmark toolbar */ -#personal-bookmarks .bookmark-item > .toolbarbutton-text { - font-size: 10pt !important; -} -#personal-bookmarks .bookmark-item > .toolbarbutton-icon { - height: 12px !important; - width: 12px !important; -} diff --git a/home-manager/soispha/config/firefox/config/extensions/extensions.json b/home-manager/soispha/config/firefox/config/extensions/extensions.json deleted file mode 100644 index 7f32dfb1..00000000 --- a/home-manager/soispha/config/firefox/config/extensions/extensions.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "darkreader": { - "addonId": "addon@darkreader.org", - "pname": "darkreader", - "sha256": "sha256:964d7fdeec1dc90b5238a82db699de7a2bbf54e3e2bf18569befff451f35f89a", - "url": "https://addons.mozilla.org/firefox/downloads/file/4151368/darkreader-4.9.65.xpi", - "version": "4.9.65" - }, - "keepassxc-browser": { - "addonId": "keepassxc-browser@keepassxc.org", - "pname": "keepassxc-browser", - "sha256": "sha256:deb1c3c29fabe90dd811536d434d64c200caab9a9f7febc3428aa170eefec5f2", - "url": "https://addons.mozilla.org/firefox/downloads/file/4134768/keepassxc_browser-1.8.7.xpi", - "version": "1.8.7" - }, - "libredirect": { - "addonId": "7esoorv3@alefvanoon.anonaddy.me", - "pname": "libredirect", - "sha256": "sha256:564e56e1ccccf2f445b6cb9485c602609589a23052d2a53ab491cbce51c6b42f", - "url": "https://addons.mozilla.org/firefox/downloads/file/4144580/libredirect-2.7.1.xpi", - "version": "2.7.1" - }, - "simple-tab-groups": { - "addonId": "simple-tab-groups@drive4ik", - "pname": "simple-tab-groups", - "sha256": "sha256:b56f30cea753a9c4d1c0e078c0e5e635f1885ea7e40305cee59b9e145fad0a6c", - "url": "https://addons.mozilla.org/firefox/downloads/file/4103800/simple_tab_groups-5.2.xpi", - "version": "5.2" - }, - "tridactyl-vim": { - "addonId": "tridactyl.vim@cmcaine.co.uk", - "pname": "tridactyl-vim", - "sha256": "sha256:08b7af97bef05300ab3ac3ad721322ff00505631233482568fc4489c16d51b71", - "url": "https://addons.mozilla.org/firefox/downloads/file/4036604/tridactyl_vim-1.23.0.xpi", - "version": "1.23.0" - }, - "ublock-origin": { - "addonId": "uBlock0@raymondhill.net", - "pname": "ublock-origin", - "sha256": "sha256:8b73468bc233a11dd2895219466381783d19123857dd0b6fd16a01820fca4834", - "url": "https://addons.mozilla.org/firefox/downloads/file/4141256/ublock_origin-1.51.0.xpi", - "version": "1.51.0" - }, - "video-pauser": { - "addonId": "video-pauser@addons.vhack.eu", - "pname": "video-pauser", - "sha256": "sha256:da02e29f1d50d3a6db8a28bb7972afaeaa788bb8d38a2e9ebbfcd73d65d84841", - "url": "https://addons.mozilla.org/firefox/downloads/file/4098103/video_pauser-0.1.0.xpi", - "version": "0.1.0" - } -} diff --git a/home-manager/soispha/config/firefox/config/prefs/default.nix b/home-manager/soispha/config/firefox/config/prefs/default.nix deleted file mode 100644 index 91bb65f0..00000000 --- a/home-manager/soispha/config/firefox/config/prefs/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - pkgs, - config, - user_js, - lib, - ... -}: let - bookmarks = import ../bookmarks; - firefoxBookmarksFile = (import ../../functions/bookmarks) {inherit lib pkgs;}; - user_js_override = pkgs.writeText "user.override.js" (builtins.readFile ./override.js); -in - pkgs.runCommand "user.js" {} '' - mkdir $out; - cat "${user_js}/user.js" > $out/user.js; - cat "${user_js_override}" >> $out/user.js; - - cat << EOF >> $out/user.js; - // My bookmarks - user_pref("browser.bookmarks.file", "${toString (firefoxBookmarksFile bookmarks)}"); - user_pref("browser.startup.homepage", "file:///home/dt/home.html"); // 0103 // TODO: add this from a flake - user_pref("browser.download.dir", "${config.home.homeDirectory}/media/downloads"); - EOF - '' diff --git a/home-manager/soispha/config/firefox/config/prefs/override.js b/home-manager/soispha/config/firefox/config/prefs/override.js deleted file mode 100644 index 9c9b70e5..00000000 --- a/home-manager/soispha/config/firefox/config/prefs/override.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - 0100: STARTUP - 0200: GEOLOCATION / LANGUAGE / LOCALE - 0300: QUIETER FOX - 0400: SAFE BROWSING - 0600: BLOCK IMPLICIT OUTBOUND - 0700: DNS / DoH / PROXY / SOCKS / IPv6 - 0800: LOCATION BAR / SEARCH BAR / SUGGESTIONS / HISTORY / FORMS - 0900: PASSWORDS - 1000: DISK AVOIDANCE - 1200: HTTPS (SSL/TLS / OCSP / CERTS / HPKP) - 1400: FONTS - 1600: HEADERS / REFERERS - 1700: CONTAINERS - 2000: PLUGINS / MEDIA / WEBRTC - 2400: DOM (DOCUMENT OBJECT MODEL) - 2600: MISCELLANEOUS - 2700: ETP (ENHANCED TRACKING PROTECTION) - 2800: SHUTDOWN & SANITIZING - 4500: RFP (RESIST FINGERPRINTING) - 5000: OPTIONAL OPSEC - 5500: OPTIONAL HARDENING - 6000: DON'T TOUCH - 7000: DON'T BOTHER - 8000: DON'T BOTHER: FINGERPRINTING - 9000: NON-PROJECT RELATED - 9999: DEPRECATED / REMOVED / LEGACY / RENAMED -*/ - - -// restore session -user_pref("browser.startup.page", 3); // 0102 - -user_pref("browser.newtabpage.enabled", true); // 0104 - -// disable the geoservice, TODO: don't know if I want this -//user_pref("geo.provider.use_geoclue", false); // 0202 - -// TODO: is this something useful? -user_pref("datareporting.policy.dataSubmissionEnabled", true); // 0330 - -// enable health reports -user_pref("datareporting.healthreport.uploadEnabled", true); // 0331 - -// Do I want to opt-out? -user_pref("toolkit.telemetry.coverage.opt-out", false); // 0333 - -// enables studies -user_pref("app.shield.optoutstudies.enabled", true); // 0340 - -// I guess that browsing protection is useful -user_pref("browser.safebrowsing.downloads.remote.enabled", true); // 0403 - -// TODO: does this (-> set to false) make things slower? -user_pref("network.prefetch-next", true); // 0601 - -// enable ipv6 because the rest of the system uses it -user_pref("network.dns.disableIPv6", false); // 0701 - -// TRR only -user_pref("network.trr.mode", 3); // 0710 - -// I trust my search engine -user_pref("keyword.enabled", true); // 801 -user_pref("browser.search.suggest.enabled", true); // 0804 -user_pref("browser.urlbar.suggest.searches", true); // 0804 -// TODO: no idea what this does, enabling it -user_pref("browser.urlbar.showSearchTerms.enabled", true); // 9004 - -// prefetch urls, if the get auto completed -user_pref("browser.urlbar.speculativeConnect.enabled", true); // 0805 - -// Disable autoScrolling (clicking with the mouse wheel) -user_pref("general.autoScroll", false); - -// add new tabs after the current one -user_pref("browser.tabs.insertAfterCurrent", true); - -// TODO: I might want to enable this -//user_pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); // 0807 - -// TODO: enable form and search history? -//user_pref("browser.formfill.enable", false); // 0810 - -// disk cache should help performance -user_pref("browser.cache.disk.enable", true); // 1001 - -// store extra session data (form content, cookies and POST data) 0: everywhere -user_pref("browser.sessionstore.privacy_level", 0); // 1003 - -// Disable unsafe passive content (images) on https sites -user_pref("security.mixed_content.block_display_content", true); // 1241 - -// Disable the eme banner -user_pref("browser.eme.ui.enabled", false); // 2022 - -// Don't delete my precious temp files -user_pref("browser.helperApps.deleteTempFileOnExit", false); // 2603 - -// Download to the download dir -user_pref("browser.download.useDownloadDir", true); // 2651 - -// Open the download panel -user_pref("browser.download.alwaysOpenPanel", true); // 2652 - -// Block after custom ruleset -user_pref("browser.contentblocking.category", "custom"); // 2701 - -// set the custom settings // 7016 -user_pref("network.cookie.cookieBehavior", 1); -user_pref("network.http.referer.disallowCrossSiteRelaxingDefault", true); -user_pref("network.http.referer.disallowCrossSiteRelaxingDefault.top_navigation", true); -user_pref("privacy.partition.network_state.ocsp_cache", true); -user_pref("privacy.query_stripping.enabled", true); -user_pref("privacy.trackingprotection.enabled", true); -user_pref("privacy.trackingprotection.socialtracking.enabled", true); -user_pref("privacy.trackingprotection.cryptomining.enabled", true); -user_pref("privacy.trackingprotection.fingerprinting.enabled", true); - - -// I might want to change that, when it hinders session restore -//user_pref("privacy.partition.always_partition_third_party_non_cookie_storage.exempt_sessionstorage", false); // 2720 - -// I like my history very much! -user_pref("privacy.sanitize.sanitizeOnShutdown", false); // 2810 - -// The downsides (light theme + potential breakages): -//user_pref("privacy.resistFingerprinting", true); // 4501 -user_pref("privacy.resistFingerprinting.letterboxing", false); // 4504 - -// I would like to keep my gl, even in the web -user_pref("webgl.disabled", false); // 4520 - -// I like my service workers and am using a service using them. -user_pref("dom.serviceWorkers.enabled", true); // 7017 - -// I've got a password manager already -user_pref("signon.rememberSignons", false); // 5003 - -// Do not track header -user_pref("privacy.donottrackheader.enabled", true); // 7015 - -// Allow my custom css -user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); - -// might improve performance TODO: -user_pref("gfx.webrender.all", true); - -// disable updates (pretty pointless with nix) -user_pref("extensions.update.autoUpdateDefault", false); -user_pref("extensions.update.enabled", false); -user_pref("app.update.channel", "default"); - -user_pref("browser.ctrlTab.recentlyUsedOrder", false); - -user_pref("browser.download.useDownloadDir", true); -user_pref("browser.download.folderList", 2); # TODO: -user_pref("browser.download.viewableInternally.typeWasRegistered.svg", true); -user_pref("browser.download.viewableInternally.typeWasRegistered.webp", true); -user_pref("browser.download.viewableInternally.typeWasRegistered.xml", true); - -// TODO: what does this do? -user_pref("browser.search.widget.inNavBar", true); - -user_pref("browser.shell.checkDefaultBrowser", false); -user_pref("browser.tabs.loadInBackground", true); -user_pref("browser.urlbar.placeholderName", "Brave"); - -// Set the tabs and bookmarks -user_pref("browser.tabs.inTitlebar", 1); -user_pref("browser.toolbars.bookmarks.visibility", "always"); -user_pref("browser.places.importBookmarksHTML", true); - -// Theme -user_pref("extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); -user_pref("extensions.extensions.activeThemeID", "firefox-alpenglow@mozilla.org"); - -// highlight all entries when searching -user_pref("findbar.highlightAll", true); - -// TODO: -//user_pref("extensions.webcompat.enable_picture_in_picture_overrides", true); -//user_pref("extensions.webcompat.enable_shims", true); -//user_pref("extensions.webcompat.perform_injections", true); -//user_pref("extensions.webcompat.perform_ua_overrides", true); - -// onlykey / copied from a yubikey config -//user_pref("security.webauth.u2f", true); -//user_pref("security.webauth.webauthn", true); -//user_pref("security.webauth.webauthn_enable_softtoken", true); -//user_pref("security.webauth.webauthn_enable_usbtoken", true); diff --git a/home-manager/soispha/config/firefox/config/search/engines/default.nix b/home-manager/soispha/config/firefox/config/search/engines/default.nix deleted file mode 100644 index 286d7247..00000000 --- a/home-manager/soispha/config/firefox/config/search/engines/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{pkgs, ...}: { - "Brave Search" = { - urls = [{template = "https://search.brave.com/search?q={searchTerms}";}]; - IconUpdateURL = "https://raw.githubusercontent.com/brave/brave-core/master/components/brave_welcome_ui/components/images/lion_logo.svg"; - updateInterval = 24; # every day - definedAliases = ["@bs"]; - }; - - # NIX - "Nix Packages" = { - urls = [{template = "https://search.nixos.org/packages?type=packages&query={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@np"]; - }; - "Nix Options" = { - urls = [{template = "https://search.nixos.org/options?type=options&query={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@no"]; - }; - "NixOS Wiki" = { - urls = [{template = "https://nixos.wiki/index.php?search={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@nw"]; - }; - - "Arch Wiki" = { - urls = [{template = "https://wiki.archlinux.org/index.php?search={searchTerms}";}]; - iconUpdateURL = "https://upload.wikimedia.org/wikipedia/commons/a/a5/Archlinux-icon-crystal-64.svg"; - updateInterval = 24; - definedAliases = ["@aw"]; - }; - - # RUST - "Rust std" = { - urls = [{template = "https://doc.rust-lang.org/std/?search={searchTerms}";}]; - iconUpdateURL = "https://rustacean.net/assets/rustacean-orig-noshadow.svg"; - updateInterval = 24; - definedAliases = ["@rs"]; - }; - - "Google Scholar" = { - urls = [{template = "https://scholar.google.com/scholar?hl=en&q={searchTerms}";}]; - iconUpdateURL = "https://scholar.google.com/favicon.ico"; - updateInterval = 24; - definedAliases = ["@gs"]; - }; - "Wikipedia" = { - urls = [{template = "https://en.wikipedia.org/wiki/{searchTerms}";}]; - iconUpdateURL = "https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg"; - updateInterval = 24; - definedAliases = ["@wp"]; - }; - - "Wikipedia (en)".metaData.hidden = true; - "DuckDuckGo".metaData.hidden = true; - "Bing".metaData.hidden = true; - "Google".metaData.hidden = true; - "Amazon.de".metaData.hidden = true; -} diff --git a/home-manager/soispha/config/firefox/default.nix b/home-manager/soispha/config/firefox/default.nix deleted file mode 100644 index 1040ed0b..00000000 --- a/home-manager/soispha/config/firefox/default.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - config, - pkgs, - lib, - user_js, - video_pause, - ... -}: let - userChrome = builtins.readFile ./config/chrome/userChrome.css; - - user_js_nix = (import ./config/prefs) {inherit pkgs lib config user_js;}; - - extensions = builtins.map buildFirefoxXpiAddon ( - lib.attrValues ( - lib.importJSON ./config/extensions/extensions.json - ) - ); - engines = (import ./config/search/engines) {inherit pkgs;}; - - # source: https://gitlab.com/rycee/nur-expressions/-/blob/master/pkgs/firefox-addons/default.nix - buildFirefoxXpiAddon = (import ./functions/extensions) {inherit pkgs;}; - - video-pauser = (import ./functions/extensions/video-pauser.nix) {inherit pkgs video_pause;}; -in { - home.packages = [ - pkgs.tridactyl-native - ]; - home.sessionVariables = { - # improve touch input & make scrolling smother - MOZ_USE_XINPUT2 = "1"; - # improve wayland support - MOZ_ENABLE_WAYLAND = 1; - }; - xdg.mimeApps = { - enable = true; - defaultApplications = { - "text/html" = ["firefox.desktop"]; - "x-scheme-handler/http" = ["firefox.desktop"]; - "x-scheme-handler/https" = ["firefox.desktop"]; - "x-scheme-handler/about" = ["firefox.desktop"]; - "x-scheme-handler/unknown" = ["firefox.desktop"]; - }; - }; - programs.firefox = { - enable = true; - package = pkgs.firefox-wayland.override { - extraNativeMessagingHosts = [video-pauser]; - cfg = { - enableTridactylNative = true; - }; - }; - profiles."default" = { - inherit extensions; - isDefault = true; - id = 0; - name = "default"; - - inherit userChrome; - - search = { - default = "Brave Search"; - force = true; - - inherit engines; - }; - - bookmarks = []; - extraConfig = builtins.readFile "${user_js_nix}/user.js"; - }; - }; -} diff --git a/home-manager/soispha/config/firefox/functions/bookmarks/default.nix b/home-manager/soispha/config/firefox/functions/bookmarks/default.nix deleted file mode 100644 index d1d89dd2..00000000 --- a/home-manager/soispha/config/firefox/functions/bookmarks/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - lib, - pkgs, -}: bookmarks: let - indent = level: - lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); - - bookmarkToHTML = indentLevel: bookmark: '' - ${indent indentLevel}
    ${lib.escapeXML bookmark.name}''; - - directoryToHTML = indentLevel: directory: '' - ${indent indentLevel}
    ${ - if directory.toolbar - then ''

    Bookmarks Toolbar'' - else "

    ${lib.escapeXML directory.name}" - }

    - ${indent indentLevel}

    - ${allItemsToHTML (indentLevel + 1) directory.bookmarks} - ${indent indentLevel}

    ''; - - itemToHTMLOrRecurse = indentLevel: item: - if item ? "url" - then bookmarkToHTML indentLevel item - else directoryToHTML indentLevel item; - - allItemsToHTML = indentLevel: bookmarks: - lib.concatStringsSep "\n" - (map (itemToHTMLOrRecurse indentLevel) bookmarks); - - bookmarkEntries = allItemsToHTML 1 bookmarks; -in - pkgs.writeText "firefox-bookmarks.html" '' - - - - Bookmarks -

    Bookmarks Menu

    - -

    -

    Bookmarks Toolbar

    -

    - ${bookmarkEntries} -

    -

    - '' diff --git a/home-manager/soispha/config/firefox/functions/extensions/default.nix b/home-manager/soispha/config/firefox/functions/extensions/default.nix deleted file mode 100644 index b84461c7..00000000 --- a/home-manager/soispha/config/firefox/functions/extensions/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{pkgs, ...}: { - pname, - version, - addonId, - url, - sha256, - #meta, - ... -}: -pkgs.stdenv.mkDerivation { - name = "${pname}-${version}"; - - #inherit meta; - - src = builtins.fetchurl {inherit url sha256;}; - - preferLocalBuild = true; - allowSubstitutes = true; - - buildCommand = '' - dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" - mkdir -p "$dst" - install -v -m644 "$src" "$dst/${addonId}.xpi" - ''; -} diff --git a/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix b/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix deleted file mode 100644 index c4c5238f..00000000 --- a/home-manager/soispha/config/firefox/functions/extensions/video-pauser.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - pkgs, - video_pause, - ... -}: -pkgs.runCommand "video_pause_native_messaging" {} '' - install -d $out/share/ - cat << EOF > $out/share/video_pauser.json - { - "name": "video_pauser", - "description": "Pause your Videos with a single key stroke!", - "path": "${video_pause}/bin/video_pause", - "type": "stdio", - "allowed_extensions": ["video-pauser@addons.vhack.eu"] - } - EOF - - nativeMessagingPaths=( - /lib/mozilla/native-messaging-hosts - /etc/opt/chrome/native-messaging-hosts - /etc/chromium/native-messaging-hosts - /etc/vivaldi/native-messaging-hosts - /lib/librewolf/native-messaging-hosts - ) - - for manifestDir in "''${nativeMessagingPaths[@]}"; do - install -d $out$manifestDir - ln -s $out/share/video_pauser.json $out$manifestDir/ - done -'' diff --git a/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py b/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py deleted file mode 100755 index 311fd214..00000000 --- a/home-manager/soispha/config/firefox/scripts/unzip_mozlz4.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/python -# source: https://unix.stackexchange.com/a/497861 -# Command-line tool to decompress mozLz4 files used for example by Firefox to store various kinds of session backup information. -# Works in both Python 2.7.15 and 3.6.7, as of version 2.1.6 of the LZ4 Python bindings at pypi.org/project/lz4. -# To use in another script, simply cut and paste the import statement and the mozlz4_to_text() function (lines 8 to 17). - -import lz4.block # pip install lz4 --user - - -def mozlz4_to_text(filepath): - # Given the path to a "mozlz4", "jsonlz4", "baklz4" etc. file, - # return the uncompressed text. - bytestream = open(filepath, "rb") - bytestream.read(8) # skip past the b"mozLz40\0" header - valid_bytes = bytestream.read() - text = lz4.block.decompress(valid_bytes) - return text - - -def main(args): - # Given command-line arguments of an input filepath for a ".mozlz4" file - # and optionally an output filepath, write the decompressed text to the - # output filepath. - # Default output filepath is the input filepath minus the last three characters - # (e.g. "foo.jsonlz4" becomes "foo.json") - filepath_in = args[0] - if len(args) < 2: - filepath_out = filepath_in[:-3] - else: - filepath_out = args[1] - text = mozlz4_to_text(filepath_in) - with open(filepath_out, "wb") as outfile: - outfile.write(text) - print("Wrote decompressed text to {}".format(filepath_out)) - - -if __name__ == "__main__": - import sys - args = sys.argv[1:] - if args and not args[0] in ("--help", "-h"): - main(args) - else: - print("Usage: mozlz4.py ") diff --git a/home-manager/soispha/config/firefox/scripts/update_extensions b/home-manager/soispha/config/firefox/scripts/update_extensions deleted file mode 100755 index 05f47aad..00000000 --- a/home-manager/soispha/config/firefox/scripts/update_extensions +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -#. ~/.local/lib/shell/lib - -tmp=$(mktemp) -cat << EOF > $tmp - darkreader - keepassxc-browser - simple-tab-groups - ublock-origin - tridactyl-vim - video-pauser - libredirect -EOF - -# The bin is provided in the devshell. The cat execution should be unquoted -generate_extensions $(cat "$tmp") > "$(dirname $0)"/../config/extensions/extensions.json - - - -rm "$tmp"; diff --git a/home-manager/soispha/config/gammastep/default.nix b/home-manager/soispha/config/gammastep/default.nix deleted file mode 100644 index 1ae0550b..00000000 --- a/home-manager/soispha/config/gammastep/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - lib, - nixosConfig, - ... -}: let - temp = - if nixosConfig.soispha.laptop.enable - then 3000 - else 1300; -in { - services.gammastep = { - enable = true; - settings = { - general = { - temp-day = lib.mkForce temp; - temp-night = lib.mkForce temp; - gamma = "0.8:0.8:0.8"; - fade = 0; - adjustment-method = "wayland"; - location-provider = "manual"; - }; - - manual = { - lat = 48.1; - lon = 11.6; - }; - }; - }; -} diff --git a/home-manager/soispha/config/git/default.nix b/home-manager/soispha/config/git/default.nix deleted file mode 100644 index f99f705c..00000000 --- a/home-manager/soispha/config/git/default.nix +++ /dev/null @@ -1,90 +0,0 @@ -{ - lib, - nixosConfig, - ... -}: let - gitIgnoreFile = ./git_ignore.git; - gitTemplateFile = ./git_template.git; -in { - programs.git = { - enable = true; - #package = pkgs.gitAndTools.gitFull; # TODO: for git send-email support - aliases = { - st = "status"; - ds = "diff --staged"; - di = "diff"; - rs = "restore --staged"; - - ## Logging: - ls = "log --max-count=10 --color --format=format:'%C(bold red)%h%C(reset) %C(dim bold blue)%s%C(reset) %C(dim white)[%aN] %C(bold red)<%G?>%C(reset)%C(auto)%d%C(reset)'"; - - # https://stackoverflow.com/a/61487052 - lg = "lg1"; - lg1 = "lg1-specific --all"; - lg2 = "lg2-specific --all"; - lg3 = "lg3-specific --all"; - - lg1-specific = "log --graph --abbrev-commit --decorate \ - --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold cyan) [%G?]%C(reset)%C(auto)%d%C(reset)'"; - - lg2-specific = "log --graph --abbrev-commit --decorate \ - --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(auto)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)'"; - - lg3-specific = "log --graph --abbrev-commit --decorate \ - --format=format:'%C(bold blue)%h%C(reset)\ - - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)\ - %C(bold cyan)(committed: %cD)%C(reset) %C(auto)%d%C(reset)\ - %C(bold red)(signature: %G? by %GS, trust: %GT)%C(reset)%n\ - '' %C(white)%s%C(reset)%n''\ - %C(dim white)- %an <%ae> %C(reset) %C(dim white)(committer: %cn <%ce>)%C(reset)\ - %C(bold white)- trailers: %(trailers) %C(reset)'"; - }; - extraConfig = { - core = { - excludesFile = "${gitIgnoreFile}"; - }; - init = { - defaultBranch = "prime"; - }; - user = { - email = "soispha@vhack.eu"; - name = "Soispha"; - }; - help = { - autocorrect = 5; - }; - push = { - gpgSign = "if-asked"; - }; - commit = { - template = "${gitTemplateFile}"; - }; - diff = { - colorMoved = "default"; - }; - merge = { - conflictstyle = "diff3"; - }; - }; - delta = { - enable = true; - options = { - decorations = { - commit-decoration-style = "bold yellow box ul"; - file-decoration-style = "none"; - file-style = "bold yellow ul"; - }; - keep-plus-minus-markers = - if nixosConfig.soispha.laptop.enable - then true - else false; - features = "decorations"; - whitespace-error-style = "22 reverse"; - }; - }; - signing = { - key = "9606FC749FCE16360723D4ADA5E94010C3A642AD!"; - signByDefault = true; - }; - }; -} diff --git a/home-manager/soispha/config/git/git_ignore.git b/home-manager/soispha/config/git/git_ignore.git deleted file mode 100644 index 8f29815e..00000000 --- a/home-manager/soispha/config/git/git_ignore.git +++ /dev/null @@ -1,4 +0,0 @@ -# default nvim Session file name -Session.vim - -# vim: ft=gitignore diff --git a/home-manager/soispha/config/git/git_template.git b/home-manager/soispha/config/git/git_template.git deleted file mode 100644 index 9621698d..00000000 --- a/home-manager/soispha/config/git/git_template.git +++ /dev/null @@ -1,66 +0,0 @@ - -# Title: Summary, imperative, start upper case, don't end with a period -# If applied, this commit will - -# Body: Explain *what* and *why* (not *how*). - - -# BREAKING CHANGE: -# Fixes: # -# Refs: # -# Co-authored-by: - - - -# Convention Commits (https://www.conventionalcommits.org/en/v1.0.0/ or https://github.com/angular/angular/blob/85b4941be137a2fcdc664dc870e408dd72ad7de7/CONTRIBUTING.md#commit): -# Feat: [Features] -> MINOR version bump -# A new feature -# -# Fix: [Bug Fixes] -> PATCH version bump -# A bug fix -# -# append '!' after the type/scope: [Breaking Change] -> MAJOR version bump -# A breaking API change -# -# Docs: [Documentation] -# Documentation only changes -# -# Style: [Styles] -# Changes that do not affect the meaning of the code -# (white-space, formatting, missing semi-colons, etc) -# -# Refactor: [Code Refactoring] -# A code change that neither fixes a bug nor adds a feature -# -# Perf: [Performance Improvements] -> PATCH version bump -# A code change that improves performance -# -# Test: [Tests] -# Adding missing tests or correcting existing tests -# -# Build: [Builds] -> PATCH version bump -# Changes that affect the build system or external dependencies -# (example scopes: gulp, broccoli, npm) -# -# Ci: [Continuous Integrations] -# Changes to our CI configuration files and scripts -# (example scopes: Travis, Circle, BrowserStack, SauceLabs) -# -# Chore: [Chores] -# Other changes that don't modify src or test files -# -# Reverts: [Reverts] -# Reverts a previous commit - -# How to Write a Git Commit Message: -# [https://chris.beams.io/posts/git-commit/] -> https://cbea.ms/git-commit/ -# -# 1. Separate subject from body with a blank line -# 2. Limit the subject line to 50 characters -# 3. Capitalize the subject line -# 4. Do not end the subject line with a period -# 5. Use the imperative mood in the subject line -# 6. Wrap the body at 72 characters -# 7. Use the body to explain *what* and *why* vs. *how* -# -# vim: ft=gitcommit diff --git a/home-manager/soispha/config/gpg/agent-program b/home-manager/soispha/config/gpg/agent-program deleted file mode 100755 index e6917db0..00000000 --- a/home-manager/soispha/config/gpg/agent-program +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -onlykey-gpg-agent -v --skey-slot=ECC32 --dkey-slot=ECC32 "$@" diff --git a/home-manager/soispha/config/gpg/default.nix b/home-manager/soispha/config/gpg/default.nix deleted file mode 100644 index 97334c8f..00000000 --- a/home-manager/soispha/config/gpg/default.nix +++ /dev/null @@ -1,65 +0,0 @@ -{ - config, - nixosConfig, - sysLib, - pkgs, - ... -}: let - agent-program = sysLib.writeShellScriptWithLibrary { - name = "onlykey-gpg-agent"; - src = ./agent-program; - dependencies = with pkgs; [ - python3 - onlykey-agent - ]; - }; - settings = - if nixosConfig.networking.hostName == "isimud" - then {} - else { - # Hardware-based GPG configuration - agent-program = "${agent-program}/bin/onlykey-gpg-agent"; - - default-key = "Soispha "; - # TODO: add more - }; - gpg-agent = - if nixosConfig.networking.hostName == "isimud" - then { - enable = true; - enableZshIntegration = true; - enableScDaemon = true; # smartcards and such things - pinentryFlavor = "tty"; - } - else { - enable = false; - enableZshIntegration = true; - enableScDaemon = true; # smartcards and such things - pinentryFlavor = "tty"; - }; -in { - programs.gpg = { - enable = true; - homedir = "${config.xdg.dataHome}/gnupg/onlykey"; - mutableKeys = false; - mutableTrust = false; - inherit settings; - publicKeys = [ - { - source = ./keys/key_1; - trust = "ultimate"; - } - { - source = ./keys/key_2; - trust = "ultimate"; - } - { - source = ./keys/key_3; - trust = "full"; - } - ]; - }; - services = { - inherit gpg-agent; - }; -} diff --git a/home-manager/soispha/config/gpg/keys/key_1 b/home-manager/soispha/config/gpg/keys/key_1 deleted file mode 100644 index b10b8b6c..00000000 Binary files a/home-manager/soispha/config/gpg/keys/key_1 and /dev/null differ diff --git a/home-manager/soispha/config/gpg/keys/key_2 b/home-manager/soispha/config/gpg/keys/key_2 deleted file mode 100644 index 0b06cf3b..00000000 Binary files a/home-manager/soispha/config/gpg/keys/key_2 and /dev/null differ diff --git a/home-manager/soispha/config/gpg/keys/key_3 b/home-manager/soispha/config/gpg/keys/key_3 deleted file mode 100644 index 22ffb931..00000000 Binary files a/home-manager/soispha/config/gpg/keys/key_3 and /dev/null differ diff --git a/home-manager/soispha/config/grades/config.yaml b/home-manager/soispha/config/grades/config.yaml deleted file mode 100644 index 36712971..00000000 --- a/home-manager/soispha/config/grades/config.yaml +++ /dev/null @@ -1,68 +0,0 @@ -# für oberstufe ---- -unit: Punkte -grade_groups: - - name: Zeugnis - weight: '100' - double_weight_on_class_type: false - - name: Sonstige - weight: '1' - double_weight_on_class_type: true - - name: Klausur - weight: '1' - double_weight_on_class_type: false - -grade_types: - - name: Zeugnis - group: Zeugnis - - name: Klausur - group: Klausur - - name: Epo - group: Sonstige - - name: Test - group: Sonstige - -class_types: - - name: NebenFach - double_weight_on_marked_grade_groups: true - - name: LeistungsKurs - double_weight_on_marked_grade_groups: false - -classes: - - name: M - long_name: Mathe - class_type: LeistungsKurs - - name: E - long_name: Englisch - class_type: LeistungsKurs - - name: CH - long_name: Chemie - class_type: LeistungsKurs - - - name: d - long_name: Deutsch - class_type: NebenFach - - name: g - long_name: Geschichte - class_type: NebenFach - - name: se - long_name: Sozialkunde/Erdkunde - class_type: NebenFach - - name: et - long_name: Ethik - class_type: NebenFach - - name: spj - long_name: Sport - class_type: NebenFach - - name: inf - long_name: Informatik - class_type: NebenFach - - name: ph - long_name: Phyisk - class_type: NebenFach - - name: phi - long_name: Philosophie - class_type: NebenFach - - name: bi - long_name: Biologie - class_type: NebenFach diff --git a/home-manager/soispha/config/grades/default.nix b/home-manager/soispha/config/grades/default.nix deleted file mode 100644 index d2678174..00000000 --- a/home-manager/soispha/config/grades/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - xdg.configFile."grades/config.yaml".source = ./config.yaml; -} diff --git a/home-manager/soispha/config/gtk/default.nix b/home-manager/soispha/config/gtk/default.nix deleted file mode 100644 index f5411369..00000000 --- a/home-manager/soispha/config/gtk/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ - config, - lib, - pkgs, - stdenv, - ... -}: { - gtk = { - enable = true; - theme = { - package = pkgs.nordic; - name = "Nordic"; - }; - cursorTheme = { - package = pkgs.nordzy-cursor-theme; - name = "Nordzy-cursors"; - }; - iconTheme = { - package = pkgs.nordzy-icon-theme; - name = "Nordzy-icon"; - }; - font = { - name = "Noto Sans"; - size = 10; - }; - gtk2 = { - configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - # extraConfig = '' - # gtk-enable-animations=1 - # gtk-primary-button-warps-slider=0 - # gtk-toolbar-style=3 - # gtk-menu-images=1 - # gtk-button-images=1 - # - # ''; - }; - gtk3 = { - # extraConfig = '' - # gtk-button-images=true - # gtk-decoration-layout=icon:minimize,maximize,close - # gtk-enable-animations=true - # gtk-menu-images=true - # gtk-primary-button-warps-slider=false - # gtk-toolbar-style=3 - # #gtk-modules=window-decorations-gtk-module:colorreload-gtk-module - # ''; - extraCss = ""; - }; - gtk4 = { - # extraConfig = '' - # gtk-application-prefer-dark-theme=true - # gtk-decoration-layout=icon:minimize,maximize,close - # gtk-enable-animations=true - # gtk-primary-button-warps-slider=false - # ''; - }; - }; -} diff --git a/home-manager/soispha/config/himalaya/default.nix b/home-manager/soispha/config/himalaya/default.nix deleted file mode 100644 index c072693e..00000000 --- a/home-manager/soispha/config/himalaya/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.himalaya = { - enable = true; - settings = { - # TODO: - }; - }; -} diff --git a/home-manager/soispha/config/iamb/config.json b/home-manager/soispha/config/iamb/config.json deleted file mode 100644 index ca06d543..00000000 --- a/home-manager/soispha/config/iamb/config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "soispha": { - "user_id": "@soispha:vhack.eu", - "url": "https://matrix.vhack.eu" - } - }, - "default_profile": "soispha" -} diff --git a/home-manager/soispha/config/iamb/default.nix b/home-manager/soispha/config/iamb/default.nix deleted file mode 100644 index 2a93472c..00000000 --- a/home-manager/soispha/config/iamb/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - xdg.configFile."iamb/config.json".source = ./config.json; -} diff --git a/home-manager/soispha/config/keepassxc/default.nix b/home-manager/soispha/config/keepassxc/default.nix deleted file mode 100644 index 3ac82812..00000000 --- a/home-manager/soispha/config/keepassxc/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."keepassxc/keepassxc.ini".source = ./keepassxc.ini; -} diff --git a/home-manager/soispha/config/keepassxc/keepassxc.ini b/home-manager/soispha/config/keepassxc/keepassxc.ini deleted file mode 100644 index 288a194b..00000000 --- a/home-manager/soispha/config/keepassxc/keepassxc.ini +++ /dev/null @@ -1,58 +0,0 @@ -[General] -AutoSaveAfterEveryChange=true -BackupBeforeSave=true -BackupFilePathPattern=/home/soispha/.local/share/keepassxc/{DB_FILENAME}.old.kdbx -ConfigVersion=2 -HideWindowOnCopy=false - -[Browser] -CustomProxyLocation= -Enabled=true - -[FdoSecrets] -Enabled=true - -[GUI] -AdvancedSettings=true -ApplicationTheme=dark -CompactMode=false -HidePasswords=true -ShowExpiredEntriesOnDatabaseUnlockOffsetDays=1 -TrayIconAppearance=monochrome-light - -[KeeShare] -Active="" -Own="" -QuietSuccess=true - -[PasswordGenerator] -AdditionalChars= -AdvancedMode=true -Braces=true -Dashes=true -EASCII=true -ExcludedChars= -Length=128 -Logograms=true -LowerCase=true -Math=true -Numbers=true -Punctuation=true -Quotes=true -SpecialChars=true -Type=0 -UpperCase=true -WordCount=4 -WordSeparator="," - -[SSHAgent] -Enabled=true - -[Security] -HidePasswordPreviewPanel=true -IconDownloadFallback=true -LockDatabaseIdle=false -LockDatabaseIdleSeconds=960 -PasswordEmptyPlaceholder=true -PasswordsHidden=true -PasswordsRepeatVisible=true diff --git a/home-manager/soispha/config/latexindent/default.nix b/home-manager/soispha/config/latexindent/default.nix deleted file mode 100644 index 0d776e14..00000000 --- a/home-manager/soispha/config/latexindent/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."latexindent/indentconfig.yaml".source = ./indentconfig.yaml; - xdg.configFile."latexindent/mysettings.yaml".source = ./mysettings.yaml; -} diff --git a/home-manager/soispha/config/latexindent/indentconfig.yaml b/home-manager/soispha/config/latexindent/indentconfig.yaml deleted file mode 100644 index d67351f3..00000000 --- a/home-manager/soispha/config/latexindent/indentconfig.yaml +++ /dev/null @@ -1,2 +0,0 @@ -paths: -- /home/dt/.config/latexindent/mysettings.yaml diff --git a/home-manager/soispha/config/latexindent/mysettings.yaml b/home-manager/soispha/config/latexindent/mysettings.yaml deleted file mode 100644 index 9a0f8b2f..00000000 --- a/home-manager/soispha/config/latexindent/mysettings.yaml +++ /dev/null @@ -1,672 +0,0 @@ -# defaultSettings.yaml for latexindent.pl, version 3.19.1, 2022-12-04 -# a script that aims to -# beautify .tex, .sty, .cls files -# -# (or latexindent.exe if you're on Windows) -# -#--------------------------------------------------------------------------------------- -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# See http://www.gnu.org/licenses/. -# -# Chris Hughes, 2017 -# -# For all communication, please visit: https://github.com/cmhughes/latexindent.pl -# -#--------------------------------------------------------------------------------------- -# You should feel encouraged to change anything you like in these settings, but -# it would probably be better to have your own user settings -# files somewhere else - remember that this file may be overwritten -# when you update your tex distribution. Please see the manual linked from: -# -# https://github.com/cmhughes/latexindent.pl -# -# for details of how to create and configure your own settings files. -# -# Please read the manual (linked from above) first to understand what each switch does. -# -#--------------------------------------------------------------------------------------- - -# latexindent can be called to act on a file without using the file's extension, -# e.g, simply -# latexindent myfile -# in which case the choice of file extension is chosen -# according to the choices made in fileExtensionPreference -# Other file extensions can be added. -fileExtensionPreference: - .tex: 1 - .sty: 2 - .cls: 3 - .bib: 4 - -# default file extension of backup file (if -w switch is active) -# for example, if your .tex file is called -# myfile.tex -# and you specify the backupExtension as BACKUP.bak then your -# backup file will be -# myfileBACKUP.bak -backupExtension: .bak - -# only one backup per file: -# - if onlyOneBackUp is 0 then, as a safety measure, -# the number on the extension increments by 1 each time: -# -# myfile.bak0, myfile.bak1, myfile.bak2 -# - if you set onlyOnebackUp to 1, then the backup file will -# be overwritten each time (not recommended until you trust the script) -onlyOneBackUp: 0 - -# some users may want a finite number of backup files, -# say at most 3; in which case, they can change this maxNumberOfBackUps. -# -# If maxNumberOfBackUps is set to 0 (or less) then infinitely -# many backups are possible, unless onlyOneBackUp is switched on -maxNumberOfBackUps: 0 - -# some users may wish to cycle through back up files. -# -# for example, with maxNumberOfBackUps: 4, they may -# wish to delete the oldest back up file, and keep only the most recent. -# -# copy myfile.bak1 to myfile.bak0 -# copy myfile.bak2 to myfile.bak1 -# copy myfile.bak3 to myfile.bak2 -# copy myfile.bak4 to myfile.bak3 -# -# the back up will be written to myfile.bak4 -cycleThroughBackUps: 0 - -# preferences for information displayed in the log file -logFilePreferences: - showEveryYamlRead: 1 - showAmalgamatedSettings: 0 - showDecorationStartCodeBlockTrace: 0 - showDecorationFinishCodeBlockTrace: 0 - endLogFileWith: '--------------' - showGitHubInfoFooter: 1 - Dumper: - Terse: 1 - Indent: 1 - Useqq: 1 - Deparse: 1 - Quotekeys: 0 - Sortkeys: 1 - Pair: " => " - -# verbatim environments specified -# in this field will not be changed at all! -verbatimEnvironments: - verbatim: 1 - lstlisting: 1 - minted: 1 - -# verbatim commands such as \verb! body !, \lstinline$something else$ -verbatimCommands: - verb: 1 - lstinline: 1 - -# no indent blocks (not necessarily verbatim -# environments) which are marked as %\begin{noindent} -# or anything else that you detail in the following -noIndentBlock: - noindent: 1 - cmhtest: 1 - -# \begin{document} and \end{document} are treated differently -# by latexindent within filecontents environments -fileContentsEnvironments: - filecontents: 1 - filecontents*: 1 - -# indent preamble -indentPreamble: 1 - -# assume no preamble in cls, sty, by default -lookForPreamble: - .tex: 1 - .sty: 0 - .cls: 0 - .bib: 0 - -# some preambles can contain \begin and \end statements -# that are not in their 'standard environment block', for example, -# consider the following key = values: -# preheadhook={\begin{mdframed}[style=myframedstyle]}, -# postfoothook=\end{mdframed}, -preambleCommandsBeforeEnvironments: 0 - -# default value of indentation -defaultIndent: " " - -# remove trailing whitespace from all lines -removeTrailingWhitespace: - beforeProcessing: 0 - afterProcessing: 1 - -# name of code blocks that should have their body aligned at ampersand delimiters -lookForAlignDelims: - tabular: - delims: 1 - alignDoubleBackSlash: 1 - spacesBeforeDoubleBackSlash: 1 - multiColumnGrouping: 0 - alignRowsWithoutMaxDelims: 1 - spacesBeforeAmpersand: 1 - spacesAfterAmpersand: 1 - justification: left - alignFinalDoubleBackSlash: 0 - dontMeasure: 0 - delimiterRegEx: '(?]*?>)' - keyEqualsValuesBracesBrackets: - name: '[a-zA-Z@\*0-9_\/.:\#-]+[a-zA-Z@\*0-9_\/.\h\{\}:\#-]*?' - follow: '(?:(?<]+?' - follow: '\h|\R|\{|\[|\$|\)|\(' - UnNamedGroupingBracesBrackets: - follow: '\{|\[|,|&|\)|\(|\$' - arguments: - before: '(?:#\d\h*;?,?\/?)+|\<.*?\>' - between: '_|\^|\*' - trailingComments: - notPreceededBy: '(? "$script" -chmod +x "$script" -"$VISUAL" "$script" - - -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp b/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp deleted file mode 100755 index a520469c..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/mk_scr_temp +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - - -prompt "Script name: " -name="" -while [ -z "$name" ] || [ -e "$name" ] -do - read -r name - if [ -e "$name" ]; then - prompt "Script already exists, overwrite [y|N]: " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - prompt "Script Name: " - fi - fi -done - -script="$(pwd)"/"$name" - -sed 's|%TO_BE_SHELL_LIBRARY_PATH|%SHELL_LIBRARY_PATH|' "%SHELL_LIBRARY_TEMPLATE" > "$script" -chmod +x "$script" -"$VISUAL" "$script" - - -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/open b/home-manager/soispha/config/lf/commands/scripts/open deleted file mode 100755 index c507482b..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/open +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -case $(file --mime-type "$f" -bL) in - text/*|application/json|application/vnd.hp-HPGL) "$EDITOR" "$f";; - image/*) "$IVIEWER" "$f";; - *) xdg-open "$f";; -esac -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/open_config b/home-manager/soispha/config/lf/commands/scripts/open_config deleted file mode 100755 index 35e5165d..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/open_config +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -"$EDITOR" "$(bookmenu -b ~/.config/bookmenu/configs -f fzf -o)" # TODO: implement this -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/restore_trash b/home-manager/soispha/config/lf/commands/scripts/restore_trash deleted file mode 100755 index a7bf0094..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/restore_trash +++ /dev/null @@ -1,7 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -trash list | fzf --multi | awk '{print $NF}' | xargs trash restore --match=exact -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/set_wall_paper b/home-manager/soispha/config/lf/commands/scripts/set_wall_paper deleted file mode 100755 index c493e773..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/set_wall_paper +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -die "No yet implemented" # TODO: do what the 'die' says -#sed -i "s,export AWMWALLPAPER='.*',export AWMWALLPAPER='${f}'," ${ZDOTDIR}/.zshenv -#nohub swaybg -i "$f" -#feh --bg-max --no-fehbg "$f" -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/stripspace b/home-manager/soispha/config/lf/commands/scripts/stripspace deleted file mode 100755 index 91714712..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/stripspace +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -files=$(mktmp); -echo "$fx" > "$files"; - -awk_source=$(mktmp); -cat << OFT > "$awk_source" -BEGIN {FS=" "} -{for (i=1; i != NF + 1; i++) - if (i == NF) { - parts[i]=tolower(\$i); - } else { - parts[i]=tolower(\$i"_"); - } -} -END {for (i in parts) printf parts[i]} -OFT - -while read -r file; do - dirty_name=$(mktmp) - basename "$file" > "$dirty_name"; - clean_name=$(awk -f "$awk_source" "$dirty_name"); - - [ -e "$clean_name" ] && die "file \"$clean_name\" already exists!"; - mv "$(cat "$dirty_name")" "$clean_name" || die "Move failed"; - lf -remote 'send reload' -done < "$files"; -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/trash b/home-manager/soispha/config/lf/commands/scripts/trash deleted file mode 100755 index 8dd6033d..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/trash +++ /dev/null @@ -1,26 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -trash_output=$(mktmp); -expected_error_output=$(mktmp); - -while read -r file; do - set -- "$@" "$file" -done < "$(tmp "echo '$fx'")" - -# TODO: why are we using trashy at all, when trash-cli can do everything? -# try trashy first, trough nix because both trashy and trash-cli provide a trash command, which conflicts -nix run nixpkgs#trashy -- put "$@" 2> "$trash_output"; - -cat << EOF > "$expected_error_output"; -error: Error during a \`trash\` operation: Unknown { description: "Path: '\"/.Trash-1000\"'. Message: Permission denied (os error 13)" } -EOF - -if [ "$(cat "$expected_error_output")" = "$(cat "$trash_output")" ];then - warning "Deleting with trash-cli to the /.Trash folder"; - # this file could not be trashed because it is on the tempfs volume, trash-cli can do this this - trash-put "$@"; -fi -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/commands/scripts/unarchive b/home-manager/soispha/config/lf/commands/scripts/unarchive deleted file mode 100755 index ee97f3b1..00000000 --- a/home-manager/soispha/config/lf/commands/scripts/unarchive +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -# extract the current file with the right command -# (xkcd link: https://xkcd.com/1168/) -set -f -# TODO: add support for multiple files at once -case "$f" in - *.tar.bz|*.tar.bz2|*.tbz|*.tbz2) tar xjvf "$f";; - *.tar.gz|*.tgz) tar xzvf "$f";; - *.tar.xz|*.txz) tar xJvf "$f";; - *.zip) unzip "$f";; - *.rar) - die "rar is a unfree format!" - #unrar x $f - ;; - *.7z) 7z x "$f";; - *) die "Unsupported format" ;; -esac -# vim: ft=sh diff --git a/home-manager/soispha/config/lf/default.nix b/home-manager/soispha/config/lf/default.nix deleted file mode 100644 index ed037b05..00000000 --- a/home-manager/soispha/config/lf/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - pkgs, - sysLib, - nixosConfig, - shell_library, - lf_rename, - system, - ... -}: let - commands = import ./commands {inherit pkgs sysLib shell_library system lf_rename;}; - keybindings = import ./keybindings {inherit nixosConfig;}; -in { - xdg.configFile."lf/icons".source = ./icons; - xdg.configFile."lf/colors".source = ./colors; - - # TODO: add the systemd tempfile option here - - programs.lf = { - enable = true; - - inherit commands keybindings; - - previewer = { - keybinding = "i"; - source = "${pkgs.ctpv}/bin/ctpv"; - }; - settings = { - # TODO: this needs to be added to nixos: - #autoquit = true; # quit the server, if no clients are left - #dirpreviews = true; # preview for directories - - dircounts = true; # count things in directories TODO: this has performance impact - drawbox = true; - # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; - errorfmt = "\\033[1;91m%s\\033[0m"; - hidden = true; # show hidden files - icons = true; - ifs = "\\n"; # internal field separator for shell commands - #info = "size"; # show the size of a directory - shell = "sh"; - shellopts = "-eu"; # e: exit on error; u: error for unset variables - }; - # TODO: remove auto quit, if it has been added - extraConfig = '' - &${pkgs.ctpv}/bin/ctpv -s $id - cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id - set cleaner ${pkgs.ctpv}/bin/ctpvclear - - # close the server, after the last client exits - set autoquit true - ''; - }; -} diff --git a/home-manager/soispha/config/lf/icons b/home-manager/soispha/config/lf/icons deleted file mode 100644 index 7ef62a0b..00000000 --- a/home-manager/soispha/config/lf/icons +++ /dev/null @@ -1,357 +0,0 @@ -# vim:ft=conf - -# These examples require Nerd Fonts or a compatible font to be used. -# See https://www.nerdfonts.com for more information. - -# default values from lf (with matching order) -# ln l # LINK -# or l # ORPHAN -# tw t # STICKY_OTHER_WRITABLE -# ow d # OTHER_WRITABLE -# st t # STICKY -# di d # DIR -# pi p # FIFO -# so s # SOCK -# bd b # BLK -# cd c # CHR -# su u # SETUID -# sg g # SETGID -# ex x # EXEC -# fi - # FILE - -# file types (with matching order) -ln  # LINK -or  # ORPHAN -tw t # STICKY_OTHER_WRITABLE -ow  # OTHER_WRITABLE # nf-oct-file_directory -st t # STICKY -di  # DIR # nf-oct-file_directory -pi p # FIFO -so s # SOCK -bd b # BLK -cd c # CHR -su u # SETUID -sg g # SETGID -ex  # EXEC -fi  # FILE # nf-fa-file_text_o - -# file extensions (vim-devicons) -*.styl  -*.sass  -*.scss  -*.htm  -*.html  -*.slim  -*.haml  -*.ejs  -*.css  -*.less  -*.md  -*.mdx  -*.markdown  -*.rmd  -*.json  -*.webmanifest  -*.js  -*.mjs  -*.jsx  -*.rb  -*.gemspec  -*.rake  -*.php  -*.py  -*.pyc  -*.pyo  -*.pyd  -*.coffee  -*.mustache  -*.hbs  -*.conf  -*.ini  -*.yml  -*.yaml  -*.toml  -*.bat  -*.mk  -*.jpg  -*.jpeg  -*.bmp  -*.png  -*.webp  -*.gif  -*.ico  -*.twig  -*.cpp  -*.c++  -*.cxx  -*.cc  -*.cp  -*.c  -*.cs 󰌛 -*.h  -*.hh  -*.hpp  -*.hxx  -*.hs  -*.lhs  -*.nix  -*.lua  -*.java  -*.sh  -*.fish  -*.bash  -*.zsh  -*.ksh  -*.csh  -*.awk  -*.ps1  -*.ml λ -*.mli λ -*.diff  -*.db  -*.sql  -*.dump  -*.clj  -*.cljc  -*.cljs  -*.edn  -*.scala  -*.go  -*.dart  -*.xul  -*.sln  -*.suo  -*.pl  -*.pm  -*.t  -*.rss  -'*.f#'  -*.fsscript  -*.fsx  -*.fs  -*.fsi  -*.rs  -*.rlib  -*.d  -*.erl  -*.hrl  -*.ex  -*.exs  -*.eex  -*.leex  -*.heex  -*.vim  -*.ai  -*.psd  -*.psb  -*.ts  -*.tsx  -*.jl  -*.pp  -*.vue  -*.elm  -*.swift  -*.xcplayground  -*.tex 󰙩 -*.r 󰟔 -*.rproj 󰗆 -*.sol 󰡪 -*.pem  - -# file names (vim-devicons) (case-insensitive not supported in lf) -*gruntfile.coffee  -*gruntfile.js  -*gruntfile.ls  -*gulpfile.coffee  -*gulpfile.js  -*gulpfile.ls  -*mix.lock  -*dropbox  -*.ds_store  -*.gitconfig  -*.gitignore  -*.gitattributes  -*.gitlab-ci.yml  -*.bashrc  -*.zshrc  -*.zshenv  -*.zprofile  -*.vimrc  -*.gvimrc  -*_vimrc  -*_gvimrc  -*.bashprofile  -*favicon.ico  -*license  -*node_modules  -*react.jsx  -*procfile  -*dockerfile  -*docker-compose.yml  -*rakefile  -*config.ru  -*gemfile  -*makefile  -*cmakelists.txt  -*robots.txt 󰚩 - -# file names (case-sensitive adaptations) -*Gruntfile.coffee  -*Gruntfile.js  -*Gruntfile.ls  -*Gulpfile.coffee  -*Gulpfile.js  -*Gulpfile.ls  -*Dropbox  -*.DS_Store  -*LICENSE  -*React.jsx  -*Procfile  -*Dockerfile  -*Docker-compose.yml  -*Rakefile  -*Gemfile  -*Makefile  -*CMakeLists.txt  - -# file patterns (vim-devicons) (patterns not supported in lf) -# .*jquery.*\.js$  -# .*angular.*\.js$  -# .*backbone.*\.js$  -# .*require.*\.js$  -# .*materialize.*\.js$  -# .*materialize.*\.css$  -# .*mootools.*\.js$  -# .*vimrc.*  -# Vagrantfile$  - -# file patterns (file name adaptations) -*jquery.min.js  -*angular.min.js  -*backbone.min.js  -*require.min.js  -*materialize.min.js  -*materialize.min.css  -*mootools.min.js  -*vimrc  -Vagrantfile  - -# archives or compressed (extensions from dircolors defaults) -*.tar  -*.tgz  -*.arc  -*.arj  -*.taz  -*.lha  -*.lz4  -*.lzh  -*.lzma  -*.tlz  -*.txz  -*.tzo  -*.t7z  -*.zip  -*.z  -*.dz  -*.gz  -*.lrz  -*.lz  -*.lzo  -*.xz  -*.zst  -*.tzst  -*.bz2  -*.bz  -*.tbz  -*.tbz2  -*.tz  -*.deb  -*.rpm  -*.jar  -*.war  -*.ear  -*.sar  -*.rar  -*.alz  -*.ace  -*.zoo  -*.cpio  -*.7z  -*.rz  -*.cab  -*.wim  -*.swm  -*.dwm  -*.esd  - -# image formats (extensions from dircolors defaults) -*.jpg  -*.jpeg  -*.mjpg  -*.mjpeg  -*.gif  -*.bmp  -*.pbm  -*.pgm  -*.ppm  -*.tga  -*.xbm  -*.xpm  -*.tif  -*.tiff  -*.png  -*.svg  -*.svgz  -*.mng  -*.pcx  -*.mov  -*.mpg  -*.mpeg  -*.m2v  -*.mkv  -*.webm  -*.ogm  -*.mp4  -*.m4v  -*.mp4v  -*.vob  -*.qt  -*.nuv  -*.wmv  -*.asf  -*.rm  -*.rmvb  -*.flc  -*.avi  -*.fli  -*.flv  -*.gl  -*.dl  -*.xcf  -*.xwd  -*.yuv  -*.cgm  -*.emf  -*.ogv  -*.ogx  - -# audio formats (extensions from dircolors defaults) -*.aac  -*.au  -*.flac  -*.m4a  -*.mid  -*.midi  -*.mka  -*.mp3  -*.mpc  -*.ogg  -*.ra  -*.wav  -*.oga  -*.opus  -*.spx  -*.xspf  - -# other formats -*.pdf  diff --git a/home-manager/soispha/config/lf/keybindings/default.nix b/home-manager/soispha/config/lf/keybindings/default.nix deleted file mode 100644 index ab34d7d4..00000000 --- a/home-manager/soispha/config/lf/keybindings/default.nix +++ /dev/null @@ -1,127 +0,0 @@ -{nixosConfig, ...}: { - # Remove some defaults - m = null; - "\"'\"" = null; - "'\"'" = null; - d = null; - c = null; - e = null; - j = null; - k = null; - l = null; - ";" = null; - - # File Openers - ee = "\$\$EDITOR \"$f\""; - es = "\$ nvim -S \"$f\""; - u = "%\$IVIEWER \"$f\""; - cc = "\$sudo -e \"$f\""; - - # Archive Mappings - au = "unarchive"; - aa = "archive"; - - # Trash Mappings - dd = "trash"; - jc = "clear_trash"; - jr = "restore_trash"; - - # Broot Mapping - f = "fzf_jump"; - - # Dragon Mapping - dr = "dragon"; - ds = "dragon-stay"; - di = "dragon-individual"; - #dm = "mvdragon"; - #dc = "cpdragon"; - dl = "dlfile"; - - cs = "stripspace"; - - # Vim keys - h = "updir"; - t = "down"; - n = "up"; - s = "open"; - - # Basic Functions - "." = "set hidden!"; - DD = "delete"; - p = "paste"; - x = "cut"; - y = "copy"; - "" = "open"; - - mk = "mk_ln"; - mf = "mk_file"; - me = "mk_file_and_edit"; - md = "mk_dir"; - ms = "mk_scr_default"; - mt = "mk_scr_temp"; - - ch = "chmod"; - bg = "set_wall_paper"; - o = "open_config"; - r = "rename"; - H = "go_project_base_directory"; - L = "bottom"; - R = "reload"; - C = "clear"; - U = "unselect"; - - # Movement - gjr = "cd ~/.local/share/Trash/files"; - gus = "cd /run/user/${builtins.toString nixosConfig.users.users.soispha.uid}"; - - "gr." = "cd ~/repos"; - grn = "cd ~/repos/nix"; - grcc = "cd ~/repos/c"; - grcp = "cd ~/repos/cpp"; - grl = "cd ~/repos/lua"; - grr = "cd ~/repos/rust"; - grs = "cd ~/repos/shell"; - grjs = "cd ~/repos/java_script"; - grmd = "cd ~/repos/mark_down"; - grty = "cd ~/repos/typst"; - grte = "cd ~/repos/tex"; - grj = "cd ~/repos/java"; - gra = "cd ~/repos/awk"; - grpy = "cd ~/repos/python"; - grpe = "cd ~/repos/perl"; - grahk = "cd ~/repos/auto_hot_key"; - grh = "cd ~/repos/html"; - # ------------- - "gm." = "cd ~/media"; - gmp = "cd ~/media/pictures"; - gmd = "cd ~/media/downloads"; - gmm = "cd ~/media/music"; - gmi = "cd ~/media/isos"; - # ------------- - "gs." = "cd ~/school"; - gsi = "cd ~/school/infomatik"; - gsc = "cd ~/school/chemie"; - gse = "cd ~/school/english"; - gsgo = "cd ~/school/geographie"; - gsgs = "cd ~/school/geschichte"; - gskr = "cd ~/school/katholische_religion"; - gsmu = "cd ~/school/musik"; - gsma = "cd ~/school/mathematik"; - gsl = "cd ~/school/latein"; - gsd = "cd ~/school/deutsch"; - gsb = "cd ~/school/biologie"; - gsso = "cd ~/school/sozialkunde"; - gssp = "cd ~/school/sport"; - gspy = "cd ~/school/physik"; - gspi = "cd ~/school/philosophie"; - # ------------- - - gc = "cd ~/.config"; - gl = "cd ~/.local"; - gE = "cd /etc"; - - "gU." = "cd /usr"; - gUs = " cd /usr/share"; - - gt = "cd /tmp"; -} diff --git a/home-manager/soispha/config/mail/default.nix b/home-manager/soispha/config/mail/default.nix deleted file mode 100644 index 475bcacf..00000000 --- a/home-manager/soispha/config/mail/default.nix +++ /dev/null @@ -1,64 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - non_public_accounts = import ./non_public_accounts.nix {inherit pkgs;}; - accounts = lib.recursiveUpdate {inherit soispha;} non_public_accounts; - - soispha = { - address = "soispha@vhack.eu"; - userName = "soispha@vhack.eu"; - realName = "Soispha"; - primary = true; - passwordCommand = "${pkgs.libsecret}/bin/secret-tool lookup account soispha@vhack.eu"; - aliases = [ - "admin@vhack.eu" - ]; - folders = { - }; - gpg = { - encryptByDefault = true; - key = "9606FC749FCE16360723D4ADA5E94010C3A642AD"; - signByDefault = true; - }; - signature = { - # TODO: - }; - neomutt = { - enable = true; - }; - mbsync = { - enable = true; - create = "both"; - }; - himalaya = { - enable = true; - backend = "imap"; - sender = "smtp"; - settings = { - # TODO: - }; - }; - smtp = { - host = "server1.vhack.eu"; - port = 465; - }; - imap = { - host = "server1.vhack.eu"; - port = 993; - }; - jmap = { - # TODO: - }; - maildir = { - path = "soispha"; - }; - }; -in { - accounts.email = { - maildirBasePath = "${config.xdg.dataHome}/maildir"; - inherit accounts; - }; -} diff --git a/home-manager/soispha/config/mail/non_public_accounts.nix b/home-manager/soispha/config/mail/non_public_accounts.nix deleted file mode 100644 index 0076aebd..00000000 Binary files a/home-manager/soispha/config/mail/non_public_accounts.nix and /dev/null differ diff --git a/home-manager/soispha/config/mako/default.nix b/home-manager/soispha/config/mako/default.nix deleted file mode 100644 index 711457f2..00000000 --- a/home-manager/soispha/config/mako/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - pkgs, - ... -}: { - services.mako = { - enable = true; - backgroundColor = "#2e3440"; - borderColor = "#88c0d0"; - borderRadius = 25; - borderSize = 2; - defaultTimeout = 5000; - font = "Source Code Pro 10"; - width = 500; - height = 500; - icons = true; - ignoreTimeout = true; - layer = "overlay"; - markup = true; # TODO: - maxIconSize = 64; - sort = "-time"; - extraConfig = '' - [urgency=low] - border-color=#cccccc - - [urgency=normal] - border-color=#d08770 - - [urgency=high] - border-size=3 - border-color=#bf616a - default-timeout=0 - - [urgency=critical] - border-size=4 - border-color=#bf616a - default-timeout=0 - - [category=mpd] - default-timeout=2000 - group-by=category - ''; - }; -} diff --git a/home-manager/soispha/config/mbsync/default.nix b/home-manager/soispha/config/mbsync/default.nix deleted file mode 100644 index ac9808c9..00000000 --- a/home-manager/soispha/config/mbsync/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - config, - lib, - ... -}: { - # TODO: I have no clue if both are needed, but it looks neat, right? - programs.mbsync = { - enable = true; - }; - services.mbsync = { - enable = true; - # TODO: enable after isync 1.5 drops - #configFile = "${config.xdg.configHome}/mbsync/mbsync.conf"; - }; - # Disable the timer, and only activate it on neomutt start - systemd.user.timers.mbsync = lib.mkForce {}; -} diff --git a/home-manager/soispha/config/mpd/default.nix b/home-manager/soispha/config/mpd/default.nix deleted file mode 100644 index bbd345a7..00000000 --- a/home-manager/soispha/config/mpd/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - config, - pkgs, - lib, - osConfig, - ... -}: let - dataDir = "${config.xdg.dataHome}/mpd"; - playlistDirectory = "${dataDir}/playlists"; - runtimeDir = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd"; -in { - systemd.user.services.mpd.Service.ExecStartPre = lib.mkForce '' - ${pkgs.coreutils}/bin/mkdir -p "${dataDir}" "${playlistDirectory}" "${runtimeDir}" - ''; - services.mpd = { - enable = true; - inherit dataDir; - musicDirectory = "~/media/music"; - network = { - listenAddress = "${runtimeDir}/socket"; - }; - extraConfig = '' - metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc,comment" - auto_update "yes" - - audio_output { - type "pipewire" - name "pipewire" - } - #database { - # plugin "simple" - # path "~/.local/share/mpd/db - # cache_directory "~/.local/share/mpd/cache" - #} - - filesystem_charset "UTF-8" - ''; - }; -} diff --git a/home-manager/soispha/config/mpd/mpdconf.example b/home-manager/soispha/config/mpd/mpdconf.example deleted file mode 100644 index eaa5e641..00000000 --- a/home-manager/soispha/config/mpd/mpdconf.example +++ /dev/null @@ -1,418 +0,0 @@ -# An example configuration file for MPD. -# Read the user manual for documentation: http://www.musicpd.org/doc/user/ - - -# Files and directories ####################################################### -# -# This setting controls the top directory which MPD will search to discover the -# available audio files and add them to the daemon's online database. This -# setting defaults to the XDG directory, otherwise the music directory will be -# be disabled and audio files will only be accepted over ipc socket (using -# file:// protocol) or streaming files over an accepted protocol. -# -#music_directory "~/music" -# -# This setting sets the MPD internal playlist directory. The purpose of this -# directory is storage for playlists created by MPD. The server will use -# playlist files not created by the server but only if they are in the MPD -# format. This setting defaults to playlist saving being disabled. -# -#playlist_directory "~/.mpd/playlists" -# -# This setting sets the location of the MPD database. This file is used to -# load the database at server start up and store the database while the -# server is not up. This setting defaults to disabled which will allow -# MPD to accept files over ipc socket (using file:// protocol) or streaming -# files over an accepted protocol. -# -#db_file "~/.mpd/database" - -# These settings are the locations for the daemon log files for the daemon. -# -# The special value "syslog" makes MPD use the local syslog daemon. This -# setting defaults to logging to syslog. -# -# If you use systemd, do not configure a log_file. With systemd, MPD -# defaults to the systemd journal, which is fine. -# -#log_file "~/.mpd/log" - -# This setting sets the location of the file which stores the process ID -# for use of mpd --kill and some init scripts. This setting is disabled by -# default and the pid file will not be stored. -# -# If you use systemd, do not configure a pid_file. -# -#pid_file "~/.mpd/pid" - -# This setting sets the location of the file which contains information about -# most variables to get MPD back into the same general shape it was in before -# it was brought down. This setting is disabled by default and the server -# state will be reset on server start up. -# -#state_file "~/.mpd/state" -# -# The location of the sticker database. This is a database which -# manages dynamic information attached to songs. -# -#sticker_file "~/.mpd/sticker.sql" -# -############################################################################### - - -# General music daemon options ################################################ -# -# This setting specifies the user that MPD will run as. MPD should never run as -# root and you may use this setting to make MPD change its user ID after -# initialization. This setting is disabled by default and MPD is run as the -# current user. -# -#user "nobody" -# -# This setting specifies the group that MPD will run as. If not specified -# primary group of user specified with "user" setting will be used (if set). -# This is useful if MPD needs to be a member of group such as "audio" to -# have permission to use sound card. -# -#group "nogroup" -# -# This setting sets the address for the daemon to listen on. Careful attention -# should be paid if this is assigned to anything other than the default, any. -# This setting can deny access to control of the daemon. Not effective if -# systemd socket activation is in use. -# -# For network -#bind_to_address "any" -# -# And for Unix Socket -#bind_to_address "~/.mpd/socket" -# -# This setting is the TCP port that is desired for the daemon to get assigned -# to. -# -#port "6600" -# -# Suppress all messages below the given threshold. Use "verbose" for -# troubleshooting. Available setting arguments are "notice", "info", "verbose", -# "warning" and "error". -# -#log_level "notice" -# -# Setting "restore_paused" to "yes" puts MPD into pause mode instead -# of starting playback after startup. -# -#restore_paused "no" -# -# This setting enables MPD to create playlists in a format usable by other -# music players. -# -#save_absolute_paths_in_playlists "no" -# -# This setting defines a list of tag types that will be extracted during the -# audio file discovery process. The complete list of possible values can be -# found in the user manual. -#metadata_to_use "artist,album,title,track,name,genre,date,composer,performer,disc" -# -# This example just enables the "comment" tag without disabling all -# the other supported tags: -#metadata_to_use "+comment" -# -# This setting enables automatic update of MPD's database when files in -# music_directory are changed. -# -#auto_update "yes" -# -# Limit the depth of the directories being watched, 0 means only watch -# the music directory itself. There is no limit by default. -# -#auto_update_depth "3" -# -############################################################################### - - -# Symbolic link behavior ###################################################### -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links outside of the configured music_directory. -# -#follow_outside_symlinks "yes" -# -# If this setting is set to "yes", MPD will discover audio files by following -# symbolic links inside of the configured music_directory. -# -#follow_inside_symlinks "yes" -# -############################################################################### - - -# Zeroconf / Avahi Service Discovery ########################################## -# -# If this setting is set to "yes", service information will be published with -# Zeroconf / Avahi. -# -#zeroconf_enabled "yes" -# -# The argument to this setting will be the Zeroconf / Avahi unique name for -# this MPD server on the network. %h will be replaced with the hostname. -# -#zeroconf_name "Music Player @ %h" -# -############################################################################### - - -# Permissions ################################################################# -# -# If this setting is set, MPD will require password authorization. The password -# setting can be specified multiple times for different password profiles. -# -#password "password@read,add,control,admin" -# -# This setting specifies the permissions a user has who has not yet logged in. -# -#default_permissions "read,add,control,admin" -# -############################################################################### - - -# Database ####################################################################### -# -# An example of a database section instead of the old 'db_file' setting. -# It enables mounting other storages into the music directory. -# -#database { -# plugin "simple" -# path "~/.local/share/mpd/db -# cache_directory "~/.local/share/mpd/cache" -#} -# -# An example of database config for a satellite setup -# -#music_directory "nfs://fileserver.local/srv/mp3" -#database { -# plugin "proxy" -# host "other.mpd.host" -# port "6600" -#} - -# Input ####################################################################### -# -input { - plugin "curl" -# proxy "proxy.isp.com:8080" -# proxy_user "user" -# proxy_password "password" -} - -# -############################################################################### - -# Audio Output ################################################################ -# -# MPD supports various audio output types, as well as playing through multiple -# audio outputs at the same time, through multiple audio_output settings -# blocks. Setting this block is optional, though the server will only attempt -# autodetection for one sound card. -# -# An example of an ALSA output: -# -#audio_output { -# type "alsa" -# name "My ALSA Device" -## device "hw:0,0" # optional -## mixer_type "hardware" # optional -## mixer_device "default" # optional -## mixer_control "PCM" # optional -## mixer_index "0" # optional -#} -# -# An example of an OSS output: -# -#audio_output { -# type "oss" -# name "My OSS Device" -## device "/dev/dsp" # optional -## mixer_type "hardware" # optional -## mixer_device "/dev/mixer" # optional -## mixer_control "PCM" # optional -#} -# -# An example of a shout output (for streaming to Icecast): -# -#audio_output { -# type "shout" -# encoder "vorbis" # optional -# name "My Shout Stream" -# host "localhost" -# port "8000" -# mount "/mpd.ogg" -# password "hackme" -# quality "5.0" -# bitrate "128" -# format "44100:16:1" -## protocol "icecast2" # optional -## user "source" # optional -## description "My Stream Description" # optional -## url "http://example.com" # optional -## genre "jazz" # optional -## public "no" # optional -## timeout "2" # optional -## mixer_type "software" # optional -#} -# -# An example of a recorder output: -# -#audio_output { -# type "recorder" -# name "My recorder" -# encoder "vorbis" # optional, vorbis or lame -# path "/var/lib/mpd/recorder/mpd.ogg" -## quality "5.0" # do not define if bitrate is defined -# bitrate "128" # do not define if quality is defined -# format "44100:16:1" -#} -# -# An example of a httpd output (built-in HTTP streaming server): -# -#audio_output { -# type "httpd" -# name "My HTTP Stream" -# encoder "vorbis" # optional, vorbis or lame -# port "8000" -# bind_to_address "0.0.0.0" # optional, IPv4 or IPv6 -## quality "5.0" # do not define if bitrate is defined -# bitrate "128" # do not define if quality is defined -# format "44100:16:1" -# max_clients "0" # optional 0=no limit -#} -# -# An example of a pulseaudio output (streaming to a remote pulseaudio server) -# -#audio_output { -# type "pulse" -# name "My Pulse Output" -## server "remote_server" # optional -## sink "remote_server_sink" # optional -## media_role "media_role" #optional -#} -# -# An example of a winmm output (Windows multimedia API). -# -#audio_output { -# type "winmm" -# name "My WinMM output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -# or -## device "0" # optional -## mixer_type "hardware" # optional -#} -# -# An example of a wasapi output (Windows multimedia API). -# -#audio_output { -# type "wasapi" -# name "My WASAPI output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -# or -## device "0" # optional -## Exclusive mode blocks all other audio source, and get best audio quality without resampling. -## exclusive "no" # optional -## Enumerate all devices in log. -## enumerate "no" # optional -#} -# -# An example of an openal output. -# -#audio_output { -# type "openal" -# name "My OpenAL output" -## device "Digital Audio (S/PDIF) (High Definition Audio Device)" # optional -#} -# -# An example of an sndio output. -# -#audio_output { -# type "sndio" -# name "sndio output" -# mixer_type "hardware" -#} -# -# An example of an OS X output: -# -#audio_output { -# type "osx" -# name "My OS X Device" -## device "Built-in Output" # optional -## channel_map "-1,-1,0,1" # optional -#} -# -## Example "pipe" output: -# -#audio_output { -# type "pipe" -# name "my pipe" -# command "aplay -f cd 2>/dev/null" -## Or if you're want to use AudioCompress -# command "AudioCompress -m | aplay -f cd 2>/dev/null" -## Or to send raw PCM stream through PCM: -# command "nc example.org 8765" -# format "44100:16:2" -#} -# -## An example of a null output (for no audio output): -# -#audio_output { -# type "null" -# name "My Null Output" -# mixer_type "none" # optional -#} -# -############################################################################### - - -# Normalization automatic volume adjustments ################################## -# -# This setting specifies the type of ReplayGain to use. This setting can have -# the argument "off", "album", "track" or "auto". "auto" is a special mode that -# chooses between "track" and "album" depending on the current state of -# random playback. If random playback is enabled then "track" mode is used. -# See for -# more details about ReplayGain. -# This setting is off by default. -# -#replaygain "album" -# -# This setting sets the pre-amp used for files that have ReplayGain tags. By -# default this setting is disabled. -# -#replaygain_preamp "0" -# -# This setting sets the pre-amp used for files that do NOT have ReplayGain tags. -# By default this setting is disabled. -# -#replaygain_missing_preamp "0" -# -# This setting enables or disables ReplayGain limiting. -# MPD calculates actual amplification based on the ReplayGain tags -# and replaygain_preamp / replaygain_missing_preamp setting. -# If replaygain_limit is enabled MPD will never amplify audio signal -# above its original level. If replaygain_limit is disabled such amplification -# might occur. By default this setting is enabled. -# -#replaygain_limit "yes" -# -# This setting enables on-the-fly normalization volume adjustment. This will -# result in the volume of all playing audio to be adjusted so the output has -# equal "loudness". This setting is disabled by default. -# -#volume_normalization "no" -# -############################################################################### - -# Character Encoding ########################################################## -# -# If file or directory names do not display correctly for your locale then you -# may need to modify this setting. -# -#filesystem_charset "UTF-8" -# -############################################################################### diff --git a/home-manager/soispha/config/mpv/default.nix b/home-manager/soispha/config/mpv/default.nix deleted file mode 100644 index 1e10f2ef..00000000 --- a/home-manager/soispha/config/mpv/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - config, - pkgs, - ... -}: { - programs.mpv = { - enable = true; - # TODO: add config - }; -} diff --git a/home-manager/soispha/config/mumble/Mumble.conf b/home-manager/soispha/config/mumble/Mumble.conf deleted file mode 100644 index 2d895f41..00000000 --- a/home-manager/soispha/config/mumble/Mumble.conf +++ /dev/null @@ -1,67 +0,0 @@ -[General] -databaselocation=/home/soispha/.local/share/Mumble/Mumble/mumble.sqlite -lastupdate=3 - -[audio] -headphone=true -input=PipeWire -loudness=1549 -output=PipeWire -quality=72000 -vadmax=@Variant(\0\0\0\x87?Kw\x97) -vadmin=@Variant(\0\0\0\x87?7\x1e\xd4) - -[messages] -10\log=13 -12\log=13 -14\log=13 -15\log=13 -17\log=13 -18\log=13 -19\log=13 -2\log=13 -20\log=13 -21\log=13 -22\log=13 -23\log=13 -25\log=13 -26\log=13 -27\log=13 -28\log=13 -29\log=13 -30\log=13 -31\log=13 -5\log=13 -6\log=13 -9\log=13 -size=32 - -[messagesounds] -size=31 - -[net] -certificate="@ByteArray(0\x82\tX\x2\x1\x3\x30\x82\t\xe\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\b\xff\x4\x82\b\xfb\x30\x82\b\xf7\x30\x82\x3\xad\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x3\x9e\x4\x82\x3\x9a\x30\x82\x3\x96\x30\x82\x3\x92\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x3\xa0\x82\x3+0\x82\x3'\x6\n*\x86H\x86\xf7\r\x1\t\x16\x1\xa0\x82\x3\x17\x4\x82\x3\x13\x30\x82\x3\xf\x30\x82\x1\xf7\xa0\x3\x2\x1\x2\x2\x1\x1\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x30\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x1e\x17\r230710132716Z\x17\r430705132716Z0\x16\x31\x14\x30\x12\x6\x3U\x4\x3\f\vMumble User0\x82\x1\"0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x3\x82\x1\xf\0\x30\x82\x1\n\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\xa3h0f0\f\x6\x3U\x1d\x13\x1\x1\xff\x4\x2\x30\0\x30\x13\x6\x3U\x1d%\x4\f0\n\x6\b+\x6\x1\x5\x5\a\x3\x2\x30\x1d\x6\x3U\x1d\xe\x4\x16\x4\x14\xb9\x41\x19t\x16\x18~\xe8\v\xa9\x9b\x86i\x86\xeP%\xd7\n\xc9\x30\"\x6\t`\x86H\x1\x86\xf8\x42\x1\r\x4\x15\x16\x13Generated by Mumble0\r\x6\t*\x86H\x86\xf7\r\x1\x1\x5\x5\0\x3\x82\x1\x1\0\x91+\r'hS\xc2\x12k\x13O\xb2\"\x85\xd6w\x96\x8a\x97\x46\xee\x95Q\x8b\x8b\t\x8a\xfcH\xab\x30\x1dxV\xc9\xf5\x80\x42;'o\xf1\xd1\xf2\xfb\x18\xe2+\x8d\x39 \xc3\xe\x44\xa9\t\xe2i\x8a\xa7?#\xcd]0\xf4\x1d\x4\a\xd6\x87\x62\xe2\xd8\x34\xb6\xcf\x89\xf2\v\xf1\x8b\xc6\xf8\x8f\x94H/\xfa`\x9d\xb5\xac\x66H\xef\xf4\tJ\xfeHg]!\xed\n\xaf\xa8nd@y\xe8>A\x10\xc4>\xc3\xf7\xe3\xffW\x90T\x87\x94[\x7fg0+p\xdd\x3\x8d\xdb\x80\f?\xe9\xf9l5\xac)z+4R\xbc\xf3\xe1\x82\xde\xc3u\xb2\xa1s\xe2\xbb\xdcpL#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0\x82\x5\x42\x6\t*\x86H\x86\xf7\r\x1\a\x1\xa0\x82\x5\x33\x4\x82\x5/0\x82\x5+0\x82\x5'\x6\v*\x86H\x86\xf7\r\x1\f\n\x1\x1\xa0\x82\x4\xc0\x30\x82\x4\xbc\x2\x1\0\x30\r\x6\t*\x86H\x86\xf7\r\x1\x1\x1\x5\0\x4\x82\x4\xa6\x30\x82\x4\xa2\x2\x1\0\x2\x82\x1\x1\0\xb3\x8c\xd2\xdbM\x90\xa6\xc7}\xf4\x6X\xf9O\x16Q\x12\xc7\x1\xca\x88\x9c\x96o\xd1\x11\xc1\xc3\xd1/\xb6\x9d\xcfn\xcd\x84\xd2\x1d\xcc\xfcO\xf9\xa4\"\xaa'2\x6\xee[\x3\xd3vx\x84`i@P|\xb8\xc5I\xa8\xa2\b\xc8\0\xbd\xf1\xcc\x63\xbe\x99Zj&\xa5t\xc5\bOr\xc1\xaen\xc7\n\xd2\xcc\xa1\x30\xb8\xe0\0\xe8\xc5\xb6\x86g\x14\x30S\x9d\x8b\xfb\xacP\x7f+\x93}3\xe3\xcbPJ\x86\xf7^Z\xda\x87Z\xfez\xec\xc0\xf7\xe9\x80\xbc\xe2\re@\xe7\x92\x84\xe5\x97\f\x8c\n\x3\x1c\xd1\xbb\x32\xce\xfe\xb6\x1d\xefUYz\xf\xd7,5\x4G\x1f\t\xf7\x43\f?wx\x1a\x12\xd4.I\xbd\xe4G\xea\x33\x9d\xb1\xb0\x62\x45\xcd\xe0\x8b\xe4\x31\x1a\x8c\xedLEyC\xf0\x9f\x32}c\xc9X\x19[\xf7\xfb\xfc\x39\xe0\xd5\x30\x87\xd0\x82:\xb5\x87j]\x9d\xf8\x1b\x4\xb2P \x5/\xb2H\xfa\x42I\x1dN\xa9\xb7\x9a\x91*\x83\xe\x45\xcf\xbe\t\xb5\x36)\xf7\x7f\x1\x43\x2\x3\x1\0\x1\x2\x82\x1\0\x4\xd6\xf2\x66\v\xe0\xae\xc6(\xccw\x91Ub\xfe\xd8\x7f\x97\x92\xa2Imc\x16\xaf}y\x8a\x14,\xe3\x90\xbc\x63!\xb2\aQ\xdbQ\x1f\xbc\xbc\x62\\\xd0\xc2\xa5\xf2-\xcc\xdc\x19\xd0\xe4\xcc\x8ey\xb7\xd1\xac\xcfP\x8du\x94\xa4\x3u\x1b;\xe5\xa2\x61\x12\xd1R\xaaZ\v\xe7\x8d\xf0\xabl\xce\xba\x99\xbd\x95\xdbpkCJr\xfb\xc5P9\x1e\xf\xb1iI9&\xeb\x62\x8a#\xa7\x17\xcbw\x92\xf9\xf7JZ\xa6;F\xb3\xba\xb1H\x89]uU7\x1e\xd7\xf6U`\x8d\xa1\x1aG7\x11\x31\xbf\xf4\xdb\x32\x63\xbf\x3\xad&h\x82\x9b\xe7\x19/\xf6\r\x8c\x89\xc6\xd0\x1d\0\x87\t|\xc0\xf2\x8f\xbb\x87_8{\xf2\xc7\x8a\x34)\xe3\xf1\xcc(\xf4\xee\xeb($\x5\x84\xaf\x1\xaa\xf7\xff\x9b\x15h\x2y\xb3\x91\xba,Oq\xc9$\x81\x11Zg\xc4I3\v\xeay\f\xf0\x33\xc6p\xea\xc6\x9d\xac\xaa\xedp\xa7!\xcbHf5\xa0i\xbdo@\xb8![\x7f\xea\xad\x6\x31p\x81\x61\x2\x81\x81\0\xdc\x8d}{\xc3\x31\xb6(F\xc5\x36\x9b\xba\x66\xb1\xce\r_\x90\xc6\x1f\x87\x37\x84m\xd1\a8\xc0\v9\xe0\x8bm\xaf\x64\xbe\x81\xa8\xe7\xaf\x19\x43,vj\xaf!9rz\x87\"\xca\xbf\xcf\x16\x88\x46t\xbd\x12\xaa;\xf4x_\x1b\xb3\x90\b\xb6\xf6\xec\x1f\x95\x62\xac\xfa\x1b\xae\xa2\xa7oA\x9bhOW\xa8\x44\\\xadz T\xe3\x43\x46\x99\x98\xb4{*\"\xdb\xd9\xc8\xd2\x15\n4\"\x8d\x96$\x17\xfd^\xf7\x84\x93\x7fw{o\0\xe1\x2\x81\x81\0\xd0hNA\xc3\x9e\x93&iq\x1dQ\xb6\xc6\x1c\x32\xf3\xfc c&Y\xe7|\xbeq2P\xe1\xdb\x97\xf8\x9fI(\x98\x9d\xf1\xfe\xb6\xf\x90\xa5\xebi>\x14\x6\xd8.\xf4\xce\x86\x9d*\x87 \xf9X\x4\xdcZ\xf9g\x3\x98H{\xdf\x66\xde\xd6zr\xecG_\x14t\x1dm%P\xe5\xea\x8e\x6\xa2. \xa1\xd7\xd7W]\xdd\x15\x6\xcf+/\x11\vel\xd3\xe8\xc3/\xbc\x1f\xc3n\xd4\xb8\x62j\xf5\xc0\xc0\x89\xe3z\xb8\x36\xd5\xb2\xa3\x2\x81\x80z`W\xdc\x30\x36\x89(W\xfc]\x8c\x93% K\x80\xc8\"\0\x8c\xc5\xee\\ \xc2\xf7\n\xda$`|\xe3`}\r\x9dWV\xa8\0\xc9\xcd\xd2\xc4\f\xe4\x8d%k+\x16\xbc.\n\xf7\x44\x9d\xd6\xfc\x1a\x88\x8a\xdd\x11J\xd9\xc4%\xe6g\xd8\xbc.\xe2\x11/J\x81\x2\x81\x80\x63;W\xf\xbf:1,\x98\x6\x31\x4\xa8wz\x13\xd4\xd2\x97\x5>\xcc\x8e\tz\x90\x61y\xdb\xa0\xf8\xa2|\r\x94\x93\xde\x98\xcc\x44\x19\xf3\x30\xdd\x7fu\xfc\x89)\xc4i\xf2\x30l\x83\x44\x66\x31\xf3t\x15\f\b6\xc1\xa2o\xd8\xf3\x8d\x82\xcb\x32\xf0\xa7\x8ap>G\xef~\xf9\xc6\xa4\x42\xe3\xafJ\xe7\x95\xc8\x1a\x2\xc1\xe9\xc2\x8b\xf1{\x11?\xce\xe8\xd3\x39WI<.\xedo^Y\xd6U\x99\x1e\xfe\xb6\xf1\xb6v'\a\xb1\xac\\\xeb\x2\x81\x80@\x19\xc4\x32&\xcb\xc1\xca\x10K\xdf\x45\xf9\xf\x1d\x85\x39\x65\xdc\x33\x45\xbe\xac\x97~;\xe2m-\xd6\x9b\x82\x1\xbd\x90'W\xf5\xf5\xce\x35\xd7\xb4\xcdidTiP\\-vG+`\xb5u\xb7\x14\x44\xe1\xd9\xd3\r\x81\xb0GL\xe1U\xe3\xf0\xaa\xd1\x8f\xc6\"\xa5S\xb6\xbf\x4\x1a\xc4\xe0|\x8d\xa2+y(-\xad\ty\xd5\xe2g\xd3\x8c\xcdl\x96g3\xfe\x80\xb7|b[\xca\xb2\xbf\x61\xf7\x9c\x65\x30\x61\xa0\x35\xf6W\xb4\xcc\xdd\x34\x31T0#\x6\t*\x86H\x86\xf7\r\x1\t\x15\x31\x16\x4\x14\x9f\xdc\xf9\x38\xc2\x8a\x1c\xfe\x6}\xf6\x64\x62>L#|\f\x7f\x93\x30-\x6\t*\x86H\x86\xf7\r\x1\t\x14\x31 \x1e\x1e\0M\0u\0m\0\x62\0l\0\x65\0 \0I\0\x64\0\x65\0n\0t\0i\0t\0y0A010\r\x6\t`\x86H\x1\x65\x3\x4\x2\x1\x5\0\x4 Fm\xb6/lL\x18\x1b!\xfa+x\xb5\xd9?GrR\xb7\xd3\x90\xc1N)L\x9c\xc7')\xe^\xbe\x4\b\x8b\x2\xb2\xb2\x97\b\x8a\xf6\x2\x2\b\0)" -framesperpacket=1 - -[overlay] -blacklist=@Invalid() -blacklistexclude=@Invalid() -launchers=@Invalid() -launchersexclude=@Invalid() -paths=@Invalid() -pathsexclude=@Invalid() -version=1.4.0 -whitelist=@Invalid() -whitelistexclude=@Invalid() - -[shortcuts] -size=0 - -[ui] -HighContrast=true -connect\geometry="@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\f=\0\0\x1m)" -connect\header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2&\0\0\0\x3\x1\x1\0\0\0\0\0\0\x1\0\0\0\x2\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x3\0\0\x1w\0\0\0\x1\0\0\0\x1\0\0\0S\0\0\0\x1\0\0\0\x3\0\0\0\\\0\0\0\x1\0\0\0\x3\0\0\x3\xe8\0\0\0\0\x64) -geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa\0\0\n\0\0\0\0\0\0\0\f\xde\0\0\x1\xb2\0\0\0\x1\x2\0\0\0\a\x80\0\0\n\0\0\0\0\0\0\0\r\xb9\0\0\x3\xfa) -header=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x2\xb0\0\0\0\x1\x1\0\0\x1\0\0\0\0\0\0\0\0\0\0\0\0\x64\xff\xff\xff\xff\0\0\0\x81\0\0\0\0\0\0\0\x1\0\0\x2\xb0\0\0\0\x1\0\0\0\0\0\0\x3\xe8\0\0\0\0\x64) -server=mumble.vhack.eu -state=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x1\0\0\0\0\0\0\x1\0\0\0\x3\xbd\xfc\x2\0\0\0\x2\xfb\0\0\0\f\0q\0\x64\0w\0L\0o\0g\x1\0\0\0>\0\0\x3\xa0\0\0\0z\0\xff\xff\xff\xfb\0\0\0\xe\0q\0\x64\0w\0\x43\0h\0\x61\0t\x1\0\0\x3\xe2\0\0\0\x19\0\0\0\x19\0\0\0\x19\0\0\x2\xb6\0\0\x3\xbd\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\x1a\0q\0t\0I\0\x63\0o\0n\0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) diff --git a/home-manager/soispha/config/mumble/default.nix b/home-manager/soispha/config/mumble/default.nix deleted file mode 100644 index 6fa524dc..00000000 --- a/home-manager/soispha/config/mumble/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - xdg.configFile."Mumble/Mumble.conf".source = ./Mumble.conf; -} diff --git a/home-manager/soispha/config/neomutt/default.nix b/home-manager/soispha/config/neomutt/default.nix deleted file mode 100644 index e4fbcb39..00000000 --- a/home-manager/soispha/config/neomutt/default.nix +++ /dev/null @@ -1,168 +0,0 @@ -{pkgs, ...}: { - programs.neomutt = { - enable = true; - package = pkgs.writeShellScriptBin "neomutt" '' - systemctl --user start mbsync.service; - ${pkgs.neomutt}/bin/neomutt; - ''; - vimKeys = false; # see the modified ones below - checkStatsInterval = 60; - binds = [ - #------------------------------------------------------------ - # Vi Key Bindings (taken from their configuration, modified for dvorak) - #------------------------------------------------------------ - - # Moving around - { - action = "noop"; - key = "g"; - map = ["attach" "browser" "index"]; - } - { - action = "first-entry"; - key = "gg"; - map = ["attach" "browser" "index"]; - } - { - action = "last-entry"; - key = "G"; - map = ["attach" "browser" "index"]; - } - { - action = "noop"; - key = "g"; - map = ["pager"]; - } - { - action = "top"; - key = "gg"; - map = ["pager"]; - } - { - action = "bottom"; - key = "G"; - map = ["pager"]; - } - { - action = "previous-line"; - key = "n"; - map = ["pager"]; - } - { - action = "next-line"; - key = "t"; - map = ["pager"]; - } - - # Scrolling - { - action = "next-page"; - key = "\\CF"; - map = ["attach" "browser" "pager" "index"]; - } - { - action = "previous-page"; - key = "\\CB"; - map = ["attach" "browser" "pager" "index"]; - } - { - action = "half-up"; - key = "\\Cu"; - map = ["attach" "browser" "pager" "index"]; - } - { - action = "half-down"; - key = "\\Cd"; - map = ["attach" "browser" "pager" "index"]; - } - { - action = "next-line"; - key = "\\Ce"; - map = ["browser" "pager"]; - } - { - action = "previous-line"; - key = "\\Cy"; - map = ["browser" "pager"]; - } - { - action = "next-line"; - key = "\\Ce"; - map = ["index"]; - } - { - action = "previous-line"; - key = "\\Cy"; - map = ["index"]; - } - - { - action = "noop"; - key = "d"; - map = ["pager" "index"]; - } - { - action = "delete-message"; - key = "dd"; - map = ["pager" "index"]; - } - - # Mail & Reply - { - # Doesn't work currently - action = "list-reply"; - key = "\\Cm"; - map = ["index"]; - } - - # Threads - { - action = "search-opposite"; - key = "N"; - map = ["browser" "pager" "index"]; - } - { - action = "delete-thread"; - key = "dT"; - map = ["pager" "index"]; - } - { - action = "delete-subthread"; - key = "dt"; - map = ["pager" "index"]; - } - { - action = "next-thread"; - key = "gt"; - map = ["pager" "index"]; - } - { - action = "previous-thread"; - key = "gT"; - map = ["pager" "index"]; - } - { - action = "collapse-thread"; - key = "za"; - map = ["index"]; - } - { - # Missing: folddisable/foldenable - action = "collapse-all"; - key = "zA"; - map = ["index"]; - } - - { - action = "search-next"; - key = "l"; - map = ["index"]; - } - { - action = "limit"; - key = "f"; - map = ["index"]; - } - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/default.nix b/home-manager/soispha/config/neovim/default.nix deleted file mode 100644 index 308826f0..00000000 --- a/home-manager/soispha/config/neovim/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - imports = [ - ./nixvim - ]; -} diff --git a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix b/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix deleted file mode 100644 index cb0311fb..00000000 --- a/home-manager/soispha/config/neovim/nixvim/autocmds/default.nix +++ /dev/null @@ -1,99 +0,0 @@ -{config, ...}: { - programs.nixvim = { - autoGroups = { - cursor_off = {clear = true;}; - colorcolumn_toggle = {clear = true;}; - numbertoggle = {clear = true;}; - coloroverride = {clear = true;}; - highlight_on_yank = {clear = true;}; - }; - autoCmd = [ - { - event = ["TextYankPost"]; - pattern = ["*"]; - callback = { - __raw = '' - function() - vim.highlight.on_yank() - end - ''; - }; - group = "highlight_on_yank"; - description = "Highlight the yanked text"; - } - { - event = ["BufWritePre"]; - pattern = ["*"]; - command = '' - ks | if search("\\s\\+$", 'n') != 0 | :%s/\s\+$// | endif | 's - ''; - description = '' - Remove trailing whitespace on safe - :%s/\s\+$\| \+\ze\t//g >> For trailing spaces and spaces before tabstops - ''; - } - - { - event = ["WinLeave"]; - pattern = ["*"]; - command = "set nocursorline"; # TODO: possible also nocursorcolumn - group = "cursor_off"; - description = "Display cursorline and cursorcolumn ONLY in active window."; - } - { - event = ["WinEnter"]; - pattern = ["*"]; - command = "set cursorline"; # TODO: possible also cursorcolumn - group = "cursor_off"; - description = "Display cursorline and cursorcolumn ONLY in active window."; - } - - { - event = ["InsertEnter"]; - pattern = ["*"]; - command = "set colorcolumn=${config.programs.nixvim.options.colorcolumn}"; - group = "colorcolumn_toggle"; - description = "Only activate the colorcolumn when focused"; - } - { - event = ["BufLeave" "FocusLost" "InsertLeave" "WinLeave"]; - pattern = ["*"]; - command = "set colorcolumn=0"; - group = "colorcolumn_toggle"; - description = "Only activate the colorcolumn when focused"; - } - - { - event = ["BufEnter" "FocusGained" "InsertLeave" "WinEnter"]; - pattern = ["*"]; - command = "if &nu && mode() != \"i\" | set rnu | endif"; - group = "numbertoggle"; - description = "Change line numbers, when not focused"; - } - { - event = ["BufLeave" "FocusLost" "InsertEnter" "WinLeave"]; - pattern = ["*"]; - command = "if &nu | set nornu | endif"; - group = "numbertoggle"; - description = "Change line numbers, when not focused"; - } - - { - # Override LineNr - event = ["ColorScheme"]; - pattern = ["*"]; - command = "highlight LineNr ctermfg=DarkGrey guifg=DarkGrey "; - group = "coloroverride"; - description = "Changes Line number colors"; - } - { - # Override CursorLineNr - event = ["ColorScheme"]; - pattern = ["*"]; - command = "highlight CursorLineNr ctermfg=White guifg=White "; - group = "coloroverride"; - description = "Changes Line number colors"; - } - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/clipboard/default.nix b/home-manager/soispha/config/neovim/nixvim/clipboard/default.nix deleted file mode 100644 index 0a686190..00000000 --- a/home-manager/soispha/config/neovim/nixvim/clipboard/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim = { - clipboard.providers = { - wl-copy.enable = true; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/default.nix b/home-manager/soispha/config/neovim/nixvim/default.nix deleted file mode 100644 index 61467618..00000000 --- a/home-manager/soispha/config/neovim/nixvim/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - imports = [ - ./autocmds - ./clipboard - ./files - ./mappings - ./options - ./plugins - ]; - programs.nixvim = { - enable = true; - - # source: https://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=Neovim - extraConfigLuaPre = lib.mkBefore '' - --------------------------------------------------------------------------- - -- - -- ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ - -- ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ - -- ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ - -- ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ - -- ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ - -- ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ - -- - --------------------------------------------------------------------------- - ''; - - extraPackages = with pkgs; [ - /* - These are mostly linters and formatters used for different file types. - Including them here is fine, as they are not necessarily sync able to different people. - */ - # nix - alejandra - statix - - # yaml - yamllint - - # shell - shellcheck - shfmt - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/files/default.nix b/home-manager/soispha/config/neovim/nixvim/files/default.nix deleted file mode 100644 index 5045eb9f..00000000 --- a/home-manager/soispha/config/neovim/nixvim/files/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.nixvim = { - extraPlugins = [ - pkgs.vimExtraPlugins.gruvbox - ]; - extraFiles = { - path = "ftplugin/tex.lua"; - content = '' - ${lib.strings.fileContents ./ftplugin/tex.lua} - ''; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/files/ftplugin/tex.lua b/home-manager/soispha/config/neovim/nixvim/files/ftplugin/tex.lua deleted file mode 100644 index 8f39d7bb..00000000 --- a/home-manager/soispha/config/neovim/nixvim/files/ftplugin/tex.lua +++ /dev/null @@ -1,78 +0,0 @@ --- local used = false; --- vim.keymap.set('n', 't', function() --- used = not used; --- if used then --- require('nvim-treesitter.configs').setup { --- highlight = { --- additional_vim_regex_highlighting = { "latex", "markdown" }, --- }, --- } --- else --- require('nvim-treesitter.configs').setup { --- highlight = { --- additional_vim_regex_highlighting = { "" }, --- }, --- } --- end --- end --- ); --- --- --- Set non-treesitter colorscheme -require("gruvbox").setup({ - undercurl = true; - underline = true; - bold = true; - italic = { strings = true; comments = true; operators = false; folds = true; }; - strikethrough = true; - invert_selection = false; - invert_signs = false; - invert_tabline = false; - invert_intend_guides = false; - inverse = true; -- invert background for search, diffs, statuslines and errors - contrast = ""; -- can be "hard", "soft" or empty string - palette_overrides = {}; - overrides = {}; - dim_inactive = false; - transparent_mode = false; -}) -vim.cmd("colorscheme gruvbox") - -require("lualine").setup({ options = { theme = "gruvbox"; }; }) - --- Set tex specific telescope extension -require("telescope").setup({ - extensions = { - bibtex = { - -- Depth for the *.bib file - depth = 1; - -- Path to global bibliographies (placed outside of the project) - global_files = {}; - -- Define the search keys to use in the picker - search_keys = { "author"; "year"; "title"; }; - -- Template for the formatted citation - citation_format = "{{author}} ({{year}}), {{title}}."; - -- Only use initials for the authors first name - citation_trim_firstname = true; - -- Max number of authors to write in the formatted citation - -- following authors will be replaced by "et al." - citation_max_auth = 2; - -- Wrapping in the preview window is disabled by default - wrap = false; - -- Custom format for citation label - custom_formats = { - { id = "tex_autocite"; cite_marker = "\\autocite{%s}"; }; - }; - format = "tex_autocite"; - -- Use context awareness - context = true; - -- Fallback to global/directory .bib files if context not found - -- This setting has no effect if context = false - context_fallback = true; - }; - }; -}) -require("telescope").load_extension("bibtex") -vim.api.nvim_set_keymap("n", "ib", function() - require("telescope").extensions.bibtex.bibtex() - end, { noremap = true; silent = true; desc = "list bibtex entries in telescope"; }) diff --git a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix b/home-manager/soispha/config/neovim/nixvim/mappings/default.nix deleted file mode 100644 index 1d00b0a4..00000000 --- a/home-manager/soispha/config/neovim/nixvim/mappings/default.nix +++ /dev/null @@ -1,222 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - globals = { - mapleader = " "; - maplocalleader = " "; - }; - maps = let - normal_and_insert = { - "" = { - action = "noh"; - desc = "Disable the search highlighting and send Escape"; - }; - }; - in { - insert = - lib.recursiveUpdate { - "hh" = { - action = '' - function() - local cmp = require('cmp'); - local luasnip = require('luasnip'); - - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end - ''; - lua = true; - desc = "completion trigger/ forward in completen menu"; - }; - "cc" = { - action = '' - function() - local cmp = require('cmp'); - cmp.confirm() - end - ''; - lua = true; - desc = "confirm the selected item"; - }; - } - normal_and_insert; - normalVisualOp = { - # yank/ cut to the system clipboard - "y" = { - action = "\"+y"; - desc = "yank to the system clipboard"; - }; - "Y" = { - action = "\"+Y"; - desc = "yank until the end of the line to the system clipboard"; - }; - - # Unmap some old keys - #"s" = "''"; - #"t" = "''"; - "" = ""; - "" = ""; - "" = ""; - "" = ""; - - # Center the cursor vertically when moving to the next word during a search. - "l" = { - action = "nzzzv"; - desc = "Center the cursor vertically when moving to the next word during a - search."; - }; - "L" = { - action = "Nzzzv"; - desc = "Center the cursor vertically when moving to the next word during a - search."; - }; - # remap the other keys to dvorak - "k" = { - action = "t"; - desc = "go the the right on char"; - }; - "K" = { - action = "T"; - desc = "go to the left on char"; - }; - "j" = { - action = "k"; - desc = "go to the right before the char"; - }; - "J" = { - action = "K"; - desc = "go to the left before the char"; - }; - - # Change Vim-keys - "h" = { - action = ""; - desc = "go left"; - }; - "t" = { - action = "g"; - desc = "go down, with displaylines"; - }; - "n" = { - action = "g"; - desc = "go up, with displaylines"; - }; - "s" = { - action = ""; - desc = "go right"; - }; - - # Move display lines - "0" = { - action = "g0"; - desc = "go to the leftmost character in the screen line"; - }; - "$" = { - action = "g$"; - desc = "go to the rightmost character in the screen line"; - }; - }; - normal = - lib.recursiveUpdate { - "" = { - action = ":"; - desc = "jump to command line"; - }; - - "\\f" = { - action = "function() require('lf').start() end"; - lua = true; - desc = "open lf in a floating window"; - }; - - # Splits - "" = { - action = "p"; - desc = "go to previous split"; - }; - "" = { - action = "w"; - desc = "go to next split"; - }; - "-" = { - action = "s"; - desc = "New horizontal split"; - }; - "|" = { - action = "v"; - desc = "New vertical split"; - }; - - # Exit insert mode after creating a new line above or below the current line."; - "o" = { - action = "o"; - desc = "add new line below"; - }; - "O" = { - action = "O"; - desc = "add new line above"; - }; - - "p" = { - action = "\"_dP"; - desc = "keep the cut thing in the base register"; - }; - - "d" = { - action = "\"_d"; - desc = "delete without saving to register"; - }; - "dd" = { - action = '' - function() - if vim.api.nvim_get_current_line():match("^%s*$") then - return '"_dd' - else - return "dd" - end - end - ''; - lua = true; - desc = "Pipe all blank line deletions to the blackhole register"; - expr = true; - silent = true; - }; - - "s" = { - action = ":%s/\\<\\>//gI"; - desc = "replace for the word under the cursor"; - }; - - "" = { - action = "mksession! "; - desc = "overwrite/create a session"; - }; - - "X" = { - action = "!!$SHELL "; - desc = "Read the current line and execute that line in your $SHELL. The resulting output will replace the curent line that was being executed."; - }; - } - normal_and_insert; - terminal = { - "" = { - action = ""; - desc = "Exit terminal mode with "; - }; - }; - visual = { - # move selected lines in visual mode - "T" = { - action = ":m '>+1gv=gv"; - desc = "move selected lines in visual mode down"; - }; - "N" = { - action = ":m '<-2gv=gv"; - desc = "move selected lines in visual mode up"; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/options/default.nix b/home-manager/soispha/config/neovim/nixvim/options/default.nix deleted file mode 100644 index 879a5cd1..00000000 --- a/home-manager/soispha/config/neovim/nixvim/options/default.nix +++ /dev/null @@ -1,105 +0,0 @@ -{nixosConfig, ...}: { - programs.nixvim.options = { - autoindent = true; # copy indent from previous line - cindent = true; # use c like indenting rules - breakindent = true; # continue indent visually - showbreak = "↳ "; # downwards arrow with tip rightwards(U+21B3, UTF-8: E2 86 B3) - breakindentopt = { - shift = 2; # wrapped line's beginning will be shifted by the given number of - }; - - incsearch = true; # show search results while typing - inccommand = "split"; # line preview of :s results - ignorecase = true; # ignore case when searching - smartcase = true; # if a capital letter is used in search, overwrite ignorecase - showmatch = true; # show matching words during a search. - hlsearch = true; # highlight when searching - - confirm = true; # confirm to save changes before closing modified buffer - colorcolumn = "+1"; # show a +1 before the 'textwidth' - completeopt = ["menuone" "noselect"]; # have a better completion experience - - # https://www.compart.com/en/unicode/U+XXXX (unicode character code) - # stylua: ignore - fillchars = { - fold = "·"; # MIDDLE DOT (U+00B7, UTF-8: C2 B7) - horiz = "━"; # BOX DRAWINGS HEAVY HORIZONTAL (U+2501, UTF-8: E2 94 81) - horizdown = "┳"; # BOX DRAWINGS HEAVY DOWN AND HORIZONTAL (U+2533, UTF-8: E2 94 B3) - horizup = "┻"; # BOX DRAWINGS HEAVY UP AND HORIZONTAL (U+253B, UTF-8: E2 94 BB) - vert = "┃"; # BOX DRAWINGS HEAVY VERTICAL (U+2503, UTF-8: E2 94 83) - vertleft = "┫"; # BOX DRAWINGS HEAVY VERTICAL AND LEFT (U+252B, UTF-8: E2 94 AB) - vertright = "┣"; # BOX DRAWINGS HEAVY VERTICAL AND RIGHT (U+2523, UTF-8: E2 94 A3) - verthoriz = "╋"; # BOX DRAWINGS HEAVY VERTICAL AND HORIZONTAL (U+254B, UTF-8: E2 95 8B) - }; - listchars = builtins.concatStringsSep "," [ - "nbsp:⦸" # CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8) - "tab:▷┅" # WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) - "extends:»" # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB) - "precedes:«" # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB) - "trail:•" # BULLET (U+2022, UTF-8: E2 80 A2) - ]; - - # shell-like autocomplete to unambiguous portions - wildmode = builtins.concatStringsSep "," [ - "longest" - "list" - "full" - ]; - - grepformat = "%f:%l:%c:%m"; # the default format for rg in vimgrep mode - grepprg = "rg --vimgrep"; # use rg as grep implementation in `:grep` - - hidden = true; # allows you to hide buffers with unsaved changes without being prompted - - laststatus = 3; # use global statusline # TODO: - - list = true; # show whitespace - - mouse = ""; # disables the mouse - - number = true; # line numbers - relativenumber = true; # relative line numbers - - # vim.opt.shada:append {'%'}; -- store buffers in the shada file and reopen them if nvim has been started without file name argument - - shell = nixosConfig.users.users.soispha.shell.pname; # try to use default shell for the default user as a shell for ":!" - - spell = true; # activate spell checking - spelllang = "en_us,de_de"; # set spell languages - spelloptions = "camel"; # CamelCase check if both camel and case are correct words - - syntax = "ON"; # use syntax highlighting and let nvim figure out which - - shiftwidth = 0; # use tabstop setting as shiftwidth - tabstop = 4; # use 4 spaces in place of a tab - expandtab = true; # expand tabs to spaces - - showtabline = 2; # always show the tabline - - timeoutlen = 500; # wait 500 msec for the next char in an input sequence - ttyfast = true; # let vim know that I am using a fast term - - undofile = true; # use a undofile, to save the undos - undolevels = 10000; # keep nearly all undo things stored - - virtualedit = "block"; # allow the cursor to move beyond actual character in visual block mode - - textwidth = 120; # automatically hard wrap at 120 columns by default - - foldmethod = "marker"; # use markers to specify folds - - termguicolors = true; - cursorline = true; - # vim.opt.cursorcolumn = true; - - scrolloff = 999; # try to keep at least 999 lines above and below the cursor (this effectively keeps the screen centered) - - linebreak = true; # break to long lines, but do only break them at [[::space::]] - - showcmd = true; # show partial command, being typed - showmode = true; # show the mode (Visual, Insert, Command) - - wildmenu = true; # shell completion - wildignore = "*.docx,*.jpg,*.png,*.gif,*.pdf,*.pyc,*.exe,*.flv,*.img,*.xlsx"; # ignore binary files - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/default.nix deleted file mode 100644 index 21069752..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package nightfox though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/nightfox.lua} - ${lib.strings.fileContents ./lua/mk_todos_readable.lua} - ''; - colorscheme = "duskfox"; - extraPlugins = [ - pkgs.vimExtraPlugins.nightfox-nvim - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/mk_todos_readable.lua b/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/mk_todos_readable.lua deleted file mode 100644 index 0145ec19..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/mk_todos_readable.lua +++ /dev/null @@ -1,5 +0,0 @@ -local opts = { bg = "NONE"; fg = "fg"; } -vim.api.nvim_set_hl(0, "@text.danger", opts) -vim.api.nvim_set_hl(0, "@text.note", opts) -vim.api.nvim_set_hl(0, "@text.todo", opts) -vim.api.nvim_set_hl(0, "@text.warning", opts) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/nightfox.lua b/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/nightfox.lua deleted file mode 100644 index 025eb133..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/colorscheme/lua/nightfox.lua +++ /dev/null @@ -1,44 +0,0 @@ -require("nightfox").setup({ - options = { - -- Compiled file's destination location - compile_path = vim.fn.stdpath("cache") .. "/nightfox"; - compile_file_suffix = "_compiled"; -- Compiled file suffix - transparent = true; -- Disable setting background - terminal_colors = true; -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` - dim_inactive = true; -- Non focused panes set to alternative background - module_default = true; -- Default enable value for modules - colorblind = { - enable = true; -- Enable colorblind support - simulate_only = false; -- Only show simulated colorblind colors and not diff shifted - severity = { - protan = 0.3; -- Severity [0,1] for protan (red) - deutan = 0.9; -- Severity [0,1] for deutan (green) - tritan = 0; -- Severity [0,1] for tritan (blue) - }; - }; - styles = { -- Style to be applied to different syntax groups - comments = "italic"; -- Value is any valid attr-list value `:help attr-list` - conditionals = "NONE"; - constants = "NONE"; - functions = "bold"; - keywords = "bold"; - numbers = "NONE"; - operators = "NONE"; - strings = "NONE"; - types = "NONE"; - variables = "NONE"; - }; - inverse = { -- Inverse highlight for different types - match_paren = false; - visual = false; - search = false; - }; - modules = { -- List of various plugins and additional options - diagnostic = { enable = true; background = false; }; - native_lsp = { enable = true; background = false; }; - }; - }; - palettes = {}; - specs = {}; - groups = {}; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/default.nix deleted file mode 100644 index 796ae3f2..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{...}: { - imports = [ - #./lsp-progress-nvim - ./colorscheme - ./femaco - ./goto-preview - ./harpoon - ./leap - ./lf-nvim - ./lsp - ./lspkind - ./lualine - ./luasnip - ./nvim-cmp - ./nvim-lint - ./raw_plugins - ./telescope - ./todo-comments - ./treesitter - ./vim-tex - ./which-key - ]; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/femaco/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/femaco/default.nix deleted file mode 100644 index 6d7ec16a..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/femaco/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package femaco though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/femaco.lua} - ''; - extraPlugins = [ - pkgs.vimPlugins.nvim-FeMaco-lua - ]; - maps = { - normal = { - "cc" = { - action = "require('femaco.edit').edit_code_block()"; - lua = true; - desc = "edit a [c]ode blo[c]k with femaco"; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/femaco/lua/femaco.lua b/home-manager/soispha/config/neovim/nixvim/plugins/femaco/lua/femaco.lua deleted file mode 100644 index 12171793..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/femaco/lua/femaco.lua +++ /dev/null @@ -1,49 +0,0 @@ -require("femaco").setup({ - -- should prepare a new buffer and return the winid - -- by default opens a floating window - -- provide a different callback to change this behaviour - -- @param opts: the return value from float_opts - prepare_buffer = function(opts) - local buf = vim.api.nvim_create_buf(false, false) - return vim.api.nvim_open_win(buf, true, opts) - end; - -- should return options passed to nvim_open_win - -- @param code_block: data about the code-block with the keys - -- * range - -- * lines - -- * lang - float_opts = function(code_block) - return { - relative = "cursor"; - width = clip_val(5, 120, vim.api.nvim_win_get_width(0) - 10); -- TODO: how to offset sign column etc? - height = clip_val(5, #code_block.lines, vim.api.nvim_win_get_height(0) - 6); - anchor = "NW"; - row = 0; - col = 0; - style = "minimal"; - border = "rounded"; - zindex = 1; - } - end; - -- return filetype to use for a given lang - -- lang can be nil - ft_from_lang = function(lang) - return lang - end; - -- what to do after opening the float - post_open_float = function(winnr) - vim.wo.signcolumn = "no" - end; - -- create the path to a temporary file - create_tmp_filepath = function(filetype) - return os.tmpname() - end; - -- if a newline should always be used, useful for multiline injections - -- which separators needs to be on separate lines such as markdown, neorg etc - -- @param base_filetype: The filetype which FeMaco is called from, not the - -- filetype of the injected language (this is the current buffer so you can - -- get it from vim.bo.filetyp). - ensure_newline = function(base_filetype) - return false - end; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/default.nix deleted file mode 100644 index 740bb04c..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package goto-preview though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/goto-preview.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.goto-preview - ]; - maps.normal = { - "gd" = { - action = "require('goto-preview').goto_preview_definition"; - lua = true; - desc = "[G]oto [D]efinition"; - }; - "gtd" = { - action = "require('goto-preview').goto_preview_type_definition"; - lua = true; - desc = "[G]oto the [t]ype [D]efinition"; - }; - "gi" = { - action = "require('goto-preview').goto_preview_implementation"; - lua = true; - desc = "[G]oto [I]mplementations"; - }; - "gr" = { - action = "require('goto-preview').goto_preview_references"; - lua = true; - desc = "[G]o to all [R]eferences of the symbol"; - }; - "\\" = { - action = "require('goto-preview').close_all_win"; - lua = true; - desc = "close all preview windows"; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/lua/goto-preview.lua b/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/lua/goto-preview.lua deleted file mode 100644 index cde50d3e..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/goto-preview/lua/goto-preview.lua +++ /dev/null @@ -1,21 +0,0 @@ -require("goto-preview").setup({ - width = 120; -- Width of the floating window - height = 15; -- Height of the floating window - border = { "↖"; "─"; "┐"; "│"; "┘"; "─"; "└"; "│"; }; -- Border characters of the floating window - default_mappings = false; -- Bind default mappings - debug = false; -- Print debug information - opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent. - resizing_mappings = false; -- Binds arrow keys to resizing the floating window. - post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. - post_close_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook. - references = { -- Configure the telescope UI for slowing the references cycling window. - telescope = {}; -- require("telescope.themes").get_dropdown({ hide_preview = false }) - }; - -- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality. - focus_on_open = true; -- Focus the floating window when opening it. - dismiss_on_move = false; -- Dismiss the floating window when moving the cursor. - force_close = true; -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close - bufhidden = "wipe"; -- the bufhidden option to set on the floating window. See :h bufhidden - stack_floating_preview_windows = true; -- Whether to nest floating windows - preview_window_title = { enable = true; position = "left"; }; -- Whether to set the preview window title as the filename -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/harpoon/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/harpoon/default.nix deleted file mode 100644 index ecd1d6cb..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/harpoon/default.nix +++ /dev/null @@ -1,95 +0,0 @@ -{...}: let - numbers = ["0" "1" "2" "3" "4" "5" "6" "7" "8" "9"]; - mkNumberedCommand = { - command_template, - prefix, - number, - desc_template, - }: { - name = "${prefix}${number}"; - value = { - action = '' - function() - ${command_template number} - end - ''; - lua = true; - desc = "${desc_template number}"; - }; - }; - mkGotoTerminalCommand = number: let - desc_template = number: "Goto terminal number ${number}"; - command_template = number: ''require("harpoon.term").gotoTerminal(${number})''; - prefix = "gt"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - mkGotoFileCommand = number: let - desc_template = number: "Goto Buffer number ${number}"; - command_template = number: ''require("harpoon.ui").nav_file(${number})''; - prefix = "gf"; - in - mkNumberedCommand {inherit desc_template command_template prefix number;}; - - gotoTerminalMappings = builtins.listToAttrs (builtins.map mkGotoTerminalCommand numbers); - gotoFileMappings = builtins.listToAttrs (builtins.map mkGotoFileCommand numbers); -in { - programs.nixvim = { - plugins.harpoon = { - enable = true; - # menu.width = "vim.api.nvim_win_get_width(0) - 4"; # TODO: integrate that - keymaps = { - tmuxGotoTerminal = null; # TODO: - }; - }; - maps.normalVisualOp = - { - "-" = { - action = '' - function() - require("harpoon.ui").nav_next() - end - ''; - lua = true; - desc = "go to the next marked file"; - }; - "_" = { - action = '' - function() - require("harpoon.ui").nav_prev() - end - ''; - lua = true; - desc = "go to the previous marked file"; - }; - "" = { - action = '' - function() - require("harpoon.mark").add_file() - end - ''; - lua = true; - desc = "add a mark to the open file in harpoon."; - }; - "gqc" = { - action = '' - function() - require("harpoon.cmd-ui").toggle_quick_menu() - end - ''; - lua = true; - desc = "toggle the harpoon command quick menu to see all commands."; - }; - "q" = { - action = '' - function() - require("harpoon.ui").toggle_quick_menu() - end - ''; - lua = true; - desc = "toggle the harpoon normal quick menu to see all marks."; - }; - } - // gotoFileMappings - // gotoTerminalMappings; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/leap/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/leap/default.nix deleted file mode 100644 index bffdf33c..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/leap/default.nix +++ /dev/null @@ -1,58 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.leap = { - enable = true; - addDefaultMappings = false; # They don't work with dvorak. - safeLabels = [ - "f" - "j" - "k" - "l" - "/" - "z" - "S" - "F" - "J" - "K" - "L" - "H" - "W" - "E" - "M" - "B" - "U" - "X" - "?" - "Z" - ]; - }; - maps = { - normalVisualOp = { - "m" = { - action = "(leap-forward-to)"; - desc = "leap forward to"; - }; - "M" = { - action = "(leap-backward-to)"; - desc = "leap backward to"; - }; - "gs" = { - action = "(leap-from-window)"; - desc = "leap to enterable windows"; - }; - }; - visual = { - /* - "x" = { - action = "(leap-forward-till)"; - desc = "leap forward till"; - }; - "X" = { - action = "(leap-backward-till)"; - desc = "leap backward till"; - }; - */ - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/default.nix deleted file mode 100644 index c562f400..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package lf-nvim though a module - # FIXME: change the nvim path, when I change the path with lf - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lf-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lf-nvim - - pkgs.vimExtraPlugins.nvim-toggleterm-lua # required by lf-nvim - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/lua/lf-nvim.lua b/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/lua/lf-nvim.lua deleted file mode 100644 index 8a0cf817..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lf-nvim/lua/lf-nvim.lua +++ /dev/null @@ -1,43 +0,0 @@ -local fn = vim.fn - --- Defaults -require("lf").setup({ - default_action = "drop"; -- default action when `Lf` opens a file - -- TODO: what do these mappings do? - default_actions = { -- default action keybindings - [""] = "tabedit"; - [""] = "split"; - [""] = "vsplit"; - [""] = "tab drop"; - }; - - winblend = 10; -- psuedotransparency level - dir = ""; -- directory where `lf` starts ('gwd' is git-working-directory, ""/nil is CWD) - direction = "float"; -- window type: float horizontal vertical - border = "rounded"; -- border kind: single double shadow curved - height = fn.float2nr(fn.round(0.75 * vim.o.lines)); -- height of the *floating* window - width = fn.float2nr(fn.round(0.75 * vim.o.columns)); -- width of the *floating* window - escape_quit = true; -- map escape to the quit command (so it doesn't go into a meta normal mode) - focus_on_open = true; -- focus the current file when opening Lf (experimental) - mappings = true; -- whether terminal buffer mapping is enabled - tmux = false; -- tmux statusline can be disabled on opening of Lf - default_file_manager = true; -- make lf default file manager - disable_netrw_warning = true; -- don't display a message when opening a directory with `default_file_manager` as true - highlights = { -- highlights passed to toggleterm - Normal = { link = "Normal"; }; - NormalFloat = { link = "Normal"; }; - FloatBorder = { guifg = "#cdcbe0"; guibg = "#191726"; }; - }; - - -- Layout configurations - layout_mapping = ""; -- resize window with this key - views = { -- window dimensions to rotate through - { width = 0.800; height = 0.800; }; - { width = 0.600; height = 0.600; }; - { width = 0.950; height = 0.950; }; - { width = 0.500; height = 0.500; col = 0; row = 0; }; - { width = 0.500; height = 0.500; col = 0; row = 0.5; }; - { width = 0.500; height = 0.500; col = 0.5; row = 0; }; - { width = 0.500; height = 0.500; col = 0.5; row = 0.5; }; - }; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/default.nix deleted file mode 100644 index 6602ceb6..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/default.nix +++ /dev/null @@ -1,50 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.nixvim = { - # TODO: package lsp-progress-nvim though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/lsp-progress-nvim.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.lsp-progress-nvim - ]; - - # Status line setup - autoGroups.lsp_refresh.clear = true; - autoCmd = [ - { - event = ["User LspProgressStatusUpdated"]; - pattern = ["*"]; - callback = - /* - lua - */ - { - __raw = '' - require("lualine").refresh - ''; - }; - group = "lsp_refresh"; - description = "Refresh the statusbar when the lsp status was updated."; - } - ]; - plugins.lualine = let - get_lsp_progress = { - __raw = - /* - lua - */ - '' - require('lsp-progress').progress - ''; - }; - in { - sections = { - lualine_c = [{name = get_lsp_progress;}]; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua b/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua deleted file mode 100644 index 4273085c..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp-progress-nvim/lua/lsp-progress-nvim.lua +++ /dev/null @@ -1,150 +0,0 @@ ---- @type table -require("lsp-progress").setup({ - -- Spinning icons. - -- - --- @type string[] - spinner = { "⣾"; "⣽"; "⣻"; "⢿"; "⡿"; "⣟"; "⣯"; "⣷"; }; - - -- Spinning update time in milliseconds. - -- - --- @type integer - spin_update_time = 200; - - -- Last message cached decay time in milliseconds. - -- - -- Message could be really fast(appear and disappear in an - -- instant) that user cannot even see it, thus we cache the last message - -- for a while for user view. - -- - --- @type integer - decay = 700; - - -- User event name. - -- - --- @type string - event = "LspProgressStatusUpdated"; - - -- Event update time limit in milliseconds. - -- - -- Sometimes progress handler could emit many events in an instant, while - -- refreshing statusline cause too heavy synchronized IO, so we limit the - -- event rate to reduce this cost. - -- - --- @type integer - event_update_time_limit = 100; - - -- Max progress string length, by default -1 is unlimited. - -- - --- @type integer - max_size = -1; - - -- Regular internal update time. - -- - -- Emit user event to update the lsp progress status, even there's no new - -- message. - -- - --- @type integer - regular_internal_update_time = 500; - - -- Disable emitting events on specific mode/filetype. - -- User events would interrupt insert mode, thus break which-key like plugins behaviour. - -- See: - -- * https://github.com/linrongbin16/lsp-progress.nvim/issues/50 - -- * https://neovim.io/doc/user/builtin.html#mode() - -- - --- @type table[] - disable_events_opts = { { mode = "i"; filetype = "TelescopePrompt"; }; }; - - -- Format series message. - -- - -- By default it looks like: `formatting isort (100%) - done`. - -- - --- @param title string|nil - --- Message title. - --- @param message string|nil - --- Message body. - --- @param percentage number|nil - --- Progress in percentage numbers: 0-100. - --- @param done boolean - --- Indicate whether this series is the last one in progress. - --- @return string|nil messages - --- The returned value will be passed to function `client_format` as - --- one of the `series_messages` array, or ignored if return nil. - series_format = function(title, message, percentage, done) - local builder = {} - local has_title = false - local has_message = false - if title and title ~= "" then - table.insert(builder, title) - has_title = true - end - if message and message ~= "" then - table.insert(builder, message) - has_message = true - end - if percentage and (has_title or has_message) then - table.insert(builder, string.format("(%.0f%%%%)", percentage)) - end - if done and (has_title or has_message) then - table.insert(builder, "- done") - end - return table.concat(builder, " ") - end; - - -- Format client message. - -- - -- By default it looks like: - -- `[null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)`. - -- - --- @param client_name string - --- Client name. - --- @param spinner string - --- Spinner icon. - --- @param series_messages string[]|table[] - --- Messages array. - --- @return string|nil messages - --- The returned value will be passed to function `format` as one of the - --- `client_messages` array, or ignored if return nil. - client_format = function(client_name, spinner, series_messages) - return #series_messages > 0 - and ("[" .. client_name .. "] " .. spinner .. " " .. table.concat(series_messages, ", ")) - or nil - end; - - -- Format (final) message. - -- - -- By default it looks like: - -- ` LSP [null-ls] ⣷ formatting isort (100%) - done, formatting black (50%)` - -- - --- @param client_messages string[]|table[] - --- Client messages array. - --- @return nil|string message - --- The returned value will be returned from `progress` API. - format = function(client_messages) - local sign = " LSP" -- nf-fa-gear \uf013 - return #client_messages > 0 and (sign .. " " .. table.concat(client_messages, " ")) or sign - end; - - -- Enable debug. - -- - --- @type boolean - debug = false; - - -- Print log to console(command line). - -- - --- @type boolean - console_log = false; - - -- Print log to file. - -- - --- @type boolean - file_log = true; - - -- Log file to write, work with `file_log=true`. - -- - -- For Windows: `$env:USERPROFILE\AppData\Local\nvim-data\lsp-progress.log`. - -- For *NIX: `~/.local/share/nvim/lsp-progress.log`. - -- - --- @type string - file_log_name = "lsp-progress.log"; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/default.nix deleted file mode 100644 index b7c1e174..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{...}: { - imports = [ - ./keymaps - ./servers - ]; - programs.nixvim.plugins.lsp = { - enable = true; - onAttach = - "" - # + '' - # function(client, bufnr) - # -- Enable completion triggered by - # -- vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') - # end - # '' - ; - preConfig = '' - vim.diagnostic.config({ - underline = true, - -- virtual_text = true, - virtual_text = { - source = "always", -- Or "if_many" - }, - update_in_insert = true, - severity_sort = true, - }, nil); - ''; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix deleted file mode 100644 index 4017521d..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/keymaps/default.nix +++ /dev/null @@ -1,72 +0,0 @@ -{...}: { - programs.nixvim = { - plugins.lsp.keymaps = { - diagnostic = { - "N" = { - action = "goto_prev"; - desc = "go to previous diagnostic message"; - }; - "T" = { - action = "goto_next"; - desc = "go to next diagnostic message"; - }; - "e" = { - action = "open_float"; - desc = "open float for the symbol"; - }; - "gq" = { - action = "setloclist"; - desc = "add buffer diagnostic to the location list (quick-fix)"; - }; - }; - lspBuf = { - "gD" = { - action = "declaration"; - desc = "[G]o to [d]eclaration"; - }; - "hi" = { - action = "hover"; - desc = "Display [h]over [i]nformation"; - }; - "sh" = { - action = "signature_help"; - desc = "Display [s]ignature [h]elp"; - }; - "wa" = { - action = "add_workspace_folder"; - desc = "[W]orkspace folder [a]dd"; - }; - "wr" = { - action = "remove_workspace_folder"; - desc = "[W]orkspace folder [r]emove"; - }; - "rn" = { - action = "rename"; - desc = "[R]e[n]ame the item under the cursor"; - }; - "ca" = { - action = "code_action"; - desc = "Open the [c]ode [a]ction menu"; - }; - }; - }; - maps = { - normal = { - "f" = { - action = "function() vim.lsp.buf.format { async = true } end"; - lua = true; - desc = "[F]ormat the current buffer (asynchronously)"; - }; - "wl" = { - action = '' - function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end - ''; - lua = true; - desc = "[W]orkspace folders [l]ist"; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/default.nix deleted file mode 100644 index 8ffac2e1..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{...}: { - imports = [ - ./servers/bashls.nix - ./servers/ltex.nix - ./servers/lua-ls.nix - ./servers/nil_ls.nix - ./servers/rust-analyzer.nix - ./servers/texlab.nix - ./servers/ccls.nix - ]; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/bashls.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/bashls.nix deleted file mode 100644 index 0577a335..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/bashls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - bashls.enable = true; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ccls.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ccls.nix deleted file mode 100644 index 0698bcce..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ccls.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ccls.enable = true; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ltex.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ltex.nix deleted file mode 100644 index 0d039f82..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/ltex.nix +++ /dev/null @@ -1,39 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - ltex = let - filetypes = [ - "rust" - "java" - "cpp" - "shell" - "bash" - - "bibtex" - "context" - "context.tex" - "latex" - "tex" - - "html" - "markdown" - "org" - "restructuredtext" - "rsweave" - - "git-commit" - "gitcommit" - ]; - in { - enable = true; - inherit filetypes; - settings = { - enabled = filetypes; - completionEnabled = false; - language = "en-CA"; - additionalRules = { - enablePickyRules = true; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/lua-ls.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/lua-ls.nix deleted file mode 100644 index 5a44b500..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/lua-ls.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - lua-ls = { - enable = true; - settings.telemetry.enable = false; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/nil_ls.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/nil_ls.nix deleted file mode 100644 index f0cccbdc..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/nil_ls.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - nil_ls = { - enable = true; - settings = { - formatting.command = ["alejandra"]; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/rust-analyzer.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/rust-analyzer.nix deleted file mode 100644 index 943a8c80..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/rust-analyzer.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - rust-analyzer = { - enable = true; - settings = { - typing.autoClosingAngleBrackets.enable = true; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/texlab.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/texlab.nix deleted file mode 100644 index 59af8d39..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lsp/servers/servers/texlab.nix +++ /dev/null @@ -1,7 +0,0 @@ -{...}: { - programs.nixvim.plugins.lsp.servers = { - texlab = { - enable = true; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lspkind/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lspkind/default.nix deleted file mode 100644 index ed7d411b..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lspkind/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - programs.nixvim.plugins.lspkind = { - enable = true; - preset = "default"; # "codicons" is only for a font patched with vscode-codeicons. - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix deleted file mode 100644 index de48efea..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/lualine/default.nix +++ /dev/null @@ -1,110 +0,0 @@ -{...}: { - programs.nixvim.plugins.lualine = let - get_location_of_file = { - __raw = '' - function() - local file_lines = vim.fn.line('$'); - local file_current_cursor_positon = vim.fn.getcurpos(); - return file_current_cursor_positon[3] .. ":" .. file_current_cursor_positon[2] .. "/" .. file_lines - end - ''; - }; - - get_trailing_whitespace = { - __raw = '' - function() - local space = vim.fn.search([[\s\+$]], 'nwc') - return space ~= 0 and "TW:" .. space or "" - end - ''; - }; - get_mixed_indent = { - __raw = '' - function() - local space_pat = [[\v^ +]] - local tab_pat = [[\v^\t+]] - local space_indent = vim.fn.search(space_pat, 'nwc') - local tab_indent = vim.fn.search(tab_pat, 'nwc') - local mixed = (space_indent > 0 and tab_indent > 0) - local mixed_same_line - if not mixed then - mixed_same_line = vim.fn.search([[\v^(\t+ | +\t)]], 'nwc') - mixed = mixed_same_line > 0 - end - if not mixed then return "" end - if mixed_same_line ~= nil and mixed_same_line > 0 then - return 'MI:' .. mixed_same_line - end - local space_indent_cnt = vim.fn.searchcount({ pattern = space_pat, max_count = 1e3 }).total - local tab_indent_cnt = vim.fn.searchcount({ pattern = tab_pat, max_count = 1e3 }).total - if space_indent_cnt > tab_indent_cnt then - return 'MI:' .. tab_indent - else - return 'MI:' .. space_indent - end - end - ''; - }; - in { - enable = true; - iconsEnabled = true; - theme = "nightfox"; - componentSeparators = { - left = ""; - right = ""; - }; - sectionSeparators = { - left = ""; - right = ""; - }; - disabledFiletypes = { - statusline = []; - winbar = []; - }; - ignoreFocus = []; - alwaysDivideMiddle = true; - globalstatus = false; - refresh = { - statusline = 1000; - tabline = 1000; - winbar = 1000; - }; - sections = { - lualine_a = ["mode"]; - lualine_b = [ - { - name = "FugitiveHead"; - icon = ""; - } - "diff" - "diagnostics" - ]; - lualine_c = ["filename"]; - lualine_x = ["searchcount" "filetype"]; - lualine_y = [ - "encoding" - "fileformat" - {name = get_mixed_indent;} - {name = get_trailing_whitespace;} - ]; - lualine_z = [{name = get_location_of_file;}]; - }; - inactiveSections = { - lualine_a = []; - lualine_b = []; - lualine_c = ["filename"]; - lualine_x = [{name = get_location_of_file;}]; - lualine_y = []; - lualine_z = []; - }; - tabline = {}; - winbar = {}; - inactiveWinbar = {}; - - # TODO: add all installed and supported extensions here - extensions = [ - "toggleterm" - #"fugitive" # TODO: maybe add this? - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/default.nix deleted file mode 100644 index 50a0b94c..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - plugins.luasnip = { - enable = true; - }; - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/luasnip.lua} - require("luasnip.loaders.from_lua").load({paths = "${./lua/snippets}"}) - require("luasnip.loaders.from_lua").lazy_load({paths = "${./lua/snippets}"}) - ''; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/luasnip.lua b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/luasnip.lua deleted file mode 100644 index 0a603692..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/luasnip.lua +++ /dev/null @@ -1,7 +0,0 @@ -require("luasnip").config.set_config({ - -- Enable auto triggered snippets - enable_autosnippets = true; - - -- Use Tab (or some other key if you prefer) to trigger visual selection - store_selection_keys = ""; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/all.lua b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/all.lua deleted file mode 100644 index 5ce91a87..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/all.lua +++ /dev/null @@ -1,60 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end -local function char_count_same(c1, c2) - local line = vim.api.nvim_get_current_line() - -- '%'-escape chars to force explicit match (gsub accepts patterns). - -- second return value is number of substitutions. - local _, ct1 = string.gsub(line, "%" .. c1, "") - local _, ct2 = string.gsub(line, "%" .. c2, "") - return ct1 == ct2 -end - -local function even_count(c) - local line = vim.api.nvim_get_current_line() - local _, ct = string.gsub(line, c, "") - return ct % 2 == 0 -end - -local function neg(fn, ...) - return not fn(...) -end - -local function part(fn, ...) - local args = { ...; } - return function() - return fn(unpack(args)) - end -end - --- This makes creation of pair-type snippets easier. -local function pair(pair_begin, pair_end, expand_func, ...) - -- triggerd by opening part of pair, wordTrig=false to trigger anywhere. - -- ... is used to pass any args following the expand_func to it. - return s( - { trig = pair_begin; wordTrig = false; snippetType = "autosnippet"; }, - { t({ pair_begin; }); d(1, get_visual); t({ pair_end; }); }, - { condition = part(expand_func, part(..., pair_begin, pair_end)); } - ) -end - -local maybe = { pair = nil; } -if vim.bo.filetype == "tex" then - maybe.pair = pair("<", ">", neg, char_count_same) -end - -local output_table = { - pair("(", ")", neg, char_count_same); - pair("{", "}", neg, char_count_same); - pair("[", "]", neg, char_count_same); - pair("'", "'", neg, even_count); - pair('"', '"', neg, even_count); - pair("`", "`", neg, even_count); -} -output_table[#output_table + 1] = maybe.pair - -return output_table diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/html/html.lua b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/html/html.lua deleted file mode 100644 index c467dd68..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/html/html.lua +++ /dev/null @@ -1,108 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1)) - end -end - -local line_begin = require("luasnip.extras.expand_conditions").line_begin - -return { - -- HEADER - s( - { - trig = "h([123456])"; - regTrig = true; - wordTrig = false; - snippetType = "autosnippet"; - }, - fmt( - [[ - {} - ]], - { - f(function(_, snip) - return snip.captures[1] - end); - d(1, get_visual); - f(function(_, snip) - return snip.captures[1] - end); - } - ), - { condition = line_begin; } - ); -- PARAGRAPH - s( - { trig = "pp"; snippetType = "autosnippet"; }, - fmt( - [[ -

    {}

    - ]], - { d(1, get_visual); } - ), - { condition = line_begin; } - ); -- UNORDERED LIST - s( - { trig = "itt"; snippetType = "autosnippet"; }, - fmt( - [[ -
      -
    • {}
    • {} -
    - ]], - { i(1); i(0); } - ), - { condition = line_begin; } - ); -- LIST ITEM - s( - { trig = "ii"; snippetType = "autosnippet"; }, - fmt( - [[ -
  • {}
  • - ]], - { d(1, get_visual); } - ), - { condition = line_begin; } - ); - -- DOCUMENT TEMPLATE - s( - { trig = "base"; }, - fmt( - [[ - - - - - {} - - - {} - - - ]], - { i(1, "FooBar"); i(0); } - ), - { condition = line_begin; } - ); -- ANCHOR TAG - s( - { - trig = "([^%l])aa"; - regTrig = true; - wordTrig = false; - snippetType = "autosnippet"; - }, - fmt( - [[ - {}{} - ]], - { - f(function(_, snip) - return snip.captures[1] - end); - i(1); - d(2, get_visual); - } - ) - ); -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/delimiter.lua b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/delimiter.lua deleted file mode 100644 index e50898fc..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/delimiter.lua +++ /dev/null @@ -1,34 +0,0 @@ -local get_visual = function(args, parent) - if #parent.snippet.env.SELECT_RAW > 0 then - return sn(nil, i(1, parent.snippet.env.SELECT_RAW)) - else - return sn(nil, i(1, "")) - end -end - -local translation_table = { ["("] = ")"; ["{"] = "}"; ["["] = "]"; } - --- Return snippet tables -return { - -- LEFT/RIGHT ALL BRACES - s( - { - trig = "([^%a])l([%(%[%{])"; - regTrig = true; - wordTrig = false; - snippetType = "autosnippet"; - }, - fmta("<>\\left<><>\\right<>", { - f(function(_, snip) - return snip.captures[1] - end); - f(function(_, snip) - return snip.captures[2] - end); - d(1, get_visual); - f(function(_, snip) - return translation_table[snip.captures[2]] - end); - }) - ); -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/greek.lua b/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/greek.lua deleted file mode 100644 index 19989093..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/luasnip/lua/snippets/tex/greek.lua +++ /dev/null @@ -1,37 +0,0 @@ --- Return snippet tables -return { - s({ trig = ";a"; snippetType = "autosnippet"; }, { t("\\alpha"); }); - s({ trig = ";b"; snippetType = "autosnippet"; }, { t("\\beta"); }); - s({ trig = ";g"; snippetType = "autosnippet"; }, { t("\\gamma"); }); - s({ trig = ";G"; snippetType = "autosnippet"; }, { t("\\Gamma"); }); - s({ trig = ";d"; snippetType = "autosnippet"; }, { t("\\delta"); }); - s({ trig = ";D"; snippetType = "autosnippet"; }, { t("\\Delta"); }); - s({ trig = ";e"; snippetType = "autosnippet"; }, { t("\\epsilon"); }); - s({ trig = ";ve"; snippetType = "autosnippet"; }, { t("\\varepsilon"); }); - s({ trig = ";z"; snippetType = "autosnippet"; }, { t("\\zeta"); }); - s({ trig = ";h"; snippetType = "autosnippet"; }, { t("\\eta"); }); - s({ trig = ";o"; snippetType = "autosnippet"; }, { t("\\theta"); }); - s({ trig = ";vo"; snippetType = "autosnippet"; }, { t("\\vartheta"); }); - s({ trig = ";O"; snippetType = "autosnippet"; }, { t("\\Theta"); }); - s({ trig = ";k"; snippetType = "autosnippet"; }, { t("\\kappa"); }); - s({ trig = ";l"; snippetType = "autosnippet"; }, { t("\\lambda"); }); - s({ trig = ";L"; snippetType = "autosnippet"; }, { t("\\Lambda"); }); - s({ trig = ";m"; snippetType = "autosnippet"; }, { t("\\mu"); }); - s({ trig = ";n"; snippetType = "autosnippet"; }, { t("\\nu"); }); - s({ trig = ";x"; snippetType = "autosnippet"; }, { t("\\xi"); }); - s({ trig = ";X"; snippetType = "autosnippet"; }, { t("\\Xi"); }); - s({ trig = ";i"; snippetType = "autosnippet"; }, { t("\\pi"); }); - s({ trig = ";I"; snippetType = "autosnippet"; }, { t("\\Pi"); }); - s({ trig = ";r"; snippetType = "autosnippet"; }, { t("\\rho"); }); - s({ trig = ";s"; snippetType = "autosnippet"; }, { t("\\sigma"); }); - s({ trig = ";S"; snippetType = "autosnippet"; }, { t("\\Sigma"); }); - s({ trig = ";t"; snippetType = "autosnippet"; }, { t("\\tau"); }); - s({ trig = ";f"; snippetType = "autosnippet"; }, { t("\\phi"); }); - s({ trig = ";vf"; snippetType = "autosnippet"; }, { t("\\varphi"); }); - s({ trig = ";F"; snippetType = "autosnippet"; }, { t("\\Phi"); }); - s({ trig = ";c"; snippetType = "autosnippet"; }, { t("\\chi"); }); - s({ trig = ";p"; snippetType = "autosnippet"; }, { t("\\psi"); }); - s({ trig = ";P"; snippetType = "autosnippet"; }, { t("\\Psi"); }); - s({ trig = ";w"; snippetType = "autosnippet"; }, { t("\\omega"); }); - s({ trig = ";W"; snippetType = "autosnippet"; }, { t("\\Omega"); }); -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-cmp/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/nvim-cmp/default.nix deleted file mode 100644 index 2fd35272..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-cmp/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{...}: { - programs.nixvim.plugins.nvim-cmp = { - /* - TODO:; integrate this: - ```lua - enabled = { - function() - -- disable completion in comments - local context = require 'cmp.config.context' - -- keep command mode completion enabled when cursor is in a comment - -- te - if vim.api.nvim_get_mode().mode == 'c' then - return true - else - return not context.in_treesitter_capture("comment") - and not context.in_syntax_group("Comment") - end - end - }, - ``` - */ - enable = true; - - mapping = { - # TODO: add support for desc and which key here - "" = { - action = "cmp.mapping.scroll_docs(-4)"; - #desc = "Scroll up by four lines"; - }; - "" = { - action = "cmp.mapping.scroll_docs(4)"; - #desc = "Scroll down by four lines"; - }; - "HH" = { - action = "cmp.mapping.complete()"; - #desc = "Confirm snipped"; - }; - }; - - snippet.expand = "luasnip"; - - sources = [ - {name = "nvim_lsp";} - {name = "luasnip";} - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/default.nix deleted file mode 100644 index c583ebf6..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.nixvim = { - # TODO: package nvim-lint though a module - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/nvim-lint.lua} - ''; - extraPlugins = [ - pkgs.vimExtraPlugins.nvim-lint - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/lua/nvim-lint.lua b/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/lua/nvim-lint.lua deleted file mode 100644 index 582da638..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/nvim-lint/lua/nvim-lint.lua +++ /dev/null @@ -1,20 +0,0 @@ -require("lint").linters_by_ft = { - -- text - markdown = {}; - -- tex = {'chktex'}, -- maybe add some text linters ? - - -- shell - sh = { "shellcheck"; }; - bash = { "shellcheck"; }; - zsh = { "shellcheck"; }; - dash = { "shellcheck"; }; - - yaml = { "yamllint"; }; - nix = { "nix"; "statix"; }; -} - -vim.api.nvim_create_autocmd({ "BufEnter"; "BufWritePost"; }, { - callback = function() - require("lint").try_lint() - end; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/raw_plugins/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/raw_plugins/default.nix deleted file mode 100644 index 941cb7cb..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/raw_plugins/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{...}: { - programs.nixvim = { - # Not all plugins have own modules - # You can add missing plugins here - # `pkgs.vimExtraPlugins` is added by the overlay you added at the beginning - # For a list of available plugins, look here: - # https://github.com/jooooscha/nixpkgs-vim-extra-plugins/blob/main/plugins.md - extraPlugins = [ - ]; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix deleted file mode 100644 index b5054ed0..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - imports = [ - ./defaults - ./keymaps - ./extensions - ]; - programs.nixvim.plugins.telescope = { - enable = true; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix deleted file mode 100644 index 1d88aad8..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/defaults/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.defaults = { - mappings = let - insert_and_normal_mappings = { - # map actions.which_key to (default: ) - # actions.which_key shows the mappings for your picker, - # e.g. git_{create, delete, ...}_branch for the git_branches picker - "" = "which_key"; - }; - in { - i = - insert_and_normal_mappings; - n = - { - "t" = "move_selection_next"; - "n" = "move_selection_previous"; - "" = "toggle_all"; - - "" = "preview_scrolling_up"; - "" = "preview_scrolling_down"; - "" = "preview_scrolling_left"; - "" = "preview_scrolling_right"; - - "" = "close"; - "q" = "close"; - } - // insert_and_normal_mappings; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/bibtex/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/bibtex/default.nix deleted file mode 100644 index 12c9736c..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/bibtex/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - # WARNING: This is only activated in tex files via the ftplugin. - programs.nixvim = { - extraPlugins = [ - pkgs.vimExtraPlugins.telescope-bibtex-nvim - ]; - maps.normal = { - "ib" = { - desc = "[i]nsert a [b]atex citation"; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix deleted file mode 100644 index 0b1e033a..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - imports = [ - ./bibtex - ./frecency - ./fzy-native - ./rooter - ./symbols - ]; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix deleted file mode 100644 index 4a4c22be..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/frecency/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{...}: { - programs.nixvim = { - maps = { - normal = { - "gff" = { - action = "function() require('telescope').extensions.frecency.frecency() end"; - lua = true; - desc = "activate the frecency file selection"; - }; - }; - }; - plugins.telescope = { - extensions.frecency = { - enable = true; - showUnindexed = true; - showScores = true; - # TODO: add this: - #db_safe_mode = true; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix deleted file mode 100644 index ce0bdccc..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/fzy-native/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.extensions.fzy-native = { - enable = true; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/default.nix deleted file mode 100644 index 779448cc..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: { - programs.nixvim = { - extraConfigLuaPost = '' - ${lib.strings.fileContents ./lua/rooter.lua} - ''; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/lua/rooter.lua b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/lua/rooter.lua deleted file mode 100644 index eaf68ecf..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/rooter/lua/rooter.lua +++ /dev/null @@ -1,84 +0,0 @@ --- Taken from: https://github.com/desdic/telescope-rooter.nvim/blob/69423216c75a5f1f1477bbf8faf6b0dc8af04099/lua/telescope/_extensions/rooter.lua -local has_telescope, telescope = pcall(require, "telescope") -if not has_telescope then - error("This extension requires telescope.nvim") - return -end - -local has_plenary, plenary = pcall(require, "plenary") -if not has_plenary then - error("This extension requires plenary") - return -end - -local log = plenary.log.new({ plugin = "telescope_rooter"; level = "info"; }) - --- TODO: expose this function -local toggle = function(_) - vim.g["Telescope#rooter#enabled"] = not vim.g["Telescope#rooter#enabled"] - print("Telescope#rooter#enabled=" .. vim.inspect(vim.g["Telescope#rooter#enabled"])) -end - -local config = { patterns = { ".git"; }; enable = true; debug = false; } - --- default enabled -vim.g["Telescope#rooter#enabled"] = vim.F.if_nil(config.enable, true) - --- redefine log if debug enabled -if vim.F.if_nil(config.debug, false) then - log = plenary.log.new({ plugin = "telescope_rooter"; level = "debug"; }) -end - -local group = vim.api.nvim_create_augroup("TelescopeRooter", { clear = true; }) - -vim.api.nvim_create_autocmd({ "DirChangedPre"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - if vim.g["Telescope#rooter#oldpwd"] == nil then - vim.g["Telescope#rooter#oldpwd"] = vim.loop.cwd() - log.debug("before " .. vim.inspect(vim.loop.cwd())) - end - end; - group = group; -}) - -vim.api.nvim_create_autocmd({ "BufEnter"; "BufWinEnter"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype == "TelescopePrompt" then - local rootdir = vim.fs.dirname(vim.fs.find(config.patterns, { upward = true; })[1]) - if rootdir ~= nil then - vim.api.nvim_set_current_dir(rootdir) - log.debug("changing dir to " .. rootdir) - end - end - end) - end; - group = group; -}) - -vim.api.nvim_create_autocmd({ "BufWinLeave"; }, { - callback = function() - if vim.g["Telescope#rooter#enabled"] ~= true then - return - end - - vim.schedule(function() - if vim.bo.filetype ~= "TelescopePrompt" then - if vim.g["Telescope#rooter#oldpwd"] ~= nil then - log.debug("restoring " .. vim.g["Telescope#rooter#oldpwd"]) - vim.api.nvim_set_current_dir(vim.g["Telescope#rooter#oldpwd"]) - vim.g["Telescope#rooter#oldpwd"] = nil - end - end - end) - end; - group = group; -}) diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix deleted file mode 100644 index 1a679776..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/extensions/symbols/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{pkgs, ...}: { - programs.nixvim = { - extraPlugins = [ - # Source of symbols for telescope symbols - pkgs.vimExtraPlugins.telescope-symbols-nvim - ]; - maps = { - normal = { - "il" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'latex' - }} - end - ''; - lua = true; - desc = "[i]nsert a [l]atex symbol"; - }; - "ie" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - }} - end - ''; - lua = true; - desc = "[i]nsert a [e]moji"; - }; - "is" = { - action = '' - function() - require('telescope.builtin').symbols{ sources = { - 'emoji', - 'gitmoji', - 'julia', - 'kaomoji', - 'latex', - 'math', - 'nerd', - }} - end - ''; - lua = true; - desc = "[i]nsert a [s]ymbol (like emojis)"; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix deleted file mode 100644 index f0745f73..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/telescope/keymaps/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - programs.nixvim.plugins.telescope.keymaps = { - "rg" = { - action = "live_grep"; - desc = "[rg] in a live session"; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/todo-comments/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/todo-comments/default.nix deleted file mode 100644 index f4d2b1c9..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/todo-comments/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{...}: { - programs.nixvim.plugins.todo-comments = { - enable = true; - guiStyle = { - fg = "BOLD"; - bg = "NONE"; - }; - highlight = { - keyword = "wide_fg"; - }; - keywordds = { - /* - # Defaults: - FIX = { - icon = " "; # Icon used for the sign, and in search results. - color = "error"; # Can be a hex color, or a named color. - alt = ["FIXME" "BUG" "FIXIT" "ISSUE"]; # A set of other keywords that all map to this FIX keywords. - }; - TODO = { - icon = " "; - color = "info"; - }; - HACK = { - icon = " "; - color = "warning"; - }; - WARN = { - icon = " "; - color = "warning"; - alt = ["WARNING" "XXX"]; - }; - PERF = { - icon = " "; - alt = ["OPTIM" "PERFORMANCE" "OPTIMIZE"]; - }; - NOTE = { - icon = " "; - color = "hint"; - alt = ["INFO"]; - }; - TEST = { - icon = "⏲ "; - color = "test"; - alt = ["TESTING" "PASSED" "FAILED"]; - }; - */ - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/treesitter/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/treesitter/default.nix deleted file mode 100644 index 9d30d6b9..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/treesitter/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{...}: { - programs.nixvim.plugins.treesitter = { - enable = true; - - ensureInstalled = "all"; - indent = true; - - # inject nixvim specific highlighting (eg in extraConfigLua). - nixvimInjections = true; - - # TODO: It would we wonderfull, if we could use treesitter in latex - disabledLanguages = ["latex"]; - - /* - # TODO: this is not supported by the nixVim modlue, nixNeovim supports this though .. - highlight = { - # `false` will disable the whole extension - enable = true; - disable = ["latex"]; - - # Setting this to true will run `:h syntax` and tree-sitter at the same time. - # Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - # Using this option may slow down your editor; and you may see some duplicate highlights. - # Instead of true it can also be a list of languages - additionalVimRegexHighlighting = [""]; - }; - */ - - incrementalSelection = { - enable = true; - keymaps = { - # TODO: include these - initSelection = "gnn"; # set to `false` to disable one of the mappings - nodeIncremental = "grn"; - scopeIncremental = "grc"; - nodeDecremental = "grm"; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/vim-tex/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/vim-tex/default.nix deleted file mode 100644 index 9b5cea5e..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/vim-tex/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{...}: { - programs.nixvim = { - options.conceallevel = 0; - - # globals.tex_conceal = "abdmg"; - # globals.tex_flavor = "latex"; - - plugins.vimtex = { - enable = true; - extraConfig = { - view_method = "zathura"; - quickfix_mode = -1; - view_enabled = -1; - tex_conceal = "abdmg"; - tex_flavor = "latex"; - - # Useful if treesitter is the highlighter - #syntax_enabled = 0; - #syntax_conceal_disable = 1; - - mappings_disable = { - n = ["tsf" "tsc" "tse" "ts$" "tsd" "tsD"]; - x = ["tsd" "tsD" "tsf"]; - }; - - toc_config = { - name = "TOC"; - layers = ["content" "todo" "include"]; - resize = false; - split_width = 49; - todo_sorted = -1; - show_help = false; - show_numbers = false; - mode = true; - layer_keys = { - content = "C"; - label = "L"; - todo = "j"; - include = "I"; - }; - }; - - compiler_latexmk = { - build_dir = "build"; - callback = false; - continuous = true; - executable = "latexmk"; - hooks = []; - options = [ - "-verbose" - "-file-line-error" - "-synctex=0" - "-interaction=nonstopmode" - ]; - }; - }; - }; - }; -} diff --git a/home-manager/soispha/config/neovim/nixvim/plugins/which-key/default.nix b/home-manager/soispha/config/neovim/nixvim/plugins/which-key/default.nix deleted file mode 100644 index be63f7ac..00000000 --- a/home-manager/soispha/config/neovim/nixvim/plugins/which-key/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - programs.nixvim.plugins.which-key = { - enable = true; - }; -} diff --git a/home-manager/soispha/config/nheko/default.nix b/home-manager/soispha/config/nheko/default.nix deleted file mode 100644 index fd147c0b..00000000 --- a/home-manager/soispha/config/nheko/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - config, - nixosConfig, - lib, - ... -}: { - config = lib.mkIf nixosConfig.soispha.secrets.enable { - xdg.configFile."nheko/nheko.conf".source = config.lib.file.mkOutOfStoreSymlink nixosConfig.age.secrets.nheko.path; - programs.nheko = { - enable = true; - }; - }; -} diff --git a/home-manager/soispha/config/npm/.npmrc b/home-manager/soispha/config/npm/.npmrc deleted file mode 100644 index d0d846bd..00000000 --- a/home-manager/soispha/config/npm/.npmrc +++ /dev/null @@ -1,6 +0,0 @@ -scripts-prepend-node-path=true -node_gyp= -prefix=${XDG_DATA_HOME}/npm -cache=${XDG_CACHE_HOME}/npm -tmp=${XDG_RUNTIME_DIR}/npm -init-module=${XDG_CONFIG_HOME}/npm/config/npm-init.js diff --git a/home-manager/soispha/config/npm/default.nix b/home-manager/soispha/config/npm/default.nix deleted file mode 100644 index 7b4bb6a1..00000000 --- a/home-manager/soispha/config/npm/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."npm/.npmrc".source = ./.npmrc; -} diff --git a/home-manager/soispha/config/python/default.nix b/home-manager/soispha/config/python/default.nix deleted file mode 100644 index eeaccdcf..00000000 --- a/home-manager/soispha/config/python/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."python/pythonrc".source = ./pythonrc; -} diff --git a/home-manager/soispha/config/python/pythonrc b/home-manager/soispha/config/python/pythonrc deleted file mode 100644 index 38c48e0f..00000000 --- a/home-manager/soispha/config/python/pythonrc +++ /dev/null @@ -1,11 +0,0 @@ -import os -import atexit -import readline - -history = os.path.join(os.environ['XDG_CACHE_HOME'], 'python_history') -readline.read_history_file(history) - -def write_history(): - readline.write_history_file(history) - -atexit.register(write_history) diff --git a/home-manager/soispha/config/rclone/default.nix b/home-manager/soispha/config/rclone/default.nix deleted file mode 100644 index bd0c1ac2..00000000 --- a/home-manager/soispha/config/rclone/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."rclone/rclone.conf".source = ./rclone.conf; -} diff --git a/home-manager/soispha/config/rclone/rclone.conf b/home-manager/soispha/config/rclone/rclone.conf deleted file mode 100644 index 9e1c4f08..00000000 --- a/home-manager/soispha/config/rclone/rclone.conf +++ /dev/null @@ -1,10 +0,0 @@ -[vhack1] -type = sftp -host = server1.vhack.eu -user = soispha -key_use_agent = true -known_hosts_file = ~/.local/share/ssh/known_hosts -shell_type = unix -md5sum_command = md5sum -sha1sum_command = sha1sum - diff --git a/home-manager/soispha/config/ssh/default.nix b/home-manager/soispha/config/ssh/default.nix deleted file mode 100644 index 1359e4ab..00000000 --- a/home-manager/soispha/config/ssh/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{config, ...}: { - programs.ssh = { - enable = true; - compression = true; - hashKnownHosts = false; - serverAliveInterval = 240; - userKnownHostsFile = "${config.xdg.dataHome}/ssh/known_hosts"; - matchBlocks = { - "codeberg.org" = { - # TODO:: Remove this once they fix their ipv6 config - addressFamily = "inet"; - }; - }; - }; -} diff --git a/home-manager/soispha/config/swayidle/config b/home-manager/soispha/config/swayidle/config deleted file mode 100644 index 8ba07850..00000000 --- a/home-manager/soispha/config/swayidle/config +++ /dev/null @@ -1,5 +0,0 @@ -timeout 180 'swaylock -fFu' - -timeout 360 'systemctl suspend-then-hibernate' - -before-sleep 'swaylock -f' diff --git a/home-manager/soispha/config/swayidle/default.nix b/home-manager/soispha/config/swayidle/default.nix deleted file mode 100644 index 6b8a7d80..00000000 --- a/home-manager/soispha/config/swayidle/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - pkgs, - ... -}: { - xdg.configFile."swayidle/config".source = ./config; - - # services.swayidle = { - # enable = true; - # events = [ - # { - # event = "before-sleep"; - # command = "${pkgs.swaylock}/bin/swaylock -f "; - # } - # ]; - # timeouts = [ - # { - # timeout = 180; - # command = "${pkgs.swaylock}/bin/swaylock -fFu "; - # } - # { - # timeout = 360; - # # TODO: systemctl is installed? - # command = "systemctl suspend-then-hibernate"; - # } - # ]; - # # systemdTarget = ""; # TODO: this might be usefull - # }; -} diff --git a/home-manager/soispha/config/swaylock/commands.jpg b/home-manager/soispha/config/swaylock/commands.jpg deleted file mode 100644 index 54016503..00000000 Binary files a/home-manager/soispha/config/swaylock/commands.jpg and /dev/null differ diff --git a/home-manager/soispha/config/swaylock/default.nix b/home-manager/soispha/config/swaylock/default.nix deleted file mode 100644 index 7c3762cc..00000000 --- a/home-manager/soispha/config/swaylock/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{...}: { - programs.swaylock = { - enable = true; - settings = { - #image = "$WALLPAPER"; - image = "${./commands.jpg}"; - color = "000000"; - }; - }; -} diff --git a/home-manager/soispha/config/swaylock/gnu.png b/home-manager/soispha/config/swaylock/gnu.png deleted file mode 100644 index d07dee3e..00000000 Binary files a/home-manager/soispha/config/swaylock/gnu.png and /dev/null differ diff --git a/home-manager/soispha/config/tridactyl/config.vim b/home-manager/soispha/config/tridactyl/config.vim deleted file mode 100644 index 84e290cb..00000000 --- a/home-manager/soispha/config/tridactyl/config.vim +++ /dev/null @@ -1,47 +0,0 @@ -" vim: filetype=vim - -" This wipes all existing settings. This means that if a setting in this file -" is removed, then it will return to default. In other words, this file serves -" as an enforced single point of truth for Tridactyl's configuration. -sanitize tridactyllocal tridactylsync - -" Just use a blank page for new tab. It would be nicer to use the standard -" Firefox homepage, but Tridactyl doesn't support this yet. -"TODO: use custome file -"set newtab file:///home/soispha/new.html - -" Set a nice colorscheme -colorscheme midnight - -" Delete temp files after use -alias editor_rm composite editor | jsb -p tri.native.run(`rm -f '${JS_ARG[0]}'`) -bind --mode=insert editor_rm -bind --mode=input editor_rm - -" Use vim in tmux for editor. -set editorcmd alacritty -e nvim - -" Ctrl-F should use the browser's native 'find' functionality. -unbind - -" But also support Tridactyl search too. -bind / fillcmdline find -bind ? fillcmdline find -? -bind l findnext 1 -bind L findnext -1 -" Remove search highlighting. -bind , nohlsearch -" Use sensitive case. Smart case would be nice here, but it doesn't work. -set findcase smartcase - -" Smooth scrolling, yes please. This is still a bit janky in Tridactyl. -set smoothscroll true - -" The default jump of 10 is a bit much. -bind t scrollline 5 -bind n scrollline -5 - -" K and J should move between tabs. x should close them. -bind T tabprev -bind N tabnext -bind x tabclose diff --git a/home-manager/soispha/config/tridactyl/default.nix b/home-manager/soispha/config/tridactyl/default.nix deleted file mode 100644 index 23307cfe..00000000 --- a/home-manager/soispha/config/tridactyl/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - xdg.configFile."tridactyl/tridactylrc".source = ./config.vim; -} diff --git a/home-manager/soispha/config/yambar/config/config.yml b/home-manager/soispha/config/yambar/config/config.yml deleted file mode 100644 index bb742fd3..00000000 --- a/home-manager/soispha/config/yambar/config/config.yml +++ /dev/null @@ -1,234 +0,0 @@ ---- -# Config file for yambar -# Note that this may be version-dependent, this file is written for v1.8.0 - - -# Font anchors -font-main: &fontmain Source Code Pro:pixelsize=26 -font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=23 - -# Color anchors -fg-none: &fgnone 00000000 -fg-1: &fg1 c6ceefff -fg-blue: &fgblue 99d1dbff -fg-sapphire: &fgsapp 74c7ecdd -fg-green: &fggreen a6e3a1dd -fg-peach: &fgpeach fab387dd -fg-mauve: &fgmauve cba6f7dd -fg-teal: &fgteal 94e2d5dd -fg-lavendar: &fglav b4befedd -fg-focus: &fgfocus e78284ff -bg-1: &bg1 303446ff -bg-tag: &bgtag 585b70ff -bg-tag2: &bgtag2 45475aff -bg-urgent: &bgurgent e78284ff - -# Background blocks -background-block: &bgcblock {background: {color: *bg1 }} -background-block-urgent: &bgcurg {background: {color: *bgurgent }} - -# Underlines -underline-focused: &line {underline: { size: 3, color: *fgfocus}} -underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} -underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} -underline-resources: &linemem {underline: { size: 3, color: *fggreen}} -underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} -underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} -underline-weather: &linewea {underline: { size: 3, color: *fglav}} -underline-title: &linetitle {underline: { size: 3, color: *bgtag}} - -# Combined decorations -combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} -combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} -combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} -combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} -combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} - - -### Main - -bar: - location: top - height: 45 - layer: bottom - spacing: 0 - margin: 10 - border: {margin: 0, top-margin: 10} - foreground: *fg1 - background: *fgnone - font: *fontmain - - ### Left, river tags - left: - - river: - anchors: - - id: &name { text: "{id}" } - - string: &focus { stack: [ {background: {color: *bg1}} ] } - - string: &normal { string: { <<: *name, margin: 10 } } - - string: - &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } - - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } - - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - base: &river_base - default: *normal - conditions: - state == focused: *focused - state == unfocused: *unfocused - state == urgent: *urgent - state == invisible: - map: - conditions: - occupied: *occupied - ~occupied: *normal - content: - map: - on-click: - left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" - right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" - middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" - conditions: - id == 1: { map: { <<: *river_base } } - id == 2: { map: { <<: *river_base } } - id == 3: { map: { <<: *river_base } } - id == 4: { map: { <<: *river_base } } - id == 5: { map: { <<: *river_base } } - id == 6: { map: { <<: *river_base } } - id == 7: { map: { <<: *river_base } } - id == 8: { map: { <<: *river_base } } - id == 9: { map: { <<: *river_base } } - title: - map: - default: - { - string: - { - text: "{title}", - left-margin: 12, - right-margin: 12, - # max: 35, - deco: *linetitle - }, - } - conditions: - title == "": { string: { text: "" } } - - ### Center, clock & weather gadget - center: - - clock: - time-format: "%H:%M:%S %Z" - date-format: "%d/%m/%y (%a)" - foreground: *fgblue - content: - string: - text: " {date} {time} " - deco: *combclock - - ### Right, system tray - right: - #- network: - # name: wlp5s0 - # poll-interval: 10 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: {empty: {}} - # carrier: - # string: {text: "  {ssid} ", deco: *combutil} - #- network: - # name: enp4s0 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: - # string: {text: "  Eth failed ", deco: *combutil} - # carrier: {empty: {}} - - - script: # Sound volume - path: @volume_script@ - content: - map: - on-click: /bin/sh -c "pavucontrol" - conditions: - muted: - string: - text: " ﱝ " - deco: *bgcurg - ~muted: - string: {text: "  {volume}% ", deco: *combutil} - - - script: # Grade average - path: @grade_average_script@ - content: - string: - text: "  {grade} " - deco: *combmem - - #- backlight: - # name: intel_backlight - # content: - # - string: {text: "  {percent}% ", deco: *combutil} - - - script: # CPU - path: @cpu_script@ - content: - string: - text: "  {cpu}% " - deco: *combmem - - - script: # Memory info - path: @memory_script@ - content: - map: - conditions: - swapstate: - string: - text: "  {memperc}%({swapperc}%) " - deco: *combmem - ~swapstate: - string: - text: "  {memperc}% " - deco: *combmem - - script: # Disk space - path: @disk_script@ - content: - string: - text: "  {diskspace}({diskperc})" - deco: *combmem - #- battery: - # name: BAT0 - # poll-interval: 30 - # content: - # list: - # items: - # - ramp: - # tag: capacity - # items: - # - string: - # text: "  {capacity}%({estimate}) " - # deco: *bgcurg - # - string: - # text: "  {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: "  {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: "  {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - # - string: - # text: "  {capacity}%({estimate}) " - # deco: {stack: [ <<: *bgcblock, <<: *linebat]} - #- script: # tray - # path: /home/dt/.config/yambar/scripts/yambar-tray - # content: - # empty: {} - #- script: - # path: /home/dt/.config/yambar/scripts/yambar-tray-width - # poll-interval: 10 - # content: - # string: - # text: "{padding}" - # deco: *combmem diff --git a/home-manager/soispha/config/yambar/config/laptop.yml b/home-manager/soispha/config/yambar/config/laptop.yml deleted file mode 100644 index 805ffe5b..00000000 --- a/home-manager/soispha/config/yambar/config/laptop.yml +++ /dev/null @@ -1,234 +0,0 @@ ---- -# Config file for yambar -# Note that this may be version-dependent, this file is written for v1.8.0 - - -# Font anchors -font-main: &fontmain Source Code Pro:pixelsize=22 -font-aws: &awesome Font Awesome 5 Free:style=solid:pixelsize=20 - -# Color anchors -fg-none: &fgnone 00000000 -fg-1: &fg1 c6ceefff -fg-blue: &fgblue 99d1dbff -fg-sapphire: &fgsapp 74c7ecdd -fg-green: &fggreen a6e3a1dd -fg-peach: &fgpeach fab387dd -fg-mauve: &fgmauve cba6f7dd -fg-teal: &fgteal 94e2d5dd -fg-lavendar: &fglav b4befedd -fg-focus: &fgfocus e78284ff -bg-1: &bg1 303446ff -bg-tag: &bgtag 585b70ff -bg-tag2: &bgtag2 45475aff -bg-urgent: &bgurgent e78284ff - -# Background blocks -background-block: &bgcblock {background: {color: *bg1 }} -background-block-urgent: &bgcurg {background: {color: *bgurgent }} - -# Underlines -underline-focused: &line {underline: { size: 3, color: *fgfocus}} -underline-urgent: &lineurgent {underline: { size: 3, color: *fgblue}} -underline-utils: &lineutil {underline: { size: 3, color: *fgpeach}} -underline-resources: &linemem {underline: { size: 3, color: *fggreen}} -underline-battery: &linebat {underline: { size: 3, color: *fgsapp}} -underline-clock: &lineclock {underline: { size: 3, color: *fgteal}} -underline-weather: &linewea {underline: { size: 3, color: *fglav}} -underline-title: &linetitle {underline: { size: 3, color: *bgtag}} - -# Combined decorations -combination-utils: &combutil {stack: [ <<: *bgcblock, <<: *lineutil]} -combination-resources: &combmem {stack: [ <<: *bgcblock, <<: *linemem]} -combination-battery: &combbat {stack: [ <<: *bgcblock, <<: *linebat]} -combination-clock: &combclock {stack: [ <<: *bgcblock, <<: *lineclock]} -combination-weather: &combwea {stack: [ <<: *bgcblock, <<: *linewea]} - - -### Main - -bar: - location: top - height: 25 - layer: bottom - spacing: 0 - margin: 10 - border: {margin: 0, top-margin: 5} - foreground: *fg1 - background: *fgnone - font: *fontmain - - ### Left, river tags - left: - - river: - anchors: - - id: &name { text: "{id}" } - - string: &focus { stack: [ {background: {color: *bg1}} ] } - - string: &normal { string: { <<: *name, margin: 10 } } - - string: - &occupied { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - string: &urgent { string: { <<: *name, deco: {stack: [background: {color: *bgurgent}, <<: *lineurgent]}, margin: 10 } } - - string: &focused { string: { <<: *name, deco: {stack: [background: {color: *bgtag}, <<: *line]}, margin: 10 } } - - string: &unfocused { string: { <<: *name, deco: {background: {color: *bgtag2}}, margin: 10 } } - - base: &river_base - default: *normal - conditions: - state == focused: *focused - state == unfocused: *unfocused - state == urgent: *urgent - state == invisible: - map: - conditions: - occupied: *occupied - ~occupied: *normal - content: - map: - on-click: - left: sh -c "riverctl set-focused-tags $((1 << ({id} - 1)))" - right: sh -c "riverctl toggle-focused-tags $((1 << ({id} -1)))" - middle: sh -c "riverctl toggle-view-tags $((1 << ({id} -1)))" - conditions: - id == 1: { map: { <<: *river_base } } - id == 2: { map: { <<: *river_base } } - id == 3: { map: { <<: *river_base } } - id == 4: { map: { <<: *river_base } } - id == 5: { map: { <<: *river_base } } - id == 6: { map: { <<: *river_base } } - id == 7: { map: { <<: *river_base } } - id == 8: { map: { <<: *river_base } } - id == 9: { map: { <<: *river_base } } - title: - map: - default: - { - string: - { - text: "{title}", - left-margin: 12, - right-margin: 12, - # max: 35, - deco: *linetitle - }, - } - conditions: - title == "": { string: { text: "" } } - - ### Center, clock & weather gadget - center: - - clock: - time-format: "%H:%M:%S %Z" - date-format: "%d/%m/%y (%a)" - foreground: *fgblue - content: - string: - text: " {date} {time} " - deco: *combclock - - ### Right, system tray - right: - #- network: - # name: wlp5s0 - # poll-interval: 10 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: {empty: {}} - # carrier: - # string: {text: "  {ssid} ", deco: *combutil} - #- network: - # name: enp4s0 - # content: - # map: - # on-click: /bin/sh -c "nmtui" - # conditions: - # ~carrier: - # string: {text: "  Eth failed ", deco: *combutil} - # carrier: {empty: {}} - - - script: # Sound volume - path: @volume_script@ - content: - map: - on-click: /bin/sh -c "pavucontrol" - conditions: - muted: - string: - text: " ﱝ " - deco: *bgcurg - ~muted: - string: {text: "  {volume}% ", deco: *combutil} - - - script: # Grade average - path: @grade_average_script@ - content: - string: - text: "  {grade} " - deco: *combmem - - - backlight: - name: @backlight@ - content: - - string: {text: "  {percent}% ", deco: *combutil} - - - script: # CPU - path: @cpu_script@ - content: - string: - text: "  {cpu}% " - deco: *combmem - - - script: # Memory info - path: @memory_script@ - content: - map: - conditions: - swapstate: - string: - text: "  {memperc}%({swapperc}%) " - deco: *combmem - ~swapstate: - string: - text: "  {memperc}% " - deco: *combmem - - script: # Disk space - path: @disk_script@ - content: - string: - text: "  {diskspace}({diskperc})" - deco: *combmem - - battery: - name: BAT0 - poll-interval: 300 - content: - list: - items: - - ramp: - tag: capacity - items: - - string: - text: "  {capacity}%({estimate}) " - deco: *bgcurg - - string: - text: "  {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: "  {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: "  {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - - string: - text: "  {capacity}%({estimate}) " - deco: {stack: [ <<: *bgcblock, <<: *linebat]} - #- script: # tray - # path: /home/dt/.config/yambar/scripts/yambar-tray - # content: - # empty: {} - #- script: - # path: /home/dt/.config/yambar/scripts/yambar-tray-width - # poll-interval: 10 - # content: - # string: - # text: "{padding}" - # deco: *combmem diff --git a/home-manager/soispha/config/yambar/default.nix b/home-manager/soispha/config/yambar/default.nix deleted file mode 100644 index 0bcf8419..00000000 --- a/home-manager/soispha/config/yambar/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ - nixosConfig, - sysLib, - system, - pkgs, - grades, - yambar_cpu, - yambar_memory, - ... -}: let - makeScript = { - file, - dependencies, - ... - }: - sysLib.writeShellScriptWithLibrary { - name = "${builtins.baseNameOf file}"; - src = file; - dependencies = dependencies ++ (builtins.attrValues {inherit (pkgs) dash;}); - } - + "/bin/${builtins.baseNameOf file}"; -in { - xdg.configFile."yambar/config.yml".source = pkgs.substituteAll { - src = - if nixosConfig.soispha.laptop.enable - then ./config/laptop.yml - else ./config/config.yml; - - backlight = - if nixosConfig.soispha.laptop.enable - then nixosConfig.soispha.laptop.backlight - else ""; - volume_script = makeScript { - dependencies = builtins.attrValues {inherit (pkgs) pulseaudio gawk coreutils;}; - file = ./scripts/sound-volume; - }; - grade_average_script = makeScript { - dependencies = - [ - grades.outputs.packages.${system}.default - ] - ++ (builtins.attrValues {inherit (pkgs) coreutils gawk;}); - file = ./scripts/grades-average; - }; - cpu_script = yambar_cpu.app.${system}.default.program; - memory_script = yambar_memory.app.${system}.default.program; - - disk_script = makeScript { - dependencies = builtins.attrValues {inherit (pkgs) gawk btrfs-progs coreutils;}; - file = ./scripts/disk; - }; - }; -} diff --git a/home-manager/soispha/config/yambar/scripts/disk b/home-manager/soispha/config/yambar/scripts/disk deleted file mode 100755 index 83b23ad9..00000000 --- a/home-manager/soispha/config/yambar/scripts/disk +++ /dev/null @@ -1,22 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -# Main loop -while true; do - # vars - used_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) - all_space=$(btrfs filesystem usage /srv 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") - - - # Check space available (4) and percentage used (5) - spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') - - echo "diskspace|string|$used_space" - echo "diskperc|string|$spaceperc" - echo "" - sleep 1 -done - -# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/grades-average b/home-manager/soispha/config/yambar/scripts/grades-average deleted file mode 100755 index 20de5684..00000000 --- a/home-manager/soispha/config/yambar/scripts/grades-average +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -while true; do - grade="$(grades list average | awk '{print $2}')"; - - echo "grade|string|$grade"; - echo ""; - - sleep 1; -done - -# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/network b/home-manager/soispha/config/yambar/scripts/network deleted file mode 100755 index 8e02d6dc..00000000 --- a/home-manager/soispha/config/yambar/scripts/network +++ /dev/null @@ -1,47 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -retest=120 -retest_if_con_fails=10 -backend=nmcli - -case "$backend" in - "nmcli") # Test for connectivity with nmcli - while true; do - connection_status=$(nmcli networking connectivity) - if [ "$connection_status" = "full" ]; then - echo "internet|string|Connected" - echo "" - sleep $retest - else - echo "internet|string|Disconnected" - echo "" - sleep $retest_if_con_fails - fi - done - ;; - "ping") # Test for connectivity with ping - ip_address='8.8.8.8' - ping_number=3 - - while true; do - - ping_result=$(mktmp) - ping $ip_address -c $ping_number -q | awk 'BEGIN {FS="/"} END {print $5}' > "$ping_result" - - if [ "$(cat "$ping_result" | wc -l)" -eq 0 ]; then - echo "med|string|No connection" - echo "" - sleep $retest_if_con_fails - else - echo "med|string|$(cat "$ping_result") ms" - echo "" - sleep $retest - fi - done - ;; -esac - -# vim: ft=sh diff --git a/home-manager/soispha/config/yambar/scripts/old/amixer-monitor b/home-manager/soispha/config/yambar/scripts/old/amixer-monitor deleted file mode 100755 index 9e75acfa..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/amixer-monitor +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# An improved amixer script that actually detects volume beyond 100% - - -SLEEPTIME=1 - - -while true; do - - volume=$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/"} {print $2 }' | tr -d "%" | tr -d ' ') - - if [ "$volume" -eq 0 ]; then - echo "muted|bool|true" - - else - # Read sink volume in percentages - echo "volume|string|$volume" - echo "muted|bool|false" - fi - - echo "" - sleep "$SLEEPTIME" - -done diff --git a/home-manager/soispha/config/yambar/scripts/old/cpu b/home-manager/soispha/config/yambar/scripts/old/cpu deleted file mode 100755 index bae820d0..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/cpu +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash -# I didn't write this script; this is almost directly copied from the dnkl/yambar github. - - -# cpu.sh - measures CPU usage at a configurable sample interval -# -# Usage: cpu.sh INTERVAL_IN_SECONDS -# -# This script will emit the following tags on stdout (N is the number -# of logical CPUs): -# -# Name Type -# -------------------- -# cpu range 0-100 -# cpu0 range 0-100 -# cpu1 range 0-100 -# ... -# cpuN-1 range 0-100 -# -# I.e. ‘cpu’ is the average (or aggregated) CPU usage, while cpuX is a -# specific CPU’s usage. -# -# Example configuration (update every second): -# -# - script: -# path: /path/to/cpu.sh -# args: [1] -# content: {string: {text: "{cpu}%"}} -# - -interval=2 - -case ${interval} in - ''|*[!0-9]*) - echo "interval must be an integer" - exit 1 - ;; - *) - ;; -esac - -# Get number of CPUs, by reading /proc/stat -# The output looks like: -# -# cpu A B C D ... -# cpu0 A B C D ... -# cpu1 A B C D ... -# cpuN A B C D ... -# -# The first line is a summary line, accounting *all* CPUs -IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) -cpu_count=$((${#all_cpu_stats[@]} - 1)) - -# Arrays of ‘previous’ idle and total stats, needed to calculate the -# difference between each sample. -prev_idle=() -prev_total=() -for i in $(seq ${cpu_count}); do - prev_idle+=(0) - prev_total+=(0) -done - -prev_average_idle=0 -prev_average_total=0 - -while true; do - IFS=$'\n' readarray -t all_cpu_stats < <(grep -e "^cpu" /proc/stat) - - usage=() # CPU usage in percent, 0 <= x <= 100 - - average_idle=0 # All CPUs idle time since boot - average_total=0 # All CPUs total time since boot - - for i in $(seq 0 $((cpu_count - 1))); do - # Split this CPUs stats into an array - stats=($(echo "${all_cpu_stats[$((i + 1))]}")) - - # man procfs(5) - user=${stats[1]} - nice=${stats[2]} - system=${stats[3]} - idle=${stats[4]} - iowait=${stats[5]} - irq=${stats[6]} - softirq=${stats[7]} - steal=${stats[8]} - guest=${stats[9]} - guestnice=${stats[10]} - - # Guest time already accounted for in user - user=$((user - guest)) - nice=$((nice - guestnice)) - - idle=$((idle + iowait)) - - total=$((user + nice + system + irq + softirq + idle + steal + guest + guestnice)) - - average_idle=$((average_idle + idle)) - average_total=$((average_total + total)) - - # Diff since last sample - diff_idle=$((idle - prev_idle[i])) - diff_total=$((total - prev_total[i])) - - usage[i]=$((100 * (diff_total - diff_idle) / diff_total)) - - prev_idle[i]=${idle} - prev_total[i]=${total} - done - - diff_average_idle=$((average_idle - prev_average_idle)) - diff_average_total=$((average_total - prev_average_total)) - - average_usage=$((100 * (diff_average_total - diff_average_idle) / diff_average_total)) - - prev_average_idle=${average_idle} - prev_average_total=${average_total} - - echo "cpu|range:0-100|${average_usage}" - for i in $(seq 0 $((cpu_count - 1))); do - echo "cpu${i}|range:0-100|${usage[i]}" - done - - echo "" - sleep "${interval}" -done diff --git a/home-manager/soispha/config/yambar/scripts/old/dfspace b/home-manager/soispha/config/yambar/scripts/old/dfspace deleted file mode 100755 index 0b262481..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/dfspace +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# Sleep seconds -timer="60" - -# Main loop -while true; do - - # vars - used_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Used:/ ) { print $2 } } ' | head -n1) - all_space=$(btrfs filesystem usage / 2> /dev/null | awk '{if ( /Device size:/ ) { print $3 } } ' | head -n1 | tr -d "GiB") - - - # Check space available (4) and percentage used (5) - spaceperc=$(echo "$(echo "$used_space" | tr -d "GiB" )" "$all_space" | awk '{div=$1/$2;div *= 100; printf"%2d%%\n",div }') - - echo "diskspace|string|$used_space" - echo "diskperc|string|$spaceperc" - echo "" - sleep $timer - -done - diff --git a/home-manager/soispha/config/yambar/scripts/old/grades-average b/home-manager/soispha/config/yambar/scripts/old/grades-average deleted file mode 100755 index a04b958c..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/grades-average +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. ~/.local/lib/shell/lib - -grade=$(grades list average | awk '{print $2}'); - -echo "grade|string|$grade"; -echo ""; - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/soispha/config/yambar/scripts/old/meminfo b/home-manager/soispha/config/yambar/scripts/old/meminfo deleted file mode 100755 index 0156e94c..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/meminfo +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh -# Checks memory usage - -# Number of seconds to retest -timer=5 - -# Main loop -while true; do - - mem_total=$(LANG=C free -b|awk '/^Mem:/{print $2}') - mem_used=$(LANG=C free -b|awk '/^Mem:/{print $3}') - swap_total=$(LANG=C free -b|awk '/^Swap:/{print $2}') - swap_used=$(LANG=C free -b|awk '/^Swap:/{print $3}') - - - memperc=$(echo "$mem_used" "$mem_total" | awk '{ div = 100 * ($1 / $2)} { printf "%.0f ", div }' | tr -d ' ' ) - swapperc=$(echo "$swap_used" "$swap_total" | awk '{ - if ( $1 == 0 || $2 == 0 ) { - print "%" - } else { - div = 100 * ($1 / $2); - printf "%.0f ", div -} -}' | tr -d ' ' ) - - -echo "memperc|string|$memperc" -if [ "$swapperc" = "%" ];then - echo "swapstate|bool|false" -else - echo "swapperc|string|$swapperc" - echo "swapstate|bool|true" -fi -echo "" -sleep "$timer" - -done diff --git a/home-manager/soispha/config/yambar/scripts/old/nmclitest b/home-manager/soispha/config/yambar/scripts/old/nmclitest deleted file mode 100755 index 3e8bc73a..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/nmclitest +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -# Test for connectivity with nmcli - -Timer=${1:-120} # Number of seconds to retest -Timer2=${2:-10} # Number of seconds to retest if connection fails - -# Main loop -while true; do - - CONN=$(nmcli networking connectivity) - - if [[ "$CONN" == "full" ]]; then - echo "internet|string|Connected" - echo "" - sleep $Timer - else - echo "internet|string|Disconnected" - echo "" - sleep $Timer2 - fi - -done - diff --git a/home-manager/soispha/config/yambar/scripts/old/pingtest b/home-manager/soispha/config/yambar/scripts/old/pingtest deleted file mode 100755 index 2b5f9998..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/pingtest +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# Test for connectivity with ping - -Timer=${1:-120} # Number of seconds to retest -Timer2=${2:-10} # Number of seconds to retest if connection fails -IP=${3:-'8.8.8.8'} # IP address to test, defaults to Google -PCount=${4:-3} # Number of pings to send - -# Main loop -while true; do - - # Pings the IP address for five times - PINGSTR=$(ping $IP -c $PCount -q) - # Use text formatting to get min/max ms delays - MED=$(echo $PINGSTR | sed 's/min\/avg\/max\/mdev = /\n/g' | tail -n 1 | sed 's/\//\t/g' | cut -f2) - - if [[ "$MED" == "" ]]; then - echo "med|string|No connection" - echo "" - sleep $Timer2 - else - echo "med|string|$MED ms" - echo "" - sleep $Timer - fi - -done - diff --git a/home-manager/soispha/config/yambar/scripts/old/yambar-tray b/home-manager/soispha/config/yambar/scripts/old/yambar-tray deleted file mode 100755 index 1704c6dd..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/yambar-tray +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - - -pkill stalonetray -pkill trayer - -# launch a tray. -echo - -sleep 0.1 # make sure yambar starts first so we can draw on tpo of it - -# trayer-srg fork! -trayer \ - --edge top \ - --tint 0x24242400 \ - --align right \ - --height 20 \ - --expand false \ - --transparent true \ - --alpha 0 \ - --width 20 \ - --monitor primary \ - --widthtype request - # &>/dev/null - - - diff --git a/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width b/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width deleted file mode 100755 index 00544e70..00000000 --- a/home-manager/soispha/config/yambar/scripts/old/yambar-tray-width +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# shellcheck disable=SC2086 -# shellcheck source=/dev/null -. ~/.local/lib/shell/lib - - -CHARWIDTH=8 # i guess? - -tray_width_px() { - xwininfo -name panel | # trayer names its window "panel" - grep -i width: | - awk '{print $2}' -} - -px_to_spaces() { - spaces="$((1 + ${1:-0} / $CHARWIDTH))" - printf "% *s\n" $spaces -} - -sleep 0.2 # be sure trayer is already up - -output="$(px_to_spaces `tray_width_px`)" -echo "padding|string|$output" -echo "" - - - -if [ -d /tmp/LIB_FILE_TEMP_DIR/ ];then rm -r /tmp/LIB_FILE_TEMP_DIR/; fi diff --git a/home-manager/soispha/config/yambar/scripts/sound-volume b/home-manager/soispha/config/yambar/scripts/sound-volume deleted file mode 100755 index 8494cbd5..00000000 --- a/home-manager/soispha/config/yambar/scripts/sound-volume +++ /dev/null @@ -1,20 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -while true; do - volume="$(pactl get-sink-volume 0 | awk 'BEGIN { FS="/" } {gsub("%","",$2); gsub(" ","",$2)} {printf $2}')" - - if [ "$volume" -eq 0 ]; then - echo "muted|bool|true" - else - echo "volume|string|$volume" - echo "muted|bool|false" - fi - echo "" - - sleep 1; -done - -# vim: ft=sh diff --git a/home-manager/soispha/config/zsh/config/custom_cursor.sh b/home-manager/soispha/config/zsh/config/custom_cursor.sh deleted file mode 100644 index 9a6da012..00000000 --- a/home-manager/soispha/config/zsh/config/custom_cursor.sh +++ /dev/null @@ -1,40 +0,0 @@ -# Change cursor shape for different vi modes. -function zle-keymap-select { - if [[ ${KEYMAP} == vicmd ]] || - [[ $1 = 'block' ]]; then - echo -ne '\e[1 q' - elif [[ ${KEYMAP} == main ]] || - [[ ${KEYMAP} == viins ]] || - [[ ${KEYMAP} = '' ]] || - [[ $1 = 'beam' ]]; then - echo -ne '\e[5 q' - fi -} -zle -N zle-keymap-select - -# ci", ci', ci`, di", etc -autoload -U select-quoted -zle -N select-quoted -for m in visual viopp; do - for c in {a,i}{\',\",\`}; do - bindkey -M $m $c select-quoted - done -done - -# ci{, ci(, ci<, di{, etc -autoload -U select-bracketed -zle -N select-bracketed -for m in visual viopp; do - for c in {a,i}${(s..)^:-'()[]{}<>bB'}; do - bindkey -M $m $c select-bracketed - done -done - -zle-line-init() { - zle -K viins # initiate `vi insert` as keymap (can be removed if `bindkey -V` has been set elsewhere) - echo -ne "\e[5 q" -} -zle -N zle-line-init - -echo -ne '\e[5 q' # Use beam shape cursor on startup. -precmd() { echo -ne '\e[5 q' ;} # Use beam shape cursor for each new prompt. diff --git a/home-manager/soispha/config/zsh/config/zsh-init.sh b/home-manager/soispha/config/zsh/config/zsh-init.sh deleted file mode 100644 index 4d54d058..00000000 --- a/home-manager/soispha/config/zsh/config/zsh-init.sh +++ /dev/null @@ -1,39 +0,0 @@ -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -# Flex on the ubuntu users -[ "$NVIM" ] || hyfetch -#loginctl show-session $XDG_SESSION_ID - -## Enable colors and change prompt: -#autoload -Uz colors && colors -#autoload -Uz compinit && compinit -u -## Edit line in vim buffer ctrl-v -autoload -Uz edit-command-line; zle -N edit-command-line -## Enter vim buffer from normal mode -#autoload -Uz edit-command-line && zle -N edit-command-line -bindkey "^V" edit-command-line - -## zstyles -#zstyle ':completion:*' menu select -## Auto complete with case insensitivity -#zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' - -#zmodload zsh/complist -#fpath+=/home/dt/.config/zsh/comp -#compinit -#_comp_options+=(globdots) # Include hidden files. -# -## Source configs -#source "${ZDOTDIR}/ali.sh" -#source "${ZDOTDIR}/prompt.sh" -#source "${ZDOTDIR}/hotkeys.sh" -#source "./${path_custom_cursor}" -#source ~/.local/lib/shell/lib -# -## Load zsh-syntax-highlighting -#source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -## Suggest aliases for commands -#source /usr/share/zsh/plugins/zsh-you-should-use/you-should-use.plugin.zsh -# -##eval "$(lua ~/scripts/z.lua --init zsh enhanced)" diff --git a/home-manager/soispha/config/zsh/config/zsh-prompt.sh b/home-manager/soispha/config/zsh/config/zsh-prompt.sh deleted file mode 100644 index 26d478ef..00000000 --- a/home-manager/soispha/config/zsh/config/zsh-prompt.sh +++ /dev/null @@ -1,63 +0,0 @@ -#vim:ft=zsh -_command_time_preexec() { - timer=${timer:-$SECONDS} -} - -_command_time_precmd() { - PROMPT_TMP_DIR=$(mktemp) - if [ $timer ]; then - ts=$(($SECONDS - $timer)) - tts=$ts - mi=0 - ho=0 - if [ $ts -ge 3 ];then - while [ $ts -ge 60 ];do - ts=$((ts-60)) - mi=$((mi+1)) - done - - while [ $mi -ge 60 ];do - mi=$((mi-60)) - ho=$((ho+1)) - done - - if [ $tts -ge 3600 ];then - out=$(printf '%dh %dm %ds\n' $ho $mi $ts) - elif [ $tts -ge 60 ];then - out=$(printf '%dm %ds\n' $mi $ts) - elif [ $tts -lt 60 ];then - out=$(printf '%ds\n' $ts) - fi - - export psvar[1]="took $(printf '%s ' "$out")" - echo $psvar[1] > $PROMPT_TMP_DIR - fi - - unset timer - unset ts - unset tts - unset mi - unset ho -fi -} - -_command_ro_precmd() { -if ! [ -w $(pwd) ];then - echo " " -fi -} - -preexec_functions+=(_command_time_preexec) -precmd_functions+=(_command_time_precmd) - -blue="14" -red="9" -white="15" -setopt PROMPT_SUBST -export PROMPT='%(?.%F{$blue}.%F{$red})%B%3~%(!. %F{$red}as root %f. )%F{$white}$(if [ -n $PROMPT_TMP_DIR ];then cat $PROMPT_TMP_DIR 2>/dev/null; rm $PROMPT_TMP_DIR 2>/dev/null;fi)%f%(?.%F{$blue}.%F{$red})%F{$red}$(_command_ro_precmd)%F{$blue}❯ %b%f' -export RPROMPT='' - -#%(2V.%F{$red}%2v%f$(export psvar[2]="") .) - -# TODO:: -# Add git support diff --git a/home-manager/soispha/config/zsh/default.nix b/home-manager/soispha/config/zsh/default.nix deleted file mode 100644 index 11011977..00000000 --- a/home-manager/soispha/config/zsh/default.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ - config, - pkgs, - lib, - shell_library, - system, - osConfig, - ... -}: { - # TODO: ADD THIS ADDON - # next one only works if your alias is only a command, e.g. if you `alias='cat some_file.txt &2> /dev/null'`, running `cat some_file.txt` won't trigger it. - # TODO: find something better for this use case - # zsh-you-should-use # ZSH plugin that reminds you to use existing aliases for commands you just typed - home.sessionPath = []; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - enableCompletion = true; - syntaxHighlighting.enable = true; - - autocd = true; - - dotDir = ".config/zsh"; - - history = { - extended = true; - ignoreDups = false; - expireDuplicatesFirst = false; - ignoreSpace = false; # TODO: I might change that - - path = "${config.xdg.dataHome}/zsh/history"; - save = 9000000; # number of lines to save - size = 9000000; # number of lines to keep - share = false; # share between sessions - }; - historySubstringSearch = { - enable = true; - searchDownKey = "^[[B"; # DOWN Arrow key - searchUpKey = "^[[A"; # UP Arrow key - }; - - loginExtra = - '' - eval $(ssh-agent -s) > /dev/null # start ssh agent - '' - + lib.concatStringsSep "\nsetopt " [ - "setopt AUTO_CD" # This is needed as first item - "AUTO_PUSHD" - "CHASE_DOTS" - - "ALWAYS_TO_END" - - "EXTENDED_HISTORY" - "HIST_ALLOW_CLOBBER" - "HIST_VERIFY" - "HIST_FCNTL_LOCK" - "APPEND_HISTORY" - - "DVORAK" - "CORRECT" - - "PROMPT_SUBST" - "TRANSIENT_RPROMPT" # maybe? - - "COMBINING_CHARS" - "VI" - ]; - - initExtraFirst = - builtins.readFile ./config/zsh-init.sh - + builtins.readFile ./config/zsh-prompt.sh - + builtins.readFile ./config/custom_cursor.sh - + builtins.readFile "${pkgs.fzf}/share/fzf/key-bindings.zsh" - + "SHELL_LIBRARY_VERSION=\"1.1.4\" source ${shell_library.rawLib.${system}}"; - shellAliases = { - ll = ". ll"; - hisea = "history 0 | grep"; - }; - sessionVariables = { - EDITOR = "nvim"; - IVIEWER = "imv"; - READER = "zathura"; - VISUAL = "nvim"; - CODEEDITOR = "nvim"; - TERMINAL = "alacritty"; - BROWSER = "firefox"; - COLORTERM = "truecolor"; - PAGER = "less -R"; - WM = "river"; - WALLPAPER = "${config.home.homeDirectory}/media/pictures/wallpaper"; - - # FUNCNEST for more functions in functions - #FUNCNEST = "2000"; - - WALLPAPERDIR = "$HOME/media/pictures/wallpapers/"; - LESS = "R"; - MANPAGER = "less -R --use-color -Dd+r -Du+b"; - LIBVIRT_DEFAULT_URI = "qemu:///system"; - - BEMENU_SCALE = "1.5"; - BEMENU_BACKEND = "wayland"; - BEMENU_OPTS = "--fn 'Source Code Pro 10' -c -l 30 -B 1 -W 0.9 --hf #ffffff"; - - MPD_HOST = "/run/user/${builtins.toString osConfig.users.users.soispha.uid}/mpd/socket"; - - # Clean the home dir {{{ - CARGO_HOME = "${config.xdg.dataHome}/cargo"; - - #_JAVA_OPTIONS = lib.concatStringsSep " " [ - # ''-Djava.util.prefs.userRoot="${config.xdg.configHome}/java"'' - # ''-Djavafx.cachedir="${config.xdg.cacheHome}/openjfx"'' - # ]; - #GRADLE_USER_HOME = "${config.xdg.dataHome}/gradle"; - #GOPATH = "${config.xdg.dataHome}/go"; - #GTK2_RC_FILES = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - #LESSHISFILE = "${config.xdg.cacheHome}/less/history"; - #LESSKEYIN = "${config.xdg.configHome}/less/lesskey"; - #RUSTUP_HOME = "${config.xdg.dataHome}/rustup"; - #NPM_CONFIG_USERCONFIG = "${config.xdg.configHome}/npm/npmrc"; - #NUGET_PACKAGES = "${config.xdg.cacheHome}/NuGetPackages"; - #PYTHONSTARTUP = "${config.xdg.configHome}/python/pythonrc"; - #XAUTHORITY = "${config.xdg.stateHome}/Xauthority"; - #COMPDUMPFILE = "${config.xdg.dataHome}/zsh/.zcompdump}"; - #IPYTHONDIR = "${config.xdg.configHome}/ipython"; - #PARALLEL_HOME = "${config.xdg.configHome}/parallel"; - #STACK_XDG = "1"; - #WINEPREFIX = "${config.xdg.dataHome}/wine"; - # }}} - - # Export Wayland env Vars {{{ - QT_QPA_PLATFORM = "wayland"; - QT_QPA_PLATFORMTHEME = "qt5ct"; # needs qt5ct - CLUTTER_BACKEND = "wayland"; - SDL_VIDEODRIVER = "wayland"; # might brake some things - MOZ_ENABLE_WAYLAND = "1"; - # }}} - }; - }; -} diff --git a/home-manager/soispha/default.nix b/home-manager/soispha/default.nix deleted file mode 100644 index 59fd7138..00000000 --- a/home-manager/soispha/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - impermanence, - nixNeovim, - nixVim, - ... -}: let - # TODO: actually use this in the user config - username = "soispha"; - homeDirectory = "/home/${username}"; - - # xdg - configHome = "${homeDirectory}/.config"; - dataHome = "${homeDirectory}/.local/share"; - stateHome = "${homeDirectory}/.local/state"; - cacheHome = "${homeDirectory}/.cache"; - binHome = "${homeDirectory}/.local/bin"; - # TODO: add XDG_RUNTIME_DIR -in { - imports = [ - ./config - ./files - ./impermanence - ./packages - ./wms - - impermanence.nixosModules.home-manager.impermanence - nixNeovim.nixosModules.default - nixVim.homeManagerModules.nixvim - ]; - - # I don't know what this does, but I've seen it a lot online, so it should be good, right? - programs.home-manager.enable = true; - - home = { - inherit username homeDirectory; - stateVersion = "23.05"; - enableNixpkgsReleaseCheck = true; - }; - xdg = { - inherit configHome dataHome stateHome cacheHome; #binHome; # TODO: add binHome, when the standart is extended - enable = true; - - /* - TODO: add this - desktopEntries = {}; - */ - - userDirs = { - enable = true; - createDirectories = true; - desktop = null; - documents = "${homeDirectory}/school/general"; - download = "${homeDirectory}/media/downloads"; - music = "${homeDirectory}/media/music"; - pictures = "${homeDirectory}/media/pictures"; - videos = "${homeDirectory}/media/videos"; - templates = "${homeDirectory}/media/templates"; - publicShare = "${homeDirectory}/media/public"; - }; - }; -} diff --git a/home-manager/soispha/files/default.nix b/home-manager/soispha/files/default.nix deleted file mode 100644 index 4e16077c..00000000 --- a/home-manager/soispha/files/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{config, ...}: { - imports = [ - ./wallpaper - ]; -} diff --git a/home-manager/soispha/files/wallpaper/abstract-nord.png b/home-manager/soispha/files/wallpaper/abstract-nord.png deleted file mode 100644 index 5ef498bf..00000000 Binary files a/home-manager/soispha/files/wallpaper/abstract-nord.png and /dev/null differ diff --git a/home-manager/soispha/files/wallpaper/default.nix b/home-manager/soispha/files/wallpaper/default.nix deleted file mode 100644 index 2c9b3368..00000000 --- a/home-manager/soispha/files/wallpaper/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{config, ...}: { - home.file = { - wallpaper = { - source = ./abstract-nord.png; - target = "media/pictures/wallpaper"; - }; - }; -} diff --git a/home-manager/soispha/impermanence/default.nix b/home-manager/soispha/impermanence/default.nix deleted file mode 100644 index d0cd1ff1..00000000 --- a/home-manager/soispha/impermanence/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - lib, - nixosConfig, - ... -}: { - config = lib.mkIf nixosConfig.soispha.impermanence.enable { - home.persistence."/srv/home/soispha" = { - allowOther = true; - directories = [ - ".local/share" - - ".local/state/nvim" - ".local/state/wireplumber" - - ".config/Signal" - ".config/Element" - ".config/iamb/profiles" - - ".cache" - ".mozilla" - - "media" - "repos" - "school" - ]; - files = [ - ".local/state/lesshst" - ]; - }; - }; -} diff --git a/home-manager/soispha/packages/default.nix b/home-manager/soispha/packages/default.nix deleted file mode 100644 index c8135d21..00000000 --- a/home-manager/soispha/packages/default.nix +++ /dev/null @@ -1,164 +0,0 @@ -{ - pkgs, - sysLib, - grades, - snap-sync, - system, - flake_update, - ... -}: -with pkgs; let - snap-sync-pkgs = pkgs.writeShellScriptBin "snap-sync" (builtins.readFile "${snap-sync}/bin/snap-sync"); - shell-scripts = (import ./scripts.nix) {inherit pkgs sysLib;}; - - Gui = { - Terminals = [ - # foot # wayland native terminal - alacritty # default terminal - ]; - Browsers = [ - #ungoogled-chromium # web browser (only for web programming) - #brave - ]; - - ImageManipulation = [ - #krita # new, and better (KDE) - #gimp # conservative, and old (GNOME) - ]; - - Social = [ - mumble # voice chat software (client) - lutris # multiple game store clients - - # nheko # best matrix client (as of today) - # element-desktop # nheko didn't work - signal-desktop # to avoid encryption problems with signal-bridge - ]; - - Misc = [ - #kalzium # Periodic Table of Elements (`element` is [sort of] better) - keepassxc # password manager - #onlykey # OnlyKey Chrome Desktop App - anki-bin # spaced repetition - ]; - }; - - TuiCli = { - EyeCandy = [ - #banner # Print large banners to ASCII terminals - cmatrix # A curses-based scrolling 'Matrix'-like screen - hyfetch # Neofetch with LGBTQ pride flags. - ]; - - Social = [ - iamb # best tui matrix client (as of today) - ]; - - Misc = [ - android-file-transfer # Android MTP client with minimalistic UI - #xdg-ninja # A shell script which checks your $HOME for unwanted files and directories. - xdg-utils # open urls and such things - yokadi # Command line oriented, sqlite powered, todo list - killall # kill a application by name - ]; - - WM = { - river = [river]; # A dynamic tiling wayland compositor - - CLITools = [ - lswt # List Wayland toplevels - wl-clipboard # Command-line copy/paste utilities - swaylock # lockscreen - ]; - - Media = [ - wf-recorder # Screen recorder - ]; - }; - - Media = { - View = [ - imv # Image viewer - ]; - - Listen = [ - pulseaudio # set the volume with pactl - ncmpc # mpd player client - mpc-cli # a cli mpd client - ]; - }; - - Hardware = { - Storage = [ - #compsize # Calculate compression ratio of a set of files on Btrfs - # TODO: smartmontools # Control and monitor S.M.A.R.T. enabled ATA and SCSI Hard Drives - ]; - - Input = [ - #piper # GTK application to configure gaming mice - ]; - - Printer = [ - # TODO: sane-airscan # SANE - SANE backend for AirScan (eSCL) and WSD document scanners - ]; - }; - - FileListers = [ - tree # A directory listing program displaying a depth indented list of files - fd # Simple, fast and user-friendly alternative to find - ripgrep # A search tool that combines the usability of ag with the raw speed of grep - fzf # used to quickly move around with its keybindings - ]; - - Editors = [ - ed # A POSIX-compliant line-oriented text editor - #sed # GNU stream editor - vim # The original ex/vi text editor (this is `vim` and not `vi`, as `vi` is unfree) - #neovim # Fork of Vim aiming to improve user experience, plugins, and GUIs - ]; - - Programming = { - GeneralTools = [ - git # the fast distributed version control system - git-crypt # mostly here to avoid problems in repositories, where the flake can't be loaded - glow # Command-line markdown renderer - ]; - }; - }; - # TODO: unmaintained, find sth else: - # handlr # Powerful alternative to xdg-utils written in Rust - mapFun = x: - if builtins.isAttrs x - then - if lib.isDerivation x - then [x] - else builtins.attrValues x - else [x]; -in { - home.packages = - [ - snap-sync-pkgs - flake_update.outputs.packages.${system}.default - grades.outputs.packages.${system}.default - ] - ++ shell-scripts - ++ (with builtins; - concatLists - (concatLists [ - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (attrValues Gui))))))) - - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (concatMap mapFun - (attrValues TuiCli))))))) - ])); -} diff --git a/home-manager/soispha/packages/scripts.nix b/home-manager/soispha/packages/scripts.nix deleted file mode 100644 index 544975c5..00000000 --- a/home-manager/soispha/packages/scripts.nix +++ /dev/null @@ -1,97 +0,0 @@ -{ - pkgs, - sysLib, - ... -}: let - write_script = { - name, - path, - dependencies, - }: - sysLib.writeShellScriptWithLibrary { - inherit name; - src = ./scripts/${path}/${name}; - dependencies = dependencies ++ [pkgs.dash]; - }; - aumo-scr = write_script { - name = "aumo"; - path = "apps"; - dependencies = builtins.attrValues {inherit (pkgs) udisks gawk gnused gnugrep sudo;}; - }; - con2pdf-scr = write_script { - name = "con2pdf"; - path = "apps"; - dependencies = builtins.attrValues {inherit (pkgs) sane-backends imagemagick coreutils fd;}; - }; - - dldragon-scr = write_script { - name = "dldragon"; - path = "small_functions"; - dependencies = builtins.attrValues {inherit (pkgs) curl xdragon;}; - }; - gtk-themes-scr = write_script { - name = "gtk-themes"; - path = "small_functions"; - dependencies = builtins.attrValues {inherit (pkgs) glib;}; - }; - screen_shot-scr = write_script { - name = "screen_shot"; - path = "small_functions"; - dependencies = builtins.attrValues {inherit (pkgs) grim slurp alacritty;}; # TODO: add llp - }; - mocs-scr = write_script { - name = "mocs"; - path = "small_functions"; - dependencies = builtins.attrValues {inherit (pkgs) ncmpc procps;}; # TODO: add mymocp - }; - update-sys-scr = write_script { - name = "update-sys"; - path = "small_functions"; - dependencies = builtins.attrValues {inherit (pkgs) git git-crypt nixos-rebuild sudo openssh coreutils mktemp gnugrep gnused;}; - }; - - backsnap-scr = write_script { - name = "backsnap"; - path = "wrappers"; - dependencies = builtins.attrValues {}; # TODO: add snap-sync - }; - ll-scr = sysLib.writeShellScriptWithLibraryUnwrapped { - name = "ll"; - src = ./scripts/wrappers/ll; - }; - # TODO: this need to be replaced with a wayland alternative - # llp-scr = write_script { - # name = "llp"; - # path = "wrappers"; - # dependencies = builtins.attrValues {inherit (pkgs) lf ueberzug;}; - # }; - spodi-scr = write_script { - name = "spodi"; - path = "wrappers"; - dependencies = builtins.attrValues {inherit (pkgs) gawk expect spotdl fd coreutils;}; - }; - virsh-del-scr = write_script { - name = "virsh-del"; - path = "wrappers"; - dependencies = builtins.attrValues {inherit (pkgs) libvirt;}; - }; - yti-scr = write_script { - name = "yti"; - path = "wrappers"; - dependencies = builtins.attrValues {inherit (pkgs) gawk expect yt-dlp;}; - }; -in [ - aumo-scr - con2pdf-scr - dldragon-scr - gtk-themes-scr - screen_shot-scr - mocs-scr - update-sys-scr - backsnap-scr - ll-scr - # llp-scr # TODO: see above - spodi-scr - virsh-del-scr - yti-scr -] diff --git a/home-manager/soispha/packages/scripts/apps/aumo b/home-manager/soispha/packages/scripts/apps/aumo deleted file mode 100755 index e49ac82d..00000000 --- a/home-manager/soispha/packages/scripts/apps/aumo +++ /dev/null @@ -1,54 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -# TODO: rewrite this - -if [ "$1" = "-u" ];then udisksctl unmount -b "$(cat "$HOME/.cache/aumo/mnt_disk")"; exit 0; fi -all_available_disks=$(mktemp) -awk '{print $4}' /proc/partitions | sed '1 s|.*||' > "$all_available_disks" - -mounted_disk=$(mktemp) -awk '{print $1}' /proc/mounts > "$mounted_disk" - -unmounted_disks=$(mktemp) - -for i in $(cat $all_available_disks);do - if ! grep -qw "/dev/$i" $mounted_disk && ! ls /sys/block/$i/*/partition > /dev/null 2> /dev/null;then echo $i >> $unmounted_disks;fi -done - - -u=1 -disk=-1 -while [ $disk -lt 0 ] || [ $disk -gt $(wc -l $unmounted_disks | awk '{print $1}') ];do - - [ "$1" = "-v" ] && for i in $(cat $unmounted_disks);do - sudo fdisk -l "/dev/$i" - done - - for i in $(cat $unmounted_disks);do - printf "%4s) %s\n" "$u" "$i" - u=$(( u + 1 )) - done - - printf "%4s) Exit\n" "0" - printf "Input number: " - read -r disk - - [ $disk -lt 0 ] || [ $disk -gt $(wc -l $unmounted_disks | awk '{print $1}') ] && printf "Wrong number. Please retry\n" - [ $disk -eq 0 ] && exit 0 -done - -mnt_disk="/dev/$(awk -v n=$disk 'NR==n' $unmounted_disks)" - -if ! [ "$1" = "-v" ] && [ -n "$1" ];then sudo mount "$mnt_disk" "$1" && exit 0;fi -[ -n "$2" ] && sudo mount "$mnt_disk" "$1" && exit 0 -if mount | grep -q ~/mnt ;then dien "Something is mounted at ~/mnt";else udisksctl mount -b "$mnt_disk";fi - -[ -e $HOME/.cache/aumo/mnt_disk ] || mkdir -p $HOME/.cache/aumo -echo $mnt_disk >> $HOME/.cache/aumo/mnt_disk -rm $all_available_disks -rm $mounted_disk -rm $unmounted_disks -[ -d /tmp/LIB_FILE_TEMP_DIR/ ] && rm -r /tmp/LIB_FILE_TEMP_DIR/ diff --git a/home-manager/soispha/packages/scripts/apps/con2pdf b/home-manager/soispha/packages/scripts/apps/con2pdf deleted file mode 100755 index 9cadc376..00000000 --- a/home-manager/soispha/packages/scripts/apps/con2pdf +++ /dev/null @@ -1,152 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - - -# needed for help() and version -# shellcheck disable=2034 -AUTHORS="Soispha"; -# shellcheck disable=2034 -YEARS="2023"; -# shellcheck disable=2034 -VERSION="1.0.0"; - -help() { -cat << EOF -Scan images and turn them into a pdf. - -Usage: - $NAME [--help|--version|--out-dir|--num-pages|--method] --name --device - -Options: - --out-dir | -o - Path to place the generated pdf files (default: ./pdf). - --name | -n - Name for the pdf files (e.g. "\$name"_1.pdf). - --num-pages | -p - Number of pages to merge into one pdf (default: 1). - --device | -d - Device used for scanning. - --method | -m - Method to use for scanning (default: ADF). - --help | -h - Display this help and exit. - --version | -v - Display version and copyright information and exit. -EOF -} - -scan() { - number_of_pages="$1"; - device="$2"; - output_directory="$3"; - name="$4"; - method="$5"; - - [ -z "$number_of_pages" ] && die "Parameter 'number_of_pages' is not set!" - [ -z "$device" ] && die "Parameter 'device' is not set!" - [ -z "$output_directory" ] && die "Parameter 'output_directory' is not set!" - [ -z "$name" ] && die "Parameter 'name' is not set!" - [ -z "$method" ] && die "Parameter 'method' is not set!" - - tiff_temp_path="$(mktmp -d)"; - cd "$tiff_temp_path" || die "Bug" - - msg "Started scanning..."; - if [ "$method" = "Flatbed" ]; then - do_until_success \ - "scanimage --format=tiff --progress --source='$method' --device='$device' --output-file=1.tiff" \ - "warn 'Retrying scan, as we assume a network error!'" - else - for i in $(seq "$number_of_pages");do - do_until_success \ - "scanimage --format=tiff --progress --source='$method' --device='$device' --batch=%d.tif --batch-increment='$number_of_pages' --batch-start='$i'" \ - "warn 'Retrying scan, as we assume a network error!'" - - - if [ "$number_of_pages" -ne 1 ];then - msg "Finished turn, please change side!"; - readp "Press enter to continue" noop - fi - done - fi - - msg "Creating output directory..."; - mkdir "$output_directory"; - cd "$output_directory" || die "Bug" - - counter=0; - msg "Converting images to pdfs..."; - while read -r scanned_image_a;do - if [ "$number_of_pages" -ne 1 ];then - scanned_image_b_set=false; - if [ -z "$scanned_image_b" ];then - scanned_image_b="$i" - scanned_image_b_set=true; - : $((counter += 1)) - fi - - if [ -n "$scanned_image_a" ] && [ "$scanned_image_b_set" = false ];then - convert "$scanned_image_b" "$scanned_image_a" -compress jpeg -quality 100 "$name"_"$counter".pdf - fi - else - : $((counter += 1)) - convert "$scanned_image_a" -compress jpeg -quality 100 "$name"_"$counter".pdf - fi - - done < "$(tmp "fd . '$tiff_temp_path' | sort -n")" -} - -for input in "$@"; do - case "$input" in - "--help" | "-h") - help; - exit 0; - ;; - "--version" | "-v") - version; - exit 0; - ;; - esac -done - -number_of_pages="1"; -unset device; -output_directory="$(pwd)/pdf"; -unset name; -method="ADF"; - -while [ "$#" -ne 0 ]; do - case "$1" in - "--help" | "-h") - ;; - "--version" | "-v") - ;; - "--out-dir" | "-o") - shift 1; - output_directory="$1"; - ;; - "--name" | "-n") - shift 1; - name="$1"; - ;; - "--num-pages" | "-p") - shift 1; - number_of_pages="$1"; - ;; - "--device" | "-d") - shift 1; - device="$1"; - ;; - "--method" | "-m") - shift 1; - method="$1"; - ;; - *) - die "Command line arg $1 does not exist. See --help for a list."; - ;; - esac - shift 1; -done -scan "$number_of_pages" "$device" "$output_directory" "$name" "$method"; diff --git a/home-manager/soispha/packages/scripts/small_functions/dldragon b/home-manager/soispha/packages/scripts/small_functions/dldragon deleted file mode 100755 index ea75c362..00000000 --- a/home-manager/soispha/packages/scripts/small_functions/dldragon +++ /dev/null @@ -1,28 +0,0 @@ -#! /usr/bin/env dash -# Provides the ability to download a file by dropping it into a window - -url=$(dragon -t -x) - -if [ -n "$url" ]; then - printf "File Name: " - name="" - while [ -z $name ] || [ -e $name ] - do - read -r name - if [ -e "$name" ]; then - printf "File already exists, overwrite (y|n): " - read -r ans - - if [ "$ans" = "y" ]; then - break - else - printf "File Name: " - fi - fi - done - - # Download the file with curl - [ -n "$name" ] && curl -o "$name" "$url" || exit 1 -else - exit 1 -fi diff --git a/home-manager/soispha/packages/scripts/small_functions/gtk-themes b/home-manager/soispha/packages/scripts/small_functions/gtk-themes deleted file mode 100755 index 457bc35a..00000000 --- a/home-manager/soispha/packages/scripts/small_functions/gtk-themes +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - - -# TODO: document, what this does - -# usage: import-gsettings -config="${XDG_CONFIG_HOME:-$HOME/.config}/gtk-3.0/settings.ini" -if [ ! -f "$config" ]; then exit 1; fi - -gnome_schema="org.gnome.desktop.interface" -gtk_theme="$(grep 'gtk-theme-name' "$config" | sed 's/.*\s*=\s*//')" -icon_theme="$(grep 'gtk-icon-theme-name' "$config" | sed 's/.*\s*=\s*//')" -cursor_theme="$(grep 'gtk-cursor-theme-name' "$config" | sed 's/.*\s*=\s*//')" -font_name="$(grep 'gtk-font-name' "$config" | sed 's/.*\s*=\s*//')" -gsettings set "$gnome_schema" gtk-theme "$gtk_theme" -gsettings set "$gnome_schema" icon-theme "$icon_theme" -gsettings set "$gnome_schema" cursor-theme "$cursor_theme" -gsettings set "$gnome_schema" font-name "$font_name" diff --git a/home-manager/soispha/packages/scripts/small_functions/mocs b/home-manager/soispha/packages/scripts/small_functions/mocs deleted file mode 100755 index e14a84c8..00000000 --- a/home-manager/soispha/packages/scripts/small_functions/mocs +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash -if [[ "$(pgrep mocp)" -eq 0 ]]; -then - mocp -M "${XDG_CONFIG_HOME}"/moc -S - if [[ $1 -eq 0 ]]; - then - mocp -M "${XDG_CONFIG_HOME}"/moc -v 12 - else - mocp -M "${XDG_CONFIG_HOME}"/moc -v "$1" - fi - mocp -M "${XDG_CONFIG_HOME}"/moc -p - mymocp& -else - mocp -M "${XDG_CONFIG_HOME}"/moc -G -fi diff --git a/home-manager/soispha/packages/scripts/small_functions/screen_shot b/home-manager/soispha/packages/scripts/small_functions/screen_shot deleted file mode 100755 index 73eb2ee4..00000000 --- a/home-manager/soispha/packages/scripts/small_functions/screen_shot +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -date="$(date +%s)" -grim -g "$(slurp)" "$HOME/media/pictures/screenshots/$date.png" && - alacritty -e ll -command ":{{ set sortby atime; set reverse!; }}" "$HOME/media/pictures/screenshots/$date.png" - -# vim: ft=sh diff --git a/home-manager/soispha/packages/scripts/small_functions/update-sys b/home-manager/soispha/packages/scripts/small_functions/update-sys deleted file mode 100755 index 355682d1..00000000 --- a/home-manager/soispha/packages/scripts/small_functions/update-sys +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -help() { - cat << EOF -This is a NixOS System flake update manager. - -Usage: - $NAME [--branch ] [--help] - -Options: - --branch | -b BRANCHNAME - select a branch to update from. - --mode | -m MODE - select a mode to update with - --help | -h - output this help. -EOF - exit "$1"; -} -default_branch=$(mktmp); -BRANCH=""; - -while [ "$#" -gt 0 ];do - case "$1" in - "--help" | "-h") - help 0; - ;; - "--branch" | "-b") - if [ -n "$2" ];then - BRANCH="$2"; - else - error "$1 requires an argument"; - help 1; - fi - shift 2; - ;; - "--mode" | "-m") - if [ -n "$2" ];then - MODE="$2"; - else - error "$1 requires an argument"; - help 1; - fi - shift 2; - ;; - *) - error "the option $1 does not exist!"; - help 1; - ;; - esac -done - - -cd /etc/nixos || die "No /etc/nixos"; -msg "Starting system update..."; -git remote update origin --prune > /dev/null 2>&1; -if ! [ "$BRANCH" = "" ];then - git switch "$BRANCH" > /dev/null 2>&1 && msg2 "Switched to branch '$BRANCH'"; -fi -msg2 "Updating git repository..."; -git pull --rebase; - -git remote show origin | grep 'HEAD' | cut -d':' -f2 | sed -e 's/^ *//g' -e 's/ *$//g' > "$default_branch" & - -msg2 "Updating system..."; -if [ -n "$MODE" ]; then - nixos-rebuild "$MODE"; -else - nixos-rebuild switch; -fi - -git switch "$(cat "$default_branch")" > /dev/null 2>&1 && msg2 "Switched to branch '$(cat "$default_branch")'"; -msg "Finished Update!"; - -# vim: ft=sh diff --git a/home-manager/soispha/packages/scripts/wrappers/backsnap b/home-manager/soispha/packages/scripts/wrappers/backsnap deleted file mode 100755 index cd08045d..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/backsnap +++ /dev/null @@ -1,3 +0,0 @@ -#! /usr/bin/env dash -snap-sync --noconfirm -u d1c6e0f6-1837-40fd-bb29-251d5ea0ddb0 -umount /run/dt/d1c6e0f6-1837-40fd-bb29-251d5ea0ddb0 diff --git a/home-manager/soispha/packages/scripts/wrappers/ll b/home-manager/soispha/packages/scripts/wrappers/ll deleted file mode 100755 index cb1fc0ea..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/ll +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -last_directory="$(mktemp)" - -command lf -last-dir-path="$last_directory" "$@" - -dir="$(cat "$last_directory")" -cd "$dir" || die "$dir does not exist!" -rm "$last_directory" - -# vim: ft=sh diff --git a/home-manager/soispha/packages/scripts/wrappers/llp b/home-manager/soispha/packages/scripts/wrappers/llp deleted file mode 100755 index 2a21450c..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/llp +++ /dev/null @@ -1,19 +0,0 @@ -#! /bin/bash - -export LLP=1 -cleanup() { - exec 3>&- - rm "$FIFO_UEBERZUG" -} - -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then - lf "$@" -else - [ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf" - export FIFO_UEBERZUG="$HOME/.cache/lf/ueberzug-$$" - mkfifo "$FIFO_UEBERZUG" - ueberzug layer -s <"$FIFO_UEBERZUG" -p json & - exec 3>"$FIFO_UEBERZUG" - trap cleanup EXIT - lf "$@" 3>&- -fi diff --git a/home-manager/soispha/packages/scripts/wrappers/spodi b/home-manager/soispha/packages/scripts/wrappers/spodi deleted file mode 100755 index 4ff53bff..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/spodi +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -DOWN_DIR="/home/soispha/media/music/down"; - -download_url="$1"; - - - -already_downloaded_files="$(mktmp)" -fd . "$DOWN_DIR" --exclude spotdl.log > "$already_downloaded_files"; - -config="$(mktmp)" -cat << EO > "$config" ---log-level INFO ---cache-path /home/soispha/.local/share/spotdl/.spotipy ---audio youtube-music youtube ---lyrics genius musixmatch azlyrics ---ffmpeg ffmpeg ---format mp3 ---output {artists}_-_{title} ---overwrite skip ---client-id 5f573c9620494bae87890c0f08a60293 ---client-secret 212476d9b0f3472eaa762d90b19b0ba8 ---threads 16 ---print-errors ---preload -EO - -if [ -z "$NO_CHECK" ] && [ "$(wc -l < "$already_downloaded_files" )" -ne 0 ];then - die "something is already downloaded" -fi - -rm "$DOWN_DIR/spotdl.log" -cd "$DOWN_DIR" || die "BUG: no $DOWN_DIR" - - -# The sub shell needs to be unquoted, as the arguments may not be treated as one. -# shellcheck disable=2046 -unbuffer spotdl $(cat "$config") download "$download_url" | tee "$DOWN_DIR/spotdl.log" - -[ -d ~/.spotdl ] && rm -r ~/.spotdl -# vim: ft=sh diff --git a/home-manager/soispha/packages/scripts/wrappers/virsh-del b/home-manager/soispha/packages/scripts/wrappers/virsh-del deleted file mode 100755 index afcd87c1..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/virsh-del +++ /dev/null @@ -1,10 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -virsh destroy "$1" -virsh undefine "$1" --nvram -virsh vol-delete --pool default "$1".qcow2 - -# vim: ft=sh diff --git a/home-manager/soispha/packages/scripts/wrappers/yti b/home-manager/soispha/packages/scripts/wrappers/yti deleted file mode 100755 index 0b737b30..00000000 --- a/home-manager/soispha/packages/scripts/wrappers/yti +++ /dev/null @@ -1,36 +0,0 @@ -#! /usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -die "Use spodi instead!" # TODO: fix this script -DOWN_DIR=/home/soispha/media/playlist/down/ - - -tmp=$(mktmp) -config=$(mktmp) - -for e in "$DOWN_DIR"/*.mp3;do echo "$e" >> "$tmp";done -[ "$(wc -l "$tmp" | awk '{print $1}')" -gt 2 ] && die "something is already downloaded" - -cat << EO > "$config" ---paths home:"$DOWN_DIR" -#--output %(fulltitle) ---restrict-filenames ---no-overwrites ---no-write-info-json ---clean-info-json ---prefer-free-formats -#--format mp3 ---extract-audio ---audio-quality 0 ---audio-format best -EO - - -rm ${DOWN_DIR}yt-dlp.log -cd $DOWN_DIR || die "BUG: no $DOWN_DIR" - -unbuffer yt-dlp --config-location "$config" "$1" | tee $DOWN_DIR/yt-dlp.log - -# vim: ft=sh diff --git a/home-manager/soispha/wms/default.nix b/home-manager/soispha/wms/default.nix deleted file mode 100644 index 610ea2f4..00000000 --- a/home-manager/soispha/wms/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{config, ...}: { - imports = [ - # ./sway - ./river - # ./plasma - ]; -} diff --git a/home-manager/soispha/wms/plasma/default.nix b/home-manager/soispha/wms/plasma/default.nix deleted file mode 100644 index f68ee272..00000000 --- a/home-manager/soispha/wms/plasma/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{config, ...}: { - services.xserver.enable = true; - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; -} diff --git a/home-manager/soispha/wms/river/default.nix b/home-manager/soispha/wms/river/default.nix deleted file mode 100644 index d8bc4009..00000000 --- a/home-manager/soispha/wms/river/default.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ - pkgs, - sysLib, - river_init_lesser, - nixosConfig, - system, - ... -}: let - inherit (nixosConfig.networking) hostName; - mappings = - if hostName == "tiamat" - then '' - err_fail riverctl keyboard-layout 'us' - err_fail river_init_lesser ~/.config/river/res/moonlander.ron - '' - else if hostName == "lahmu" || hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail riverctl keyboard-layout 'us(dvorak)' - err_fail river_init_lesser ~/.config/river/res/keys.ron - '' - else builtins.throw "Host not covered in river mappings"; - screen_setup = - if hostName == "lahmu" - then '' - err_fail wlr-randr --output Virtual-1 --mode 1920x1080 - '' - else if hostName == "tiamat" - then '' - err_fail wlr-randr --output DP-2 --pos 2560,0 - err_fail wlr-randr --output DP-1 --scale 1.5 --pos 0,0 - err_fail gammastep & - '' - else if hostName == "apzu" || hostName == "mammun" || hostName == "isimud" - then '' - err_fail gammastep & - '' - else builtins.throw "Host not covered in river screen setup"; - init_scr = pkgs.substituteAll { - src = ./init; - inherit mappings screen_setup; - }; -in { - xdg.configFile."river/init".source = - sysLib.writeShellScriptWithLibraryAndKeepPath { - name = "river_init"; - src = init_scr; - dependencies = builtins.attrValues { - river_init_lesser = river_init_lesser.packages.${system}.default; - inherit - (pkgs) - dash - river - glib # gnome lib - gammastep - wlr-randr - yambar - mako - swaybg - swayidle - swaylock - alacritty - ; - }; - } - + /bin/river_init; - - xdg.configFile."river/res".source = ./res; -} diff --git a/home-manager/soispha/wms/river/init b/home-manager/soispha/wms/river/init deleted file mode 100755 index 599992e6..00000000 --- a/home-manager/soispha/wms/river/init +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env dash - -# shellcheck source=/dev/null -SHELL_LIBRARY_VERSION="1.1.4" . %SHELL_LIBRARY_PATH - -err_fail() { - if ! "$@";then - warning "\"$*\" failed!\n" >> ~/river_log - # msg "Executing the safe init!" - # exec ~/.config/river/res/safe_init - fi -} -err_fail rm ~/river_log -exec 1>> "$HOME"/river_log -exec 2>> "$HOME"/river_log - -#trap err_fail ERR - -#Setup of environment variables {{{ -err_fail riverctl spawn "exec dbus-update-activation-environment SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" -err_fail export XDG_CURRENT_DESKTOP=river -#}}} - -# Setup of mappings {{{ -@mappings@ -# }}} - -# Setup of Rules {{{ -err_fail riverctl float-filter-add app-id float -err_fail riverctl float-filter-add app-id mpv -err_fail riverctl float-filter-add app-id ModernGL -err_fail riverctl float-filter-add title "Manim Slides" - -err_fail riverctl csd-filter-add app-id firefox -# }}} - -# Set riverctl settings {{{ -# background -err_fail riverctl background-color 0x002b36 -err_fail riverctl border-color-focused 0x93a1a1 -err_fail riverctl border-color-unfocused 0x586e75 - -# keyboard repeat rate -err_fail riverctl set-repeat 50 300 - -# Cursor -err_fail riverctl focus-follows-cursor normal -#riverctl hide-cursor timeout 2000 -err_fail riverctl hide-cursor when-typing enabled -err_fail riverctl set-cursor-warp on-output-change -err_fail riverctl xcursor-theme Nordzy-cursors 24 - -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 pointer-accel 0 -err_fail riverctl input pointer-1133-49970-Logitech_Gaming_Mouse_G502 accel-profile none - -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I pointer-accel 0 -err_fail riverctl input pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I accel-profile none -# }}} - -# Setup of general apps {{{ -@screen_setup@ - -err_fail yambar & - -err_fail mako & -err_fail swaybg -i "$WALLPAPER" & -err_fail swayidle & -err_fail alacritty & -# }}} - - - -# Setup of layout [acts as exec!] {{{ -err_fail riverctl default-layout rivertile -err_fail rivertile -main-ratio 0.5 -view-padding 1 -outer-padding 0 - -#riverctl default-layout luatile -#river-luatile -# }}} -# vim: ft=sh diff --git a/home-manager/soispha/wms/river/res/keys.ron b/home-manager/soispha/wms/river/res/keys.ron deleted file mode 100644 index a4ad6988..00000000 --- a/home-manager/soispha/wms/river/res/keys.ron +++ /dev/null @@ -1,57 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - commands: [ - // Focus change - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super", command: "focus-view", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Control", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Control", command: "focus-output", command_args: "previous",), - - // Standard program - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "q", mods: "Super+Shift", command: "exit", command_args: None,), - - // Screenshot - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Print", mods: "None", command: "spawn", command_args: "~/repos/shell/scripts/screen_shot",), - - // Audio - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "XF86AudioRaiseVolume", mods: "None", command: "spawn", command_args: "pactl set-sink-volume 1 +5%",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioLowerVolume", mods: "None", command: "spawn", command_args: "~/.local/bin/ytcs",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "XF86AudioMute", mods: "None", command: "spawn", command_args: "~/repos/shell/scripts/mocs",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Super", command: "spawn", command_args: "bemenu-run",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F1", mods: "Super", command: "spawn", command_args: "firefox",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F2", mods: "Super", command: "spawn", command_args: "keepassxc",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F3", mods: "Super", command: "spawn", command_args: "nheko",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F4", mods: "Super", command: "spawn", command_args: "steam",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Super", command: "spawn", command_args: "swaylock -f",), - - // Client - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "f", mods: "Super", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "c", mods: "Super+Shift", command: "close", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "space", mods: "Super+Control", command: "toggle-float", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Return", mods: "Super+Control", command: "zoom", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "o", mods: "Super", command: "send-to-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Super+Shift", command: "swap", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "N", mods: "Super+Shift", command: "swap", command_args: "previous",), - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Super+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - - ], - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift", command: "set-view-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) - diff --git a/home-manager/soispha/wms/river/res/moonlander.ron b/home-manager/soispha/wms/river/res/moonlander.ron deleted file mode 100644 index 7a0c7298..00000000 --- a/home-manager/soispha/wms/river/res/moonlander.ron +++ /dev/null @@ -1,64 +0,0 @@ -#![enable(implicit_some)] -RiverctlCommandArray( - // TODO: add toggle-focus mapping - commands: [ - // Movement - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "A", mods: "Alt+Control+Super+Shift", command: "exit", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "B", mods: "Alt+Control+Super+Shift", command: "close", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "C", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "D", mods: "Alt+Control+Super+Shift", command: "focus-view", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "E", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "previous",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "F", mods: "Alt+Control+Super+Shift", command: "swap", command_args: "next",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "G", mods: "Alt+Control+Super+Shift", command: "zoom", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "H", mods: "Alt+Control+Super+Shift", command: "toggle-fullscreen", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "I", mods: "Alt+Control+Super+Shift", command: "toggle-float", command_args: None,), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "J", mods: "Alt+Control+Super+Shift", command: "send-to-output", command_args: "next",), - - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "K", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "alacritty",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "L", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "screen_shot",), - - // Audio - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "M", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "stop_playing_sound",), - RiverctlCommand( map_mode: Map, mode: ["normal", "locked"], key: "N", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "mpc toggle",), - - // Launcher - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "O", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "P", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "firefox",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Q", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "keepassxc",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "R", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "nheko",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "S", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "signal-desktop",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "T", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "swaylock -f",), - - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "U", mods: "Alt+Control+Super+Shift", command: "focus-output", command_args: "next",), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "V", mods: "Alt+Control+Super+Shift", command: "focus-previous-tags", command_args: None,), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "W", mods: "Alt+Control+Super+Shift", command: "send-to-previous-tags",command_args: None,), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "X", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Y", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - //RiverctlCommand( map_mode: Map, mode: ["normal"], key: "Z", mods: "Alt+Control+Super+Shift", command: "spawn", command_args: "bemenu-run",), - - - // Toggle all tags - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Super+Shift", command: "set-focused-tags", command_args: "4294967295"), - RiverctlCommand( map_mode: Map, mode: ["normal"], key: "0", mods: "Alt+Control+Shift", command: "set-view-tags", command_args: "4294967295"), - - // Mouse - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_LEFT", mods: "Super", command: "move-view", command_args: None,), - RiverctlCommand( map_mode: MapMouse, mode: ["normal"], key: "BTN_RIGHT", mods: "Super", command: "resize-view", command_args: None,), - ], - - // Set these mappings for the tags 0-8 with key [1-9] - tags_number: 9, - tag_commands: [ - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Super+Shift", command: "set-focused-tags",), - RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Alt+Control+Shift", command: "set-view-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Control", command: "toggle-focused-tags",), - // TODO: RiverctlTagCommand( map_mode: Map, mode: ["normal"], mods: "Super+Shift+Control", command: "toggle-view-tags",), - ], -) - diff --git a/home-manager/soispha/wms/river/res/safe_init b/home-manager/soispha/wms/river/res/safe_init deleted file mode 100755 index 8e80026a..00000000 --- a/home-manager/soispha/wms/river/res/safe_init +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/sh - -# This is the example configuration file for river. -# -# If you wish to edit this, you will probably want to copy it to -# $XDG_CONFIG_HOME/river/init or $HOME/.config/river/init first. -# -# See the river(1), riverctl(1), and rivertile(1) man pages for complete -# documentation. - -# Note: the "Super" modifier is also known as Logo, GUI, Windows, Mod4, etc. - -# Super+Shift+Return to start an instance of foot (https://codeberg.org/dnkl/foot) -riverctl map normal Super Return spawn alacritty - -# Super+Q to close the focused view -riverctl map normal Super Q close - -# Super+Shift+E to exit river -riverctl map normal Super+Shift Q exit - -# Super+J and Super+K to focus the next/previous view in the layout stack -riverctl map normal Super J focus-view next -riverctl map normal Super K focus-view previous - -# Super+Shift+J and Super+Shift+K to swap the focused view with the next/previous -# view in the layout stack -riverctl map normal Super+Shift J swap next -riverctl map normal Super+Shift K swap previous - -# Super+Period and Super+Comma to focus the next/previous output -riverctl map normal Super Period focus-output next -riverctl map normal Super Comma focus-output previous - -# Super+Shift+{Period,Comma} to send the focused view to the next/previous output -riverctl map normal Super+Shift Period send-to-output next -riverctl map normal Super+Shift Comma send-to-output previous - -# Super+Return to bump the focused view to the top of the layout stack -riverctl map normal Super Return zoom - -# Super+H and Super+L to decrease/increase the main ratio of rivertile(1) -riverctl map normal Super H send-layout-cmd rivertile "main-ratio -0.05" -riverctl map normal Super L send-layout-cmd rivertile "main-ratio +0.05" - -# Super+Shift+H and Super+Shift+L to increment/decrement the main count of rivertile(1) -riverctl map normal Super+Shift H send-layout-cmd rivertile "main-count +1" -riverctl map normal Super+Shift L send-layout-cmd rivertile "main-count -1" - -# Super+Alt+{H,J,K,L} to move views -riverctl map normal Super+Alt H move left 100 -riverctl map normal Super+Alt J move down 100 -riverctl map normal Super+Alt K move up 100 -riverctl map normal Super+Alt L move right 100 - -# Super+Alt+Control+{H,J,K,L} to snap views to screen edges -riverctl map normal Super+Alt+Control H snap left -riverctl map normal Super+Alt+Control J snap down -riverctl map normal Super+Alt+Control K snap up -riverctl map normal Super+Alt+Control L snap right - -# Super+Alt+Shift+{H,J,K,L} to resize views -riverctl map normal Super+Alt+Shift H resize horizontal -100 -riverctl map normal Super+Alt+Shift J resize vertical 100 -riverctl map normal Super+Alt+Shift K resize vertical -100 -riverctl map normal Super+Alt+Shift L resize horizontal 100 - -# Super + Left Mouse Button to move views -riverctl map-pointer normal Super BTN_LEFT move-view - -# Super + Right Mouse Button to resize views -riverctl map-pointer normal Super BTN_RIGHT resize-view - -for i in $(seq 1 9) -do - tags=$((1 << ($i - 1))) - - # Super+[1-9] to focus tag [0-8] - riverctl map normal Super $i set-focused-tags $tags - - # Super+Shift+[1-9] to tag focused view with tag [0-8] - riverctl map normal Super+Shift $i set-view-tags $tags - - # Super+Ctrl+[1-9] to toggle focus of tag [0-8] - riverctl map normal Super+Control $i toggle-focused-tags $tags - - # Super+Shift+Ctrl+[1-9] to toggle tag [0-8] of focused view - riverctl map normal Super+Shift+Control $i toggle-view-tags $tags -done - -# Super+0 to focus all tags -# Super+Shift+0 to tag focused view with all tags -all_tags=$(((1 << 32) - 1)) -riverctl map normal Super 0 set-focused-tags $all_tags -riverctl map normal Super+Shift 0 set-view-tags $all_tags - -# Super+Space to toggle float -riverctl map normal Super Space toggle-float - -# Super+F to toggle fullscreen -riverctl map normal Super F toggle-fullscreen - -# Super+{Up,Right,Down,Left} to change layout orientation -riverctl map normal Super Up send-layout-cmd rivertile "main-location top" -riverctl map normal Super Right send-layout-cmd rivertile "main-location right" -riverctl map normal Super Down send-layout-cmd rivertile "main-location bottom" -riverctl map normal Super Left send-layout-cmd rivertile "main-location left" - -# Declare a passthrough mode. This mode has only a single mapping to return to -# normal mode. This makes it useful for testing a nested wayland compositor -riverctl declare-mode passthrough - -# Super+F11 to enter passthrough mode -riverctl map normal Super F11 enter-mode passthrough - -# Super+F11 to return to normal mode -riverctl map passthrough Super F11 enter-mode normal - -# Various media key mapping examples for both normal and locked mode which do -# not have a modifier -for mode in normal locked -do - # Eject the optical drive (well if you still have one that is) - riverctl map $mode None XF86Eject spawn 'eject -T' - - # Control pulse audio volume with pamixer (https://github.com/cdemoulins/pamixer) - riverctl map $mode None XF86AudioRaiseVolume spawn 'pamixer -i 5' - riverctl map $mode None XF86AudioLowerVolume spawn 'pamixer -d 5' - riverctl map $mode None XF86AudioMute spawn 'pamixer --toggle-mute' - - # Control MPRIS aware media players with playerctl (https://github.com/altdesktop/playerctl) - riverctl map $mode None XF86AudioMedia spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPlay spawn 'playerctl play-pause' - riverctl map $mode None XF86AudioPrev spawn 'playerctl previous' - riverctl map $mode None XF86AudioNext spawn 'playerctl next' - - # Control screen backlight brightness with light (https://github.com/haikarainen/light) - riverctl map $mode None XF86MonBrightnessUp spawn 'light -A 5' - riverctl map $mode None XF86MonBrightnessDown spawn 'light -U 5' -done - -# Set background and border color -riverctl background-color 0x002b36 -riverctl border-color-focused 0x93a1a1 -riverctl border-color-unfocused 0x586e75 - -# Set keyboard repeat rate -riverctl set-repeat 50 300 - -# Make certain views start floating -riverctl float-filter-add app-id float -riverctl float-filter-add title "popup title with spaces" - -# Set app-ids and titles of views which should use client side decorations -riverctl csd-filter-add app-id "gedit" - -# Set the default layout generator to be rivertile and start it. -# River will send the process group of the init executable SIGTERM on exit. -riverctl default-layout rivertile -rivertile -view-padding 6 -outer-padding 6 diff --git a/home-manager/soispha/wms/sway/default.nix b/home-manager/soispha/wms/sway/default.nix deleted file mode 100644 index bb3ddb49..00000000 --- a/home-manager/soispha/wms/sway/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -# also requires: -# security.polkit.enable = true; -{lib, ...}: { - wayland.windowManager.sway = { - enable = true; - config = { - modifier = "Mod4"; - # Use kitty as default terminal - terminal = "kitty"; - startup = [ - # Launch Firefox on start - {command = "firefox";} - ]; - }; - }; -} diff --git a/hosts/apzu/default.nix b/hosts/apzu/default.nix index 293b09a2..8c580214 100644 --- a/hosts/apzu/default.nix +++ b/hosts/apzu/default.nix @@ -3,7 +3,7 @@ ./hardware ./networking.nix - ../../system + ../../sys ]; soispha = { diff --git a/hosts/isimud/default.nix b/hosts/isimud/default.nix index 5f8fc987..5aa6ad3c 100644 --- a/hosts/isimud/default.nix +++ b/hosts/isimud/default.nix @@ -2,7 +2,7 @@ imports = [ ./hardware ./networking.nix - ../../system + ../../sys ]; isoImage = { diff --git a/hosts/lahmu/default.nix b/hosts/lahmu/default.nix index 85ff9a0e..94d8b054 100644 --- a/hosts/lahmu/default.nix +++ b/hosts/lahmu/default.nix @@ -9,7 +9,7 @@ ./hardware ./networking.nix - ../../system + ../../sys ]; soispha = { diff --git a/hosts/mammun/default.nix b/hosts/mammun/default.nix index cb7d259f..5c66d9fa 100644 --- a/hosts/mammun/default.nix +++ b/hosts/mammun/default.nix @@ -10,7 +10,7 @@ ./hardware ./networking.nix - ../../system + ../../sys ]; soispha = { locale.enable = true; diff --git a/hosts/tiamat/default.nix b/hosts/tiamat/default.nix index 3aa291c2..7f2080e3 100644 --- a/hosts/tiamat/default.nix +++ b/hosts/tiamat/default.nix @@ -3,7 +3,7 @@ ./hardware ./networking.nix - ../../system + ../../sys ]; soispha = { diff --git a/sys/boot/boot_pictures/gnu.png b/sys/boot/boot_pictures/gnu.png new file mode 100755 index 00000000..d07dee3e Binary files /dev/null and b/sys/boot/boot_pictures/gnu.png differ diff --git a/sys/boot/boot_pictures/gnulin_emb_1.png b/sys/boot/boot_pictures/gnulin_emb_1.png new file mode 100755 index 00000000..483f2681 Binary files /dev/null and b/sys/boot/boot_pictures/gnulin_emb_1.png differ diff --git a/sys/boot/boot_pictures/gnulin_emb_2.png b/sys/boot/boot_pictures/gnulin_emb_2.png new file mode 100755 index 00000000..48cd6ad7 Binary files /dev/null and b/sys/boot/boot_pictures/gnulin_emb_2.png differ diff --git a/sys/boot/default.nix b/sys/boot/default.nix new file mode 100644 index 00000000..9606c7b3 --- /dev/null +++ b/sys/boot/default.nix @@ -0,0 +1,41 @@ +{ + pkgs, + lib, + ... +}: { + boot = { + initrd = { + #compressor = "lz4"; + #compressorArgs = ["-9"]; + kernelModules = ["nvme" "btrfs"]; + }; + + kernelPackages = pkgs.linuxPackages_latest; + + lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + + loader = { + # Lanzaboote currently replaces the systemd-boot module. + # This setting is usually set to true in configuration.nix + # generated at installation time. So we force it to false + # for now. + systemd-boot.enable = lib.mkForce false; + + grub = { + enable = false; + # theme = pkgs.nixos-grub2-theme; + splashImage = ./boot_pictures/gnu.png; + efiSupport = true; + device = "nodev"; # only for efi + }; + + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + }; +} diff --git a/sys/default.nix b/sys/default.nix new file mode 100644 index 00000000..e263988f --- /dev/null +++ b/sys/default.nix @@ -0,0 +1,25 @@ +{lib, ...}: { + imports = [ + ./boot + ./disks + ./font + ./hardware + ./impermanence + ./libvirtd + ./locale + ./network + #./nixpkgs already at flake level imported + ./options + ./polkit + ./power + ./svcs + ./secrets + ./sound + ./tempfiles + ./users # the position of this item is fully arbitrary + ]; + # remove all the bloat, which nixos installs by default + environment = { + defaultPackages = lib.mkForce []; + }; +} diff --git a/sys/disks/default.nix b/sys/disks/default.nix new file mode 100644 index 00000000..d238d89a --- /dev/null +++ b/sys/disks/default.nix @@ -0,0 +1,130 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.soispha.disks; + defaultMountOptions = [ + "compress-force=zstd:15" # This saves disk space, at a performance cost + "noatime" # should have some performance upsides, and I don't use it anyways + "lazytime" # make time changes in memory + ]; +in { + options.soispha.disks = { + enable = lib.mkEnableOption "disk setup with disko"; + disk = lib.mkOption { + type = lib.types.path; + example = lib.literalExpression "/dev/disk/by-uuid/0442cb6d-f13a-4635-b487-fa76189774c5"; + description = lib.mdDoc "The disk used for installing the OS"; + }; + ssd = lib.mkOption { + type = lib.types.bool; + example = lib.literalExpression "true"; + default = false; + description = lib.mdDoc "Enable ssd specific improvements, like trim"; + }; + swap = { + uuid = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; + description = lib.mdDoc "The uuid of the swapfile"; + }; + resumeOffset = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression "134324224"; + description = lib.mdDoc "The resume offset of the swapfile"; + }; + }; + }; + + config = lib.mkIf cfg.enable { + systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;}); + + disko.devices = { + disk = { + main = { + device = cfg.disk; + content = { + type = "gpt"; + partitions = { + root = { + size = "100%"; + name = "root"; + content = { + type = "luks"; + name = "nixos"; + extraOpenArgs = ["--allow-discards"]; + content = { + type = "btrfs"; + extraArgs = ["-f" "--label nixos"]; # Override existing partitions + subvolumes = { + "nix" = { + mountpoint = "/nix"; + mountOptions = defaultMountOptions; + }; + "persistent-storage" = { + mountpoint = "/srv"; + mountOptions = defaultMountOptions; + }; + "persistent-storage@snapshots" = { + mountpoint = "/srv/.snapshots"; + mountOptions = defaultMountOptions; + }; + "swap" = { + mountpoint = "/swap"; + mountOptions = defaultMountOptions; + }; + }; + }; + }; + }; + boot = { + type = "EF00"; + size = "512M"; + name = "boot"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + }; + }; + }; + }; + nodev = { + "/" = { + fsType = "tmpfs"; + mountOptions = ["defaults" "size=8G" "mode=755"]; + }; + }; + }; + fileSystems = { + "/srv" = { + neededForBoot = true; + }; + "/swap" = { + neededForBoot = true; + }; + }; + swapDevices = [ + #{ + # device = "/swap/swapfile"; + # priority = 1; # lower than zramSwap, just in case + # # size = 2048; # TODO: can nixos create a btrfs swapfile correctly? + #} + ]; + zramSwap = { + enable = true; + priority = 10; # needs to be higher than hardware-swap + }; + boot = { + kernelParams = [ + "resume_offset=${cfg.swap.resumeOffset}" + "zswap.enabled=0" # zswap and zram are not really compatible + ]; + resumeDevice = "/dev/disk/by-uuid/${cfg.swap.uuid}"; + }; + }; +} diff --git a/sys/disks/fstrim.nix b/sys/disks/fstrim.nix new file mode 100644 index 00000000..6daeb65e --- /dev/null +++ b/sys/disks/fstrim.nix @@ -0,0 +1,42 @@ +{ + pkgs, + lib, + cfg, +}: { + timers.fstrim = lib.mkIf cfg.ssd { + wantedBy = ["timers.target"]; + wants = ["fstrim.service"]; + unitConfig = { + Description = "Discard unused blocks once a week"; + Documentation = "man:fstrim"; + ConditionVirtualization = "!container"; + ConditionPathExists = "!/etc/initrd-release"; + }; + timerConfig = { + OnCalendar = "weekly"; + AccuracySec = "1h"; + Persistent = "true"; + RandomizedDelaySec = "6000"; + }; + }; + services.fstrim = lib.mkIf cfg.ssd { + wantedBy = lib.mkForce []; + unitConfig = { + Description = "Discard unused blocks on filesystems from /etc/fstab"; + Documentation = "man:fstrim(8)"; + ConditionVirtualization = "!container"; + }; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${pkgs.util-linux}/bin/fstrim --listed-in /etc/fstab:/proc/self/mountinfo --verbose --quiet-unsupported"; + PrivateDevices = "no"; + PrivateNetwork = "yes"; + PrivateUsers = "no"; + ProtectKernelTunables = "yes"; + ProtectKernelModules = "yes"; + ProtectControlGroups = "yes"; + MemoryDenyWriteExecute = "yes"; + SystemCallFilter = "@default @file-system @basic-io @system-service"; + }; + }; +} diff --git a/sys/disks/hibernate.nix b/sys/disks/hibernate.nix new file mode 100644 index 00000000..b0aed423 --- /dev/null +++ b/sys/disks/hibernate.nix @@ -0,0 +1,45 @@ +{pkgs}: { + services = { + hibernate-preparation = { + # TODO: check if they work + wantedBy = ["systemd-hibernate.service"]; + unitConfig = { + Description = "Enable swap file and disable zram before hibernate"; + Before = "systemd-hibernate.service"; + }; + serviceConfig = { + Type = "oneshot"; + User = "root"; + ExecStart = "${pkgs.bash}/bin/bash -c \"${pkgs.util-linux}/bin/swapon /swap/swapfile && ${pkgs.util-linux}/bin/swapoff /dev/zram0\""; + }; + }; + hibernate-resume = { + wantedBy = ["systemd-hibernate.service"]; + unitConfig = { + Description = "Disable swap after resuming from hibernation"; + After = "hibernate.target"; + }; + serviceConfig = { + Type = "oneshot"; + User = "root"; + ExecStart = "${pkgs.util-linux}/bin/swapoff /swap/swapfile"; + }; + }; + # swapoff-start = { + # wantedBy = ["multi-user.target"]; + # unitConfig = { + # Description = "Disable hardware swap after booting"; + # }; + # serviceConfig = { + # Type = "oneshot"; + # User = "root"; + # ExecStart = "${pkgs.util-linux}/bin/swapoff /swap/swapfile"; + # }; + # }; + systemd-hibernate.serviceConfig.Environment = "SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1"; + systemd-logind.serviceConfig.Environment = "SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1"; + }; + sleep.extraConfig = '' + HibernateDelaySec=5m + ''; +} diff --git a/sys/font/default.nix b/sys/font/default.nix new file mode 100644 index 00000000..303efcf7 --- /dev/null +++ b/sys/font/default.nix @@ -0,0 +1,21 @@ +{pkgs, ...}: let + nerdFont = pkgs.nerdfonts.override { + fonts = [ + "SourceCodePro" + ]; + }; +in { + # TODO: maybe add other fonts? + fonts = { + packages = [ + nerdFont + ]; + fontconfig = { + defaultFonts = { + # serif = ["Vazir"]; + # sansSerif = ["Vazir"]; + monospace = ["SourceCodePro"]; + }; + }; + }; +} diff --git a/sys/hardware/default.nix b/sys/hardware/default.nix new file mode 100644 index 00000000..77d3d3f0 --- /dev/null +++ b/sys/hardware/default.nix @@ -0,0 +1,46 @@ +{ + config, + pkgs, + ... +}: { + hardware = { + keyboard.zsa.enable = false; + onlykey.enable = true; + opengl = { + enable = true; + extraPackages = builtins.attrValues { + inherit + (pkgs) + vaapiVdpau + libvdpau-va-gl + ; + }; + }; + }; + services.udev.extraRules = '' + # Rules for Oryx web flashing and live training + KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev" + KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev" + + # Legacy rules for live training over webusb (Not needed for firmware v21+) + # Rule for all ZSA keyboards + SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev" + # Rule for the Moonlander + SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev" + # Rule for the Ergodox EZ + SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev" + # Rule for the Planck EZ + SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev" + + # Wally Flashing rules for the Ergodox EZ + ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1" + ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1" + SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666" + KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666" + + # Wally Flashing rules for the Moonlander and Planck EZ + SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \ + MODE:="0666", \ + SYMLINK+="stm32_dfu" + ''; +} diff --git a/sys/impermanence/default.nix b/sys/impermanence/default.nix new file mode 100644 index 00000000..a9be951a --- /dev/null +++ b/sys/impermanence/default.nix @@ -0,0 +1,52 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.impermanence; + networkmanager = + if config.networking.networkmanager.enable + then [ + "/etc/NetworkManager" # store the networkmanager configs + ] + else []; + secureboot = + if config.boot.lanzaboote.enable + then [ + "/etc/secureboot" + ] + else []; + directories = + [ + "/etc/nixos" + "/var/log" + # TODO: the following entries need to be checked + #"/var/lib/bluetooth" + #"/var/lib/nixos" + #"/var/lib/systemd/coredump" + ] + ++ networkmanager + ++ secureboot; +in { + options.soispha.impermanence = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = lib.mdDoc "Disk setup with disko"; + }; + }; + config = lib.mkIf cfg.enable { + # needed for the hm impermanence config + programs.fuse.userAllowOther = true; + + environment.persistence = { + "/srv" = { + hideMounts = true; + inherit directories; + files = [ + "/etc/machine-id" + ]; + }; + }; + }; +} diff --git a/sys/libvirtd/default.nix b/sys/libvirtd/default.nix new file mode 100644 index 00000000..3b9c7d85 --- /dev/null +++ b/sys/libvirtd/default.nix @@ -0,0 +1,27 @@ +{pkgs, ...}: { + virtualisation = { + spiceUSBRedirection.enable = true; # TODO: this allows usb access to any user, which shouldn't be that bad + # cores = 8; + # diskSize = 25000; + # useEFIBoot = true; + # resolution = { + # x = 1920; + # y = 1080; + # }; + # memorySize = 8024; + # sharedDirectories = {}; # TODO: add some + libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_full; + ovmf = { + enable = true; + packages = [pkgs.OVMFFull.fd]; + }; + }; + }; + }; + users.users.soispha.extraGroups = [ + "libvirtd" # to run libvirt stuff as this user + ]; +} diff --git a/sys/locale/default.nix b/sys/locale/default.nix new file mode 100644 index 00000000..1e7786cc --- /dev/null +++ b/sys/locale/default.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + ... +}: let + cfg = config.soispha.locale; +in { + options.soispha.locale = { + enable = lib.mkEnableOption (lib.mdDoc "locale"); + keyMap = lib.mkOption { + type = lib.types.str; + example = "us"; + default = "dvorak"; + }; + }; + + config = lib.mkIf cfg.enable { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n = { + defaultLocale = "en_CA.UTF-8"; + extraLocaleSettings = { + LANGUAGE = "en_CA:en_US:en"; + LC_TIME = "en_DK.UTF-8"; + LC_COLLATE = "C.UTF-8"; + }; + }; + + # Layout + console = { + inherit (cfg) keyMap; + }; + }; +} diff --git a/sys/network/default.nix b/sys/network/default.nix new file mode 100644 index 00000000..9c570f3b --- /dev/null +++ b/sys/network/default.nix @@ -0,0 +1,51 @@ +{ + config, + lib, + ... +}: +{ + systemd.network = { + networks = { + "tap0" = { + name = "tap0"; + bridge = [ + "virbr0" + ]; + }; + "enp4s0" = { + name = "enp4s0"; + networkConfig = { + DHCP = "yes"; + DNSOverTLS = "yes"; + DNSSEC = "yes"; + }; + bridge = [ + "virbr0" + ]; + }; + }; + netdevs = { + "tap0" = { + netdevConfig = { + Name = "tap0"; + Kind = "tap"; + }; + tapConfig = { + User = "${config.users.users.soispha.uid}"; + Group = "libvirtd"; + }; + }; + "virbr0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; + }; + }; + }; +} +// lib.mkIf config.networking.networkmanager.enable { + users.users.soispha.extraGroups = [ + "networkmanager" # allows to configure networkmanager as this user + ]; +} diff --git a/sys/nixpkgs/default.nix b/sys/nixpkgs/default.nix new file mode 100644 index 00000000..c37d5582 --- /dev/null +++ b/sys/nixpkgs/default.nix @@ -0,0 +1,20 @@ +{ + lib, + system, + overlays ? [], +}: { + # TODO: inheriting system here is discouraged, localSystem or hostSystem should be inspected + inherit system overlays; + config = { + # TODO: this fails because of the root tempsize, which should be increased + #contentAddressedByDefault = true; + + allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) [ + "steam" + "steam-original" + "steam-runtime" + "steam-run" + ]; + }; +} diff --git a/sys/options/default.nix b/sys/options/default.nix new file mode 100644 index 00000000..72ebc4fb --- /dev/null +++ b/sys/options/default.nix @@ -0,0 +1,26 @@ +{ + lib, + config, + ... +}: let + cfg = config.soispha; +in { + options.soispha = { + laptop = { + enable = lib.mkEnableOption "Laptop improvemens"; + backlight = lib.mkOption { + type = lib.types.str; + example = lib.mdDoc "intel_backlight"; + description = lib.mdDoc "Which backlight to query for the screen brightness"; + }; + }; + secrets = { + #enable = lib.mkEnableOption "Secrets through agenix"; + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = lib.mdDoc "Enable secrets through agenix"; + }; + }; + }; +} diff --git a/sys/polkit/default.nix b/sys/polkit/default.nix new file mode 100644 index 00000000..9de68f35 --- /dev/null +++ b/sys/polkit/default.nix @@ -0,0 +1,3 @@ +{...}: { + security.polkit.enable = true; +} diff --git a/sys/power/default.nix b/sys/power/default.nix new file mode 100644 index 00000000..d20a97f2 --- /dev/null +++ b/sys/power/default.nix @@ -0,0 +1,19 @@ +{...}: { + # see this for reference: https://github.com/NixOS/nixpkgs/issues/211345 + services = { + # conflicts with tlp + power-profiles-daemon.enable = false; + thermald.enable = true; + tlp = { + enable = true; + settings = { + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + SATA_LINKPWR_ON_AC = "max_performance"; + SATA_LINKPWR_ON_BAT = "min_power"; + }; + }; + }; +} diff --git a/sys/secrets/default.nix b/sys/secrets/default.nix new file mode 100644 index 00000000..d1fc1714 --- /dev/null +++ b/sys/secrets/default.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: let + name = config.networking.hostName; +in { + config = lib.mkIf config.soispha.secrets.enable { + age = { + secrets = { + nheko = { + file = ./nheko/conf. + name; + mode = "700"; + owner = "soispha"; + group = "users"; + }; + serverphoneCa = { + file = ./serverphone/ca.key; + mode = "700"; + owner = "serverphone"; + group = "serverphone"; + }; + serverphoneServer = { + file = ./serverphone/server.key; + mode = "700"; + owner = "serverphone"; + group = "serverphone"; + }; + }; + }; + }; +} diff --git a/sys/secrets/nheko/conf.apzu b/sys/secrets/nheko/conf.apzu new file mode 100644 index 00000000..a4f704ea --- /dev/null +++ b/sys/secrets/nheko/conf.apzu @@ -0,0 +1,45 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYUVBnV3NkVlZuN0IrdzdZ +UmlXZUF5cmFvd1pzOGFZNlJuRzdFY3pWV25vCjVVNksrYjhPRi9ZTy9DOXA4anY2 +N3AxWXJTT0dZZU0zOEFCSUo2dUZhK0EKLT4gc3NoLWVkMjU1MTkgN0hmRlV3IC9U +UUhPY29BU2tVY2Z3YTJicjVwZjc0dVVRVHd5bzlqS3pKMDlDc1hjM3MKVmRxc3c2 +SkZvdk9nTzhSdkV2OEdrRjFqT3gyOTFZN3BRT1pZb09nQUg1SQotPiBiLWdyZWFz +ZSBsR0txeUoKanFDNm5BCi0tLSBqWCtNdWk2cWh6WDFXRTBsTjBHaXNRdDVlY2ps +dENOeVc1YmZnNEpZVWRrCpj1HsID0+Oi3IoVUCsFVPIxeKsvptv+8T+Zycu8tmfS +gZZm0XHdJHJFh81d75YyHRBhAhuq/Rg5sR5Wdu9UAAo0NqDIlKICFfKmdrbxEj8D +QL/W6TThKeR/rDZNy2E8Y1hRgQz5y1YG91kjoZpUQReNZBugaq5P0n1UiI4YYa2Y +Dp2E0S53pnLfd3f8UyVkli8fxciFCD0l3h+pueRhEalpaJlJAublyMLXO1rPFvw5 +MiqeP77+kcEtXWC3icfPwNdVhQJEIdOHNsUh6CdD37WORZmg8Kwq2vN0cO+xlZt0 +5zRe3pcBFSzqVmVC8BYRfeJPyygEo70kqbqd5JmnC4wcqvwbHyB8JNBspqkVc0Kh ++u2iYGFjtz6hN6wCxssIOxKLhgqmY5mS0qC21stDa3MrH83cAthtTWEf4IIHduHC +qDnmcpD4dJtB5fboxBrgZ4K3TxMPgRx7J+2tqY3wtxZUEonFFH1L7MyEGmJ6cFiU +RV1cbJRwOYH5nesA4nqAP7/d42vB0unbeTrkYOpTaUSa/hOXfycCtqhtHWFB5378 +2I5wvDdZeTzt+FmQO12Qj01Pqy19FbjMmUeQtKfAiBgOSdvdGOKBA7VmFlG1sow2 +vsU09JluQok/cuDEqunun4cHxLlzTJtH9eGAKceXx3trnKz/zyzbWw55G7VQqM7a +snpi0rsikr+7i0/oxAcrMoBOEX6EDShS6Vio6IIz8KNU5zUPQW5tNbbkfMQW1GM7 +rlZScSlk4N2CmR34BwtEUbAEKzPuNZU3zOX/urDd7rN6gjqwTwa8AGH8bCItMWSI +xxzPq00znHsf2hQkLOI40ENrs84/9ZiW4X3lJSPGaT/t1plzjiPUiIb37hSA6rhR +95zo5qzsjhVJqLB5V4S9wkWJ2vN5Yc4CY6hgoRnZz3n4XoxRed/rdXZ5eUQr2kg8 +h07CNpzeCUfx73kzsrFFIkBiNe0pd3ss2UXR8ilKyY2qMjqQc9Ypd0dLFU34nK+J +t8rQShs+288ni6kXu4PgBVzT891LRuwSxzv8lIZGHtUQ7XJFSJaeFBl+jIGo3iP2 +bdxlFuikGkhyvo+H/RFrAsmxHKgVs4y+ccCkMoapyUiVRvHA2X+LK935EEbGdTI/ +wNmUTPNmB3xlnIsrPxjqw4iUCf3OXZGFd1tSGc4C+5+IYryPPX4rln8fEnmYWq8f +mbHwIjri7YOuC/dVmI+fh74M0tqL7qGtTm8j//AYo1U1a0kgOPItiRzJRLX1TZ7M +JnjQbCmyPX17liRAVbeTJGLAorYIHhCXMRSf7TYwBGgOFHGcdQteFYms2eh9asDe +Zt6Zlmk5yJxz1je+ayWFzp7rms/wEkHR3kZ9dKUMtvAtLzusWcLL4A0zuBU9+GpW +thA+tcskvhX+UR8sYLT3d71JjGPqXujdHFpp4kM/RN+vdpdF+tOm0HVIn/ZuVcNV +pvGdAcKddXH9NXrc/5EDfQWfHbUrjgdHdZVo+BcD/4EZ/k7pQ4Q8EP9IXDvYmORU +5buuZsphAs8JFnuAu0FkwOuQQHX1NjVv0XGjwWMJsTDtRpZTfTL1wJmIdolqJRcZ +5EvhzViERXdZaOOXvUzy5N2BeZA/lX8Ls5P9ygOiCfF5rDajfk6CZLqrvJ+czW6m +07lkpfCo1CsxYGQPcNWlVQOnvO9lW7EtErEOcjdt1VcWJEm462O4FiILVm6Ef0Ax +/qDJUPwFd1NjmvW9e+GkHMXHDnADKxNxQU/KJJsLVdUyZVX4BzQ3W86N/kMyyWQd +1kgAzH1Aba1XyjDGyBAwC0ll0jwemqsD1F5Wzsvmm1dHMWev9y8P/jnQ3hsZ2j1c +n91KbPiZSaqK8ARRROzaVwJMGJIqnGAtqlwD/h1dE1cfHly/OxBHoo5VXPX8R9r7 +W31vHWjKrH7ZlZUa095f3X3xxUvhhnlFFhAwXluWc+FO5IlcqWMdfaeZKYORANdR +sB/moDP0n9WDQZrql15gfca+TQZMNcba8bsa9xnnkow+Gnl3LXE8SPTCE/nWK7lr +gXczbdNe7hpj4cK4lpQMlfk4iMeHYj47k8FFBEh0dbkAz9EpZQcRTjwJScybD51S +XhcOtSD1DJsNcl4RlaraDI4LRlfPqkTGbdmWfxaBmxgSupezF3wa9IC7iXmZeCt+ +doPKlB4LGmrr9ZHX0mDEJZtdrLT1x3xR80afZPlHCI4p3bKIgcmIKyxKxDpoKCou +OPpi0J2mtDZRG7M+u4dDJhiTiYPnhWxOmlL3yHGgN09xb2ZlmO6PhH5yL7eqiItS +n/iJA0bOZE/wT19+D5DofKzs2yjGTx4L+W4= +-----END AGE ENCRYPTED FILE----- diff --git a/sys/secrets/nheko/conf.isimud b/sys/secrets/nheko/conf.isimud new file mode 100644 index 00000000..ef6c52b6 --- /dev/null +++ b/sys/secrets/nheko/conf.isimud @@ -0,0 +1,47 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAwa0Fvb0p0aU5yRGFCSm5h +d1lNSWc3aWl1NS9FcXpsalVVVGpuZGNRMnlrClVBM2R3aXpSa3pjZFpQbEV0Njcv +QUkySlJRNkV3THBjYUt3RWY3ZWRtaTgKLT4gc3NoLWVkMjU1MTkgN0hmRlV3IHda +dUU2WEwxdjNIZ0R2Wi9rbFQyb1l1TlFBZUJMWlFuMXZNSWZaZFIza2MKVGwyOExv +cW5GK0JsOFVRLzloaVUyQjhvYzR5QnNIc1RTaStISXdnT003ZwotPiBjejctZ3Jl +YXNlIFR9UFRJZyAwTjpdfCBrXlc4TXVnCmlHWTBMOUhPWU4vTzV1ZWFZVTVzTTRC +aitrNHJMQlBrMm85bWhBU29ONHpvSnkvSEFzcnZOTk5Ma1FNM20yVDUKMGF0M25C +UzR5RDdrN3cKLS0tIFNUQk1jU05lSStkQXdYMkttYjY2UVczMi9xZkhZYkdIQWw1 +RkpIOTBvWncKIACBrSaYzKJ84Kjpj57B/WC2vjIvvDAfy3TF1gVEWFOUgYkCpO52 +4sjWpd3JVpdLzsJczS7Ty0HZYBlmz3Qtejf7x6b4xftJSari5WUK6loGtmGKbgJW +lk2LZonpTsnyyALFavanlQKkv1isR9jqWxRe0KZu76zbX/QTUVfHyjV+4m6kleUI +ZJj1mLUKxYdJn2aGyTr4kwTfbLYR8/xxJYGqPUmCrFrLhsr7qy/yBXvPyIfJ+sd/ +ab2/Qz2U8wE8d0JRiwoguFaRTbrIKBzliF84CrbDznJtLQjn02zbc78lzn4n/7MV +3VArXkqw1pICkbrfLl1+own3Mw6ge73tDnSunzgJWBKSOFOrs/b/J1uMMjoiTGWi +THy8+asIFw/zZTmrUnlfmm0gE20nm/HYTJ+428nGrMwdh++LqgocxqX+CNcNTT56 +QhXwR3JuliST8jptRaFo8fzoJUImclSj+o3X2/KORm4fS8u67lcDA6KB/lw6WOie +UE09CVsrkR4X7ACe5Y7PYr0fWYNh1PrYxIabYttQq3aus5SunfkrCX+/+xtbMNsm +FX0TxMintrp3UV4eWEZzsHNz18PaXtyZTFCF4sTmnxjfP7TelZRTHNh/LbKLFrqL +kna9ChqIUiHIEYbugkZsSWUICWMbEGBWQxD4CT6DfGuve4vOgw5FWtqdvHz43f0j +9Agjvab5H+fBvDJTbJiHOFn681Wl219hR4z1plM1eVu+59JIFECVeEePoDrjGy9n +K50HUNs5Vq0p8RFus2BbjTuECmggkzd0P7mZb34bVo6K/89lCny21WeGyhwim8Hr +KKBmpm+hCh7gikBKXP0tnpmt4A5sPg30+YxePgaKCNtUjLLnN4moEGzzAsks1qsJ +GYvzSZv7AmTfyww2cjVm9ZSrlo4EHL5dMPEVBHpy6pcSV6WotkZiDklYPD4g0ZO2 +wgbLU5/YDhve9FOKoP7Y4wocP18O6ffjiPVeCg9XDUmoKq5Y/Ea1d317q973G2hf +YxUD8z9I8+fGlfqmgIjJZx8/0wTFlrCxI1oam6xPDmbSjrdVI+nr/2lfNqy/VOYN +SQMr/Po7DcAwB5SS4ItxYXKYo9FAFyoHAljYhV156l7dveqehZDKaqBzBF+pCefQ +BfiwvYg3by/R9jtMdh6MwfMeF1Z0siJdrPouIKmsuITLexuj85GkzPzSPDa69H2s +iInDepGDX2YvH2BUsUi8QPwoxRXROFwDqaIpA/aaPf224YN7D46TzU+a2HQzlpmV +xWqh/pBEwKdTpbgtdoG9GLrETDD5/2FV9FiQXxQgvV8934nlOAvdwHEJqGMlNIT2 +mlNhZyx49lOfx8BFP+NXb2adUY49Aahkdx4/uB6fN0H/RyNh39R74DCbjvIQUxRV +OUKyWZ2a2wSbZbA6tNmB5sXYtfCUOZLfE8mUwJgUSVrEccQ7UlSlEy9+gZDiHjS+ +OYnTBdRdG2AjPy3mBAdfqooTdzQwT5HNnFskg7Q3wnWRf230yZ6Qr2lBOyBgtnm1 +Hj8fI9VrACfAtYMIWUarBAnnoWHB1pHfoZOui6Zr4jtqlH7lgOAUFx/b60g4SsSF +jAJnRCFyUYbTv53GefabjkDg3WkCiyxrNhr7gS7oONa1qHai/1TQeWPCe9zj9kaR +nMRZQKI1/wmK8szhH7sA+tShtM3ktqkNlIWXuwId3OJ8ne2vcES92NRfyUI8qY39 +atndXRUg47+2MubBZhP1pnLEdxpvdOQVgDIzoNx3mu0mWkSi2K3Dy/Y4mZGVaee/ +K98cPo3S42eKEulsN/iyTWD1nJpaDNp4fWDCDMSK8dy7vSWYcT3htzzR3a4WIlLk +PV3/7l99y/HLjlJmqUwRri1hydRdC74Lk3FSV6gc6snn54WnaLUCVOpCIgHefNVr +zYmUR+4I6zioxp9540zrD8YvrK8YSSs47PtbpDYI8E9O4L7+uy7gujwJtSupZVRc +BP48+5NddK3gpQt4BagYj6CO/vENwDmUiA+kUM9WdQbnV/lmeNPdqm2VjVbxNObZ +5xHlXODOOCVg+LSpFybFT+3A2MNA/jRKGID5Kai0a9c7jY/XIrUdIaCpyVylj2dX +4JDC6AsRb1VXu7FaqhLhOabZZzW+o8m94ZjayWA2BT3IMf5Kd6eq+v9zh5RPlvtu +vcoLBTEsLPZeAyERpaTto431yRqzSKMvDQ6nwpXbdIcHLIvbp+utRoaqtel2JGO4 +PBz21qEI/ACc6sDhyUHHLz+MybEQilTSrBJ+jYSohFfm0DEpG8cThgm6mMSDUMEM +6ehgKHIYdlMa7YIBcIpJBsl8Xs6If2+FA7cbeh6xqbw= +-----END AGE ENCRYPTED FILE----- diff --git a/sys/secrets/nheko/conf.tiamat b/sys/secrets/nheko/conf.tiamat new file mode 100644 index 00000000..51cab7df --- /dev/null +++ b/sys/secrets/nheko/conf.tiamat @@ -0,0 +1,45 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCUDQ4ZUtkcEVTVWpTQ0Zy +Yi9naWRDaDJFYm9GR0k1QVhJR3V2Rmc0a2hNClNxeTQ2YmFHRkxRWnhlc3IrKzJE +eHpWNGFSTEV2WDR0OHNwTEZiMGdxOFEKLT4gc3NoLWVkMjU1MTkgelpFb25nIDFH +M3orVXZFMndGc0hPN1hWY0xyeXJuYmFLVks4bFVqdHFQVEN5eUhNRmcKUWlZdjlH +ZWtrcGlnZ2ZGVHBwNEZrM29CT3c0MERBNm5SVjhMdWxGbEgvbwotPiBULWdyZWFz +ZSBoOGYKdzBOVGpYNVJFdXoxK1dZdU9rdG5jU21UbUp4UjJYZXRoTTJqNnJvCi0t +LSBwZTJaUS9XRVRINmpNVFhxMnkvdGxkVTJaNkZTZG1PUGVZN0F5QmpJWkxrCohN +YfE5W/OxshJPerGCFWpYkFcQhJaz/HEknz13rCqH4yXfp3M7uoHWKfEFi1uzFdZs +H9MnIKS5NN8bLW4xssBaogalqCAigEUDuLPKmep8224Y4h9i+7fWOMBhgHjU322N +7iJCjnHiKT2tM4uv95c9Fa676xHcfZwzaCFDxbasQZmZL3G3U1wDseSK7EHCZ78R +sXqqd54ApUQyAwdSLPFVvX/YlhOIL6MMUWvhmmgHcNRYa71cQcoojleJI28fu53w +6X0qez81+/D8txyCEtF07m7ckCtYTe7oKT+mF5cvT99lHqEJBJzq/PxUIQt2dA2y +AQr09/7LJ5h8RYVG8emwlqzBasvCdLFXwtCNRMQGb5kDJ5CcZKy50SIpYvDdj269 +Ap4Lq/luQIeOMXQudbc+ECToxbrRKy4gcG8oKsvIXytIOszA8x4WjR14zSBTNunx +Z4mOb0zDy1GdKWsgPcyYdiOBIKzEpTLvjCbWYWJunGSPIlsksBvAAP6MsCbV0WQo +brp48ds24jlCjtqW+AdSIvo5+YVdyCEho8Gdw7k134cIhjoC0SU1vmNNzh1swoW0 +yRKG8ql2Tj6myIDcLM/KDozsgu/gNC2ugRwTCDv+gcApZBmKUXN2w0abhI2UMksH +FEw2ITrWDhPE87bXWNua+vdaBa619lg43xoJTGeJHqF5gXEV3blZ5bTvVjT2H7Dy +uBfCk+XQ4G51Dwh5iyjrQyWxCkYS0FJGD6WUTBU0nrxc6d9UERcxVurtPr7I9Tmf +IVdl6jkrjpfVIL/Imo+YgfdG9CvhyEl/x50c4umDsLxEi67v8TE/yEBhY+o5RnKD +EU0NjdHDIgtI9+Fa0KujnkIN6DqJ0V+QHKv7K8yiR8BScIq2YD1LOOApb6pom7+4 +440vZwmo4NgPsPyM/GgGUIyTeR4tU42BPyMTPjKEuN97ZwWZqIFreUl+nyLzViK/ +bGLYcRfVjjHTJPIeZRosYUo0ZMFggXAuslx5trQcb1B4iHvL7k2jjnMRJmyYZX2d +CWohscc+7+1iFNdH++tefcED8T8HCGpM1RxSM31kfpnKnINeBdo9E9ZDmNCElZm+ +nds5fgTm/MLKsuC/t+MecVdfeHTufc/Akh343DMdIMNmZ35xLcpNLmxTJ+iCALS7 +nheIWAFUaTh6GB6IGocSSjQ0RwS0wIftka4QdW+UEtEjnvB0D/CjwDLSO3pUl0mj +44r8fH8IZVcQcnqhuEsFoih/XOlH3N95O0HxXCvUcI13/HaSpUKdJqyAIn8w/jBM +FL/boJVA1zOH5sIY0AD2IMavuS5b/ZgJtPsESrc0LUiL4nztDVdAEtpHUM0OEzb9 +tSAIN888UKTC8MFSIwA+4cXIyCEpxXP3HbSNaar5gp75oG5/BqOu1aF5sC0kKpmn +9C9+z9sLTDigzV1GKlPpUGd9lVOeH2JpAY8ZUyn2gxh7C6IHwwUbWUclEPy2siYd +HcAMneEwXpm6DfJevMi2o0wOdVakcpN+YUNzIgferM/IU5FbgtC8gNBpDCBo2yLe +X7ERSzP177QWwXLIF2WhZeG4Cvszj4tySYsRJhoZPc9jpRjiK/ccOoNo8A1UKbJC +H/836MNskBmmbNoPsS979mLv8ijpRzvjnwbWn+ZlCo3gZAKVM7PcXuTODcWfoAJ4 +2ugEHCAiOobGQtGUp5HOhXYfAK2Wene0a9RmSAT3SgPmx95u1Fy8n+m/PDK2opIe +REpj9UTcoT0+5aHIwp2gqLVpQH2953Prd0qaNfc1t6gQKwDXDDU+b+QmxAaPBwpu +0TEIEYKsx237lX314XSaq+Nt7Ko1OPABR4gkz/ELL4WOKwFbf7oAAV3UiNPwweY8 +R3cpVvQ70y+M2Nnwepxf7wSruo+FDtgsic9vtobdpwBViPC+AG2QbI1hTD3uhslE +KunFtbO08ARcTMeMgZ0BE3XXnrgxdKjXmPEybQiyObFxDGbV1EX/2i1MKArQdQzs +MxCpKOzDi5axr3Qd/W6Y/foMZWfRYgb+0xITHU7haR8QRD80uTbt9TfsqK98H1A1 +UMosMKhkzKG70qdNvTiEh+OqBAIbUL42IKNn4SCiZt7ZCQ6/QqwcCi6ND0w8+dO1 +u8vZdRF+r/3AAPpa3W7BiIiLUmmU8IUI8A/72cCrY6PyrjaomXnpVWlZjQ616i9Q +TU9IwBahMa2j/a4317pv/7ltQQCpCkRs/HweQy5CQS+yFuOcoOVikL0ZHd9XC4YX +QJ/T6R5+OngxkJgoPRtJ +-----END AGE ENCRYPTED FILE----- diff --git a/sys/secrets/secrets.nix b/sys/secrets/secrets.nix new file mode 100644 index 00000000..36757546 --- /dev/null +++ b/sys/secrets/secrets.nix @@ -0,0 +1,15 @@ +let + soispha = "age1mshh4ynzhhzhff25tqwkg4j054g3xwrfznh98ycchludj9wjj48qn2uffn"; + + tiamat = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMD87QQIUXdEv3TaNRrI9clD9VgpsuVLFg2CrNGa5lVB"; + apzu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBivF5b6PyxsR/t+4Qg4IEDXHVXrjmZpslTUNXpvcVbO"; +in { + "nheko/conf.tiamat".publicKeys = [soispha tiamat]; + "nheko/conf.apzu".publicKeys = [soispha apzu]; + + # only here to satisfy the nix evaluation + "nheko/conf.isimud".publicKeys = [soispha]; + + "serverphone/ca.key".publicKeys = [soispha tiamat apzu]; + "serverphone/server.key".publicKeys = [soispha tiamat apzu]; +} diff --git a/sys/secrets/serverphone/ca.key b/sys/secrets/serverphone/ca.key new file mode 100644 index 00000000..d49c5395 --- /dev/null +++ b/sys/secrets/serverphone/ca.key @@ -0,0 +1,19 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyaGJNQkRRVy9MRXZ3b2tJ +Q2R1NUcrYUNGRE5uQkNyUDdkSm5rUWYxaXpjCjduMG1FSG1VamozdnJoVFFZUDYz +T2pyK1k3ekZ4RnFMaDFKdUZPWVNuR3MKLT4gc3NoLWVkMjU1MTkgelpFb25nIEpP +d0xwS3Nia3AwNmppRjZhODdzNXhEcnRsZW5rUzBQcTN6NWhWeTNiQ0EKTkpUZ1Jk +NHE3WVRzVEhpMnJGaVFpdkFBVW5QNThCSUdFSHVQR1RrQUJsZwotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgdjJKUUtlRjE5UFEyR2tBOWhEbHNMVlNSOUMyZ1dkYkhYZWRW +by9QZ2UxTQpVSnhJcFFYay9LSStrSFFJcXJPWUxydXNGbUNXRVpLcHJibjM2TDlw +RnlVCi0+IGNHPjMiSyQtZ3JlYXNlIGcgdWZkbApmY0YzMmhDdzBWT0RKaWlUUmZP +bmRPOExuRVJ3Yk5mMFhYSnhlRENqWXJxK1VWdnBibUxzNWV1NHMyNVNXN054CmR0 +VFAzYUR0RHVaZUpOTlB3USt2TXVDcXdLOGtpZwotLS0gaTliQzBjbjdUYkVidURX +em9wcU04cDhNMHB6KzNBSVMyMmtSRERKS240SQryB70ZEgDQ4eJ/pjIWh6MBEUQr +iAx2i+J+XJu+74bC9DfB5rWpR4/HAdp8EF6wmi05TuEPUpG9brwm/mHi+FB/Drpu +00viGfM3dlCyALz1jB2W/MbruouK85o2L3RWDCgc+eT1gA+u2C7ZxO6iYA3aP4lu +ShDcSHlsKkh9lx4cRsNTua/8N+GQZLciSC7iMDroruxWj1HET9IxeeVN+VSuqcjW +ocX3LU2uU8vP9WT9zT1lbQB5Z0EM7W+ez61SjGpzrpXB2mpmi+SHOIWF3VdG1H8R +18BIyRjKIj5Op+8XD7qAe6nl9SSCnMURH+arc7yjNMgEbzFykfldfug2ibI2G/kW +OxeiEBoSFlC+V8ivS6I= +-----END AGE ENCRYPTED FILE----- diff --git a/sys/secrets/serverphone/server.key b/sys/secrets/serverphone/server.key new file mode 100644 index 00000000..a2720406 --- /dev/null +++ b/sys/secrets/serverphone/server.key @@ -0,0 +1,19 @@ +-----BEGIN AGE ENCRYPTED FILE----- +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJZnBXSzF4K0ljR3B1Rkk1 +M0lSSkVmVlA2Tjcrd0JCRmhHWDY4bzNoYnhjCmsvQjJmYU5vNVh1Umw0dzhCQjNF +WVRhVHpUTUIzRVBxaXhFWHpuenZHN0kKLT4gc3NoLWVkMjU1MTkgelpFb25nIHAz +aG02dkxiNVRreVNadXJjbnc0bXBtSFRSNDhrYjljanUrNldwVFlabXcKU2c2L25r +VlNjeDFENUdQeWllenRGWlRqRW53UU5VNEdCaUZsbHpaL1ZFTQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgZytvUUhZSXhwQ01mQmtkZmhzdHJUd2tlQS9yYkxCdTBYZ2pJ +UEd4WEF4SQp4WVh2UEJReDVES2tCWlpqQS9aanQzRGRsSTA4S0VXSWZxZ2hoKzZq +YllzCi0+IEc4eC1ncmVhc2UgaGQhIGFydERoaS4gLERUcQprczdDdHhaOXpmN1VU +MDlHNlYzVmMxY09Oa2xzTVN6M0ZyYnpRSzJEMS9nMmlqRVo4Wk1qN1lKZnp0N0RT +UStuCm51L01Rb3ZxNUhEa0c5Z3orYlp0YmlXMkhpeHVJMjNkRFZYWmR3QmV2Zwot +LS0gdWJDeHZvc0xOMU9uUjUyMlRGUnlGSW9PZzVKWWNoa3pWbVM1OE9LdFk2NAo+ +WS82jL1us5iVw+xWVI80luHMs31hxZfQgJDBuFbtpY0nKkM97U7rusl6t8P+s93c +R0IYBEUuz6n33GTeVOLipDqkZftlOOvSZkFneZ766+GpEO01dCjeSW9KViDC1jI/ +721IXq9TQNZw0Ou3Vf5E0nDypsfG0UhEoLCy6QZL9YCIyl5s//kyFFnpQjyaGT/P +pRHGhD0BxZa2ib07WDWzBpsTFtVemwcn9lqAx7DlYV2X3UwCT3qVOVjDuA/j6qUt +8bCDoXs4/dWleHNHzpwRhe+j2W4OWDKp7o0zYqxkUuPpEWXL7+A+B/+/08nAtZQk +ZvJyaZSL5wicIPAjLxrD00z2QcE/ZPyUrXsi0gOovuk= +-----END AGE ENCRYPTED FILE----- diff --git a/sys/sound/default.nix b/sys/sound/default.nix new file mode 100644 index 00000000..318dcb8b --- /dev/null +++ b/sys/sound/default.nix @@ -0,0 +1,23 @@ +{pkgs, ...}: { + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + }; + environment.etc.pipewire-pulse-config = { + target = "pipewire/pipewire-pulse.conf.d/pipewire-pulse-config.conf"; + text = '' + # Extra scripts can be started here. Setup in default.pa can be moved in + # a script or in pulse.cmd below + context.exec = [ + { path = "${pkgs.pulseaudio}/bin/pactl" args = "set-sink-volume 0 13%" } + ] + ''; + }; +} diff --git a/sys/svcs/backup/default.nix b/sys/svcs/backup/default.nix new file mode 100644 index 00000000..171f1043 --- /dev/null +++ b/sys/svcs/backup/default.nix @@ -0,0 +1,67 @@ +{ + lib, + sysLib, + pkgs, + config, + ... +}: let + snap-sync-forked = sysLib.writeShellScriptWithLibrary { + name = "snap-sync-forked"; + src = ./snap-sync-forked; + dependencies = with pkgs; [ + bash + btrfs-progs + coreutils + gawk + gnugrep + snapper + util-linux + + # optional: + libnotify + openssh + pv + rsync + sudo + ]; + }; + backup-script = pkgs.writeShellScriptBin "backsnap" '' + ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; + ${snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; + ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; + ''; + cfg = config.soispha.fs.backup; +in { + options.soispha.fs.backup = { + enable = lib.mkEnableOption (lib.mdDoc "backups with snap-sync"); + backupDiskUuid = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; + description = lib.mdDoc "The UUID of the backup disk"; + }; + }; + config = lib.mkIf cfg.enable { + systemd = { + services.backup = { + wantedBy = lib.mkForce []; + unitConfig = { + Description = "Backup the last snapshots of the persitent-storage subvolume."; + }; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${backup-script}/bin/backsnap"; + }; + }; + timers.backup = { + wantedBy = ["timers.target"]; + unitConfig = { + Description = "Backup 15min after boot and every 8 hours"; + }; + timerConfig = { + OnBootSec = "15min"; + OnUnitActiveSec = "8h"; + }; + }; + }; + }; +} diff --git a/sys/svcs/backup/snap-sync-forked b/sys/svcs/backup/snap-sync-forked new file mode 100755 index 00000000..a66f31ae --- /dev/null +++ b/sys/svcs/backup/snap-sync-forked @@ -0,0 +1,529 @@ +#!/usr/bin/env bash +# snap-sync +# https://github.com/wesbarnett/snap-sync +# Copyright (C) 2016-2021 Wes Barnett + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., + +# ------------------------------------------------------------------------- + +# Takes snapshots of each snapper configuration. It then sends the snapshot to +# a location on an external drive. After the initial transfer, it does +# incremental snapshots on later calls. It's important not to delete the +# snapshot created on your system since that will be used to determine the +# difference for the next incremental snapshot. + +set -o errtrace + +version="0.7" +name="snap-sync" + +printf "\nsnap-sync version %s, Copyright (C) 2016-2021 Wes Barnett\n" "$version" +printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the license for more information. \n\n" + +# The following line is modified by the Makefile or +# find_snapper_config script +SNAPPER_CONFIG=/etc/sysconfig/snapper + +donotify=0 +if ! command -v notify-send &> /dev/null; then + donotify=1 +fi + +doprogress=0 +if ! command -v pv &> /dev/null; then + doprogress=1 +fi + +error() { + printf "==> ERROR: %s\n" "$@" + notify_error 'Error' 'Check journal for more information.' +} >&2 + +die() { + error "$@" + exit 1 +} + +traperror() { + printf "Exited due to error on line %s.\n" "$1" + printf "exit status: %s\n" "$2" + printf "command: %s\n" "$3" + printf "bash line: %s\n" "$4" + printf "function name: %s\n" "$5" + exit 1 +} + +trapkill() { + die "Exited due to user intervention." +} + +trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR +trap trapkill SIGTERM SIGINT + +usage() { + cat < snapper configuration to backup + -d, --description snapper description + -h, --help print this message + -n, --noconfirm do not ask for confirmation + -k, --keepold keep old incremental snapshots instead of deleting them + after backup is performed + -p, --port remote port; used with '--remote'. + -q, --quiet do not send notifications; instead print them. + -r, --remote
    ip address of a remote machine to backup to + --sudo use sudo on the remote machine + -s, --subvolid subvolume id of the mounted BTRFS subvolume to back up to + -u, --UUID UUID of the mounted BTRFS subvolume to back up to + +See 'man snap-sync' for more details. +EOF +} + +ssh="" +sudo=0 +while [[ $# -gt 0 ]]; do + key="$1" + case $key in + -d|--description) + description="$2" + shift 2 + ;; + -c|--config) + selected_configs="$2" + shift 2 + ;; + -u|--UUID) + uuid_cmdline="$2" + shift 2 + ;; + -s|--subvolid) + subvolid_cmdline="$2" + shift 2 + ;; + -k|--keepold) + keep="yes" + shift + ;; + -n|--noconfirm) + noconfirm="yes" + shift + ;; + -h|--help) + usage + exit 1 + ;; + -q|--quiet) + donotify=1 + shift + ;; + -r|--remote) + remote=$2 + shift 2 + ;; + -p|--port) + port=$2 + shift 2 + ;; + --sudo) + sudo=1 + shift + ;; + *) + die "Unknown option: '$key'. Run '$name -h' for valid options." + ;; + esac +done + +notify() { + for u in $(users | tr ' ' '\n' | sort -u); do + sudo -u "$u" DISPLAY=:0 \ + DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(sudo -u "$u" id -u)/bus" \ + notify-send -a $name "$1" "$2" --icon="dialog-$3" + done +} + +notify_info() { + if [[ $donotify -eq 0 ]]; then + notify "$1" "$2" "information" + else + printf '%s\n' "$1: $2" + fi +} + +notify_error() { + if [[ $donotify -eq 0 ]]; then + notify "$1" "$2" "error" + else + printf '%s\n' "$1: $2" + fi +} + +[[ $EUID -ne 0 ]] && die "Script must be run as root. See '$name -h' for a description of options" +! [[ -f $SNAPPER_CONFIG ]] && die "$SNAPPER_CONFIG does not exist." + +description=${description:-"latest incremental backup"} +uuid_cmdline=${uuid_cmdline:-"none"} +subvolid_cmdline=${subvolid_cmdline:-"5"} +noconfirm=${noconfirm:-"no"} + +if [[ -z $remote ]]; then + if ! command -v rsync &> /dev/null; then + die "--remote specified but rsync command not found" + fi +fi + +if [[ "$uuid_cmdline" != "none" ]]; then + if [[ -z $remote ]]; then + notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..." + else + notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid $subvolid_cmdline at $remote..." + fi +else + if [[ -z $remote ]]; then + notify_info "Backup started" "Starting backups. Use command line menu to select disk." + else + notify_info "Backup started" "Starting backups. Use command line menu to select disk on $remote." + fi +fi + +if [[ -n $remote ]]; then + ssh="ssh $remote" + if [[ -n $port ]]; then + ssh="$ssh -p $port" + fi + if [[ $sudo -eq 1 ]]; then + ssh="$ssh sudo" + fi +fi + +if [[ "$($ssh findmnt -n -v --target / -o FSTYPE)" == "btrfs" ]]; then + EXCLUDE_UUID=$($ssh findmnt -n -v -t btrfs --target / -o UUID) + TARGETS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $2}') + UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $1}') +else + TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list) + UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list) +fi + +declare -a TARGETS_ARRAY +declare -a UUIDS_ARRAY +declare -a SUBVOLIDS_ARRAY + +i=0 +for x in $TARGETS; do + SUBVOLIDS_ARRAY[$i]=$($ssh btrfs subvolume show "$x" | awk '/Subvolume ID:/ { print $3 }') + TARGETS_ARRAY[$i]=$x + i=$((i+1)) +done + +i=0 +disk=-1 +disk_count=0 +for x in $UUIDS; do + UUIDS_ARRAY[$i]=$x + if [[ "$x" == "$uuid_cmdline" && ${SUBVOLIDS_ARRAY[$((i))]} == "$subvolid_cmdline" ]]; then + disk=$i + disk_count=$((disk_count+1)) + fi + i=$((i+1)) +done + +if [[ "${#UUIDS_ARRAY[$@]}" -eq 0 ]]; then + die "No external btrfs subvolumes found to backup to. Run '$name -h' for more options." +fi + +if [[ "$disk_count" -gt 1 ]]; then + printf "Multiple mount points were found with UUID %s and subvolid %s.\n" "$uuid_cmdline" "$subvolid_cmdline" + disk="-1" +fi + +if [[ "$disk" == -1 ]]; then + if [[ "$disk_count" == 0 && "$uuid_cmdline" != "none" ]]; then + error "A device with UUID $uuid_cmdline and subvolid $subvolid_cmdline was not found to be mounted, or it is not a BTRFS device." + fi + if [[ -z $ssh ]]; then + printf "Select a mounted BTRFS device on your local machine to backup to.\nFor more options, exit and run '%s -h'.\n" "$name" + else + printf "Select a mounted BTRFS device on %s to backup to.\nFor more options, exit and run '%s -h'.\n" "$remote" "$name" + fi + while [[ $disk -lt 0 || $disk -gt $i ]]; do + for x in "${!TARGETS_ARRAY[@]}"; do + printf "%4s) %s (uuid=%s, subvolid=%s)\n" "$((x+1))" "${TARGETS_ARRAY[$x]}" "${UUIDS_ARRAY[$x]}" "${SUBVOLIDS_ARRAY[$x]}" + done + printf "%4s) Exit\n" "0" + read -e -r -p "Enter a number: " disk + if ! [[ $disk == ?(-)+([0-9]) ]] || [[ $disk -lt 0 || $disk -gt $i ]]; then + printf "\nNo disk selected. Select a disk to continue.\n" + disk=-1 + fi + done + if [[ $disk == 0 ]]; then + exit 0 + fi + disk=$((disk-1)) +fi + +selected_subvolid="${SUBVOLIDS_ARRAY[$((disk))]}" +selected_uuid="${UUIDS_ARRAY[$((disk))]}" +selected_mnt="${TARGETS_ARRAY[$((disk))]}" +printf "\nYou selected the disk with uuid=%s, subvolid=%s.\n" "$selected_uuid" "$selected_subvolid" +if [[ -z $ssh ]]; then + printf "The disk is mounted at '%s'.\n" "$selected_mnt" +else + printf "The disk is mounted at '%s:%s'.\n" "$remote" "$selected_mnt" +fi + +# shellcheck source=/etc/default/snapper +source "$SNAPPER_CONFIG" + +if [[ -z $selected_configs ]]; then + printf "\nInteractively cycling through all snapper configurations...\n" +fi +selected_configs=${selected_configs:-$SNAPPER_CONFIGS} + +declare -a BACKUPDIRS_ARRAY +declare -a MYBACKUPDIR_ARRAY +declare -a OLD_NUM_ARRAY +declare -a OLD_SNAP_ARRAY +declare -a NEW_NUM_ARRAY +declare -a NEW_SNAP_ARRAY +declare -a NEW_INFO_ARRAY +declare -a BACKUPLOC_ARRAY +declare -a CONT_BACKUP_ARRAY + +# Initial configuration of where backup directories are +i=0 +for x in $selected_configs; do + + if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {cnt++} END {print cnt}')" -gt 1 ]]; then + error "More than one snapper entry found with UUID $selected_uuid subvolid $selected_subvolid for configuration $x. Skipping configuration $x." + continue + fi + + if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'$name' backup in progress/ {cnt++} END {print cnt}')" -gt 0 ]]; then + printf "\nNOTE: Previous failed %s backup snapshots found for '%s'.\n" "$name" "$x" + if [[ $noconfirm == "yes" ]]; then + printf "'noconfirm' option passed. Failed backups will not be deleted.\n" + else + read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N]? " delete_failed + while [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && + "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && + "$delete_failed" != [Nn] ]]; do + read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N] " delete_failed + if [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && + "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && + "$delete_failed" != [Nn] ]]; then + printf "Select 'y' or 'N'.\n" + fi + done + if [[ "$delete_failed" == [Yy]"es" || "$delete_failed" == [Yy] ]]; then + # explicit split list of snapshots (on whitespace) into multiple arguments + # shellcheck disable=SC2046 + snapper -c "$x" delete $(snapper -c "$x" list --disable-used-space | awk '/'$name' backup in progress/ {print $1}') + fi + fi + fi + + SNAP_SYNC_EXCLUDE=no + + if [[ -f "/etc/snapper/configs/$x" ]]; then + # shellcheck source=/etc/snapper/config-templates/default + source "/etc/snapper/configs/$x" + else + die "Selected snapper configuration $x does not exist." + fi + + if [[ $SNAP_SYNC_EXCLUDE == "yes" ]]; then + continue + fi + + printf "\n" + + old_num=$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $1}') + old_snap=$SUBVOLUME/.snapshots/$old_num/snapshot + + OLD_NUM_ARRAY[$i]=$old_num + OLD_SNAP_ARRAY[$i]=$old_snap + + if [[ -z "$old_num" ]]; then + printf "No backups have been performed for '%s' on this disk.\n" "$x" + read -e -r -p "Enter name of subvolume to store backups, relative to $selected_mnt (to be created if not existing): " mybackupdir + printf "This will be the initial backup for snapper configuration '%s' to this disk. This could take awhile.\n" "$x" + BACKUPDIR="$selected_mnt/$mybackupdir" + $ssh test -d "$BACKUPDIR" || $ssh btrfs subvolume create "$BACKUPDIR" + else + mybackupdir=$(snapper -c "$x" list --disable-used-space -t single | awk -F"|" '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $5}' | awk -F "," '/backupdir/ {print $1}' | awk -F"=" '{print $2}') + BACKUPDIR="$selected_mnt/$mybackupdir" + $ssh test -d "$BACKUPDIR" || die "%s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid" + fi + BACKUPDIRS_ARRAY[$i]="$BACKUPDIR" + MYBACKUPDIR_ARRAY[$i]="$mybackupdir" + + printf "Creating new local snapshot for '%s' configuration...\n" "$x" + new_num=$(snapper -c "$x" create --print-number -d "$name backup in progress") + new_snap=$SUBVOLUME/.snapshots/$new_num/snapshot + new_info=$SUBVOLUME/.snapshots/$new_num/info.xml + sync + backup_location=$BACKUPDIR/$x/$new_num/ + if [[ -z $ssh ]]; then + printf "Will backup %s to %s\n" "$new_snap" "$backup_location/snapshot" + else + printf "Will backup %s to %s\n" "$new_snap" "$remote":"$backup_location/snapshot" + fi + + if ($ssh test -d "$backup_location/snapshot") ; then + printf "WARNING: Backup directory '%s' already exists. This configuration will be skipped!\n" "$backup_location/snapshot" + printf "Move or delete destination directory and try backup again.\n" + fi + + NEW_NUM_ARRAY[$i]="$new_num" + NEW_SNAP_ARRAY[$i]="$new_snap" + NEW_INFO_ARRAY[$i]="$new_info" + BACKUPLOC_ARRAY[$i]="$backup_location" + + cont_backup="K" + CONT_BACKUP_ARRAY[$i]="yes" + if [[ $noconfirm == "yes" ]]; then + cont_backup="yes" + else + while [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && + "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && + "$cont_backup" != [Nn] ]]; do + read -e -r -p "Proceed with backup of '$x' configuration [Y/n]? " cont_backup + if [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && + "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && + "$cont_backup" != [Nn] ]]; then + printf "Select 'Y' or 'n'.\n" + fi + done + fi + + if [[ "$cont_backup" != [Yy]"es" && "$cont_backup" != [Yy] && -n "$cont_backup" ]]; then + CONT_BACKUP_ARRAY[$i]="no" + printf "Not backing up '%s' configuration.\n" "$x" + snapper -c "$x" delete "$new_num" + fi + + i=$((i+1)) + +done + +# Actual backing up +printf "\nPerforming backups...\n" +i=-1 +for x in $selected_configs; do + + i=$((i+1)) + + SNAP_SYNC_EXCLUDE=no + + if [[ -f "/etc/snapper/configs/$x" ]]; then + # shellcheck source=/etc/snapper/config-templates/default + source "/etc/snapper/configs/$x" + else + die "Selected snapper configuration $x does not exist." + fi + + cont_backup=${CONT_BACKUP_ARRAY[$i]} + if [[ $cont_backup == "no" || $SNAP_SYNC_EXCLUDE == "yes" ]]; then + notify_info "Backup in progress" "NOTE: Skipping $x configuration." + continue + fi + + notify_info "Backup in progress" "Backing up $x configuration." + + printf "\n" + + old_num="${OLD_NUM_ARRAY[$i]}" + old_snap="${OLD_SNAP_ARRAY[$i]}" + BACKUPDIR="${BACKUPDIRS_ARRAY[$i]}" + mybackupdir="${MYBACKUPDIR_ARRAY[$i]}" + new_num="${NEW_NUM_ARRAY[$i]}" + new_snap="${NEW_SNAP_ARRAY[$i]}" + new_info="${NEW_INFO_ARRAY[$i]}" + backup_location="${BACKUPLOC_ARRAY[$i]}" + + if ($ssh test -d "$backup_location/snapshot") ; then + printf "ERROR: Backup directory '%s' already exists. Skipping backup of this configuration!\n" "$backup_location/snapshot" + continue + fi + + $ssh mkdir -p "$backup_location" + + if [[ -z "$old_num" ]]; then + printf "Sending first snapshot for '%s' configuration...\n" "$x" + if [[ $doprogress -eq 0 ]]; then + btrfs send "$new_snap" | pv | $ssh btrfs receive "$backup_location" &>/dev/null + else + btrfs send "$new_snap" | $ssh btrfs receive "$backup_location" &>/dev/null + fi + else + + printf "Sending incremental snapshot for '%s' configuration...\n" "$x" + # Sends the difference between the new snapshot and old snapshot to the + # backup location. Using the -c flag instead of -p tells it that there + # is an identical subvolume to the old snapshot at the receiving + # location where it can get its data. This helps speed up the transfer. + + if [[ $doprogress -eq 0 ]]; then + btrfs send -c "$old_snap" "$new_snap" | pv | $ssh btrfs receive "$backup_location" + else + btrfs send -c "$old_snap" "$new_snap" | $ssh btrfs receive "$backup_location" + fi + + if [[ $keep == "yes" ]]; then + printf "Modifying data for old local snapshot for '%s' configuration...\n" "$x" + snapper -v -c "$x" modify -d "old snap-sync snapshot (you may remove)" -u "backupdir=,subvolid=,uuid=" -c "number" "$old_num" + else + printf "Deleting old snapshot for %s...\n" "$x" + snapper -c "$x" delete "$old_num" + fi + + fi + + if [[ -z $remote ]]; then + cp "$new_info" "$backup_location" + else + if [[ -z $port ]]; then + rsync -avzq "$new_info" "$remote":"$backup_location" + else + rsync -avzqe "ssh -p $port" "$new_info" "$remote":"$backup_location" + fi + fi + + # It's important not to change this userdata in the snapshots, since that's how + # we find the previous one. + + userdata="backupdir=$mybackupdir, subvolid=$selected_subvolid, uuid=$selected_uuid" + + # Tag new snapshot as the latest + printf "Tagging local snapshot as latest backup for '%s' configuration...\n" "$x" + snapper -v -c "$x" modify -d "$description" -u "$userdata" "$new_num" + + printf "Backup complete for '%s' configuration.\n" "$x" + +done + +printf "\nDone!\n" + +if [[ "$uuid_cmdline" != "none" ]]; then + notify_info "Finished" "Backups to $uuid_cmdline complete!" +else + notify_info "Finished" "Backups complete!" +fi diff --git a/sys/svcs/dconf/default.nix b/sys/svcs/dconf/default.nix new file mode 100644 index 00000000..db35208e --- /dev/null +++ b/sys/svcs/dconf/default.nix @@ -0,0 +1,10 @@ +{ + config, + lib, + pkgs, + ... +}: { + # needed to make home-manager play nice with some apps. See: + # https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal + programs.dconf.enable = true; +} diff --git a/sys/svcs/default.nix b/sys/svcs/default.nix new file mode 100644 index 00000000..c4b95394 --- /dev/null +++ b/sys/svcs/default.nix @@ -0,0 +1,17 @@ +{...}: { + imports = [ + ./backup + ./dconf + ./fwupd + ./nix + ./openssh + ./postgresql + ./printing + ./scanning + #./serverphone + ./snapper + ./steam + ./swaylock + ./xdg + ]; +} diff --git a/sys/svcs/fwupd/default.nix b/sys/svcs/fwupd/default.nix new file mode 100644 index 00000000..999ca72b --- /dev/null +++ b/sys/svcs/fwupd/default.nix @@ -0,0 +1,3 @@ +{...}: { + services.fwupd.enable = true; +} diff --git a/sys/svcs/nix/default.nix b/sys/svcs/nix/default.nix new file mode 100644 index 00000000..97b7220d --- /dev/null +++ b/sys/svcs/nix/default.nix @@ -0,0 +1,39 @@ +{ + pkgs, + nixpkgs_as_input, + templates, + ... +}: let + nixpkgs = nixpkgs_as_input; +in { + nix = { + package = pkgs.nixStable; + + registry = { + nixpkgs.flake = nixpkgs; + n.flake = nixpkgs; + t.flake = templates; + }; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 7d"; + }; + settings = { + auto-optimise-store = true; + experimental-features = [ + "nix-command" + "flakes" + #"ca-derivations" + ]; + + #substituters = ["https://cache.ngi0.nixos.org/"]; + #trusted-public-keys = ["cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="]; + fallback = true; # TODO: what does this do? + + keep-failed = true; # keep failed tmp build dirs + pure-eval = true; # restrict file system and network access to hash + }; + }; +} diff --git a/sys/svcs/openssh/default.nix b/sys/svcs/openssh/default.nix new file mode 100644 index 00000000..b733dbe7 --- /dev/null +++ b/sys/svcs/openssh/default.nix @@ -0,0 +1,15 @@ +{...}: { + services.openssh = { + enable = true; + hostKeys = [ + { + path = "/srv/sshd/ssh_host_ed25519_key"; + rounds = 1000; + type = "ed25519"; + } + ]; + settings = { + PasswordAuthentication = false; + }; + }; +} diff --git a/sys/svcs/postgresql/default.nix b/sys/svcs/postgresql/default.nix new file mode 100644 index 00000000..4fc26034 --- /dev/null +++ b/sys/svcs/postgresql/default.nix @@ -0,0 +1,5 @@ +{...}: { + services.postgresql = { + enable = false; + }; +} diff --git a/sys/svcs/printing/default.nix b/sys/svcs/printing/default.nix new file mode 100644 index 00000000..7b8a871e --- /dev/null +++ b/sys/svcs/printing/default.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + services.avahi = { + enable = true; + nssmdns = true; + openFirewall = true; + }; + services.printing = { + enable = true; + startWhenNeeded = true; + webInterface = false; + drivers = []; + }; + hardware = { + printers = { + ensurePrinters = [ + { + name = "Brother"; + description = "Brother DCP-9022CDW"; + model = "everywhere"; + deviceUri = "ipp://BRWACD1B84F4503.local:631/ipp/print"; + } + ]; + ensureDefaultPrinter = "Brother"; + }; + }; +} diff --git a/sys/svcs/scanning/default.nix b/sys/svcs/scanning/default.nix new file mode 100644 index 00000000..6621e08f --- /dev/null +++ b/sys/svcs/scanning/default.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + hardware = { + sane = { + enable = true; + extraBackends = [pkgs.sane-airscan]; + }; + }; + + users.users.soispha.extraGroups = [ + "scanner" # for permission to access the scanner. + ]; +} diff --git a/sys/svcs/serverphone/certificates/ca.crt b/sys/svcs/serverphone/certificates/ca.crt new file mode 100644 index 00000000..7a4ae6f9 --- /dev/null +++ b/sys/svcs/serverphone/certificates/ca.crt @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBXDCCAQOgAwIBAgIIRQ2wXiaD5pMwCgYIKoZIzj0EAwIwGTEXMBUGA1UEAwwO +U2VydmVycGhvbmUgQ0EwHhcNMjMwNjA2MTIzNzM3WhcNMzMwNjAzMTIzNzM3WjAZ +MRcwFQYDVQQDDA5TZXJ2ZXJwaG9uZSBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEH +A0IABDZMtz3liWniBedisStXDO2sxFCKBH239ezH7uADu8g5peGssmNu1rXEDrg1 +sFwVUjQeJAocYYNoUeHiVpODf1ejNTAzMB0GA1UdDgQWBBST5oMmXrANRbCLIQpN +W7e5uSCL3DASBgNVHRMBAf8ECDAGAQH/AgEBMAoGCCqGSM49BAMCA0cAMEQCIFig +xA3MvRNP4uXaUEWwdP1pYL/R8N46G4NZrPEfiNV4AiA+NJSTFRCOUqEsvSb7PTFx +YuMuJF4XxWnmStz3ym7xXA== +-----END CERTIFICATE----- diff --git a/sys/svcs/serverphone/certificates/server.crt b/sys/svcs/serverphone/certificates/server.crt new file mode 100644 index 00000000..f994cdc8 --- /dev/null +++ b/sys/svcs/serverphone/certificates/server.crt @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBTjCB9KADAgECAgkAhKrdjsoiOrkwCgYIKoZIzj0EAwIwGTEXMBUGA1UEAwwO +U2VydmVycGhvbmUgQ0EwHhcNMjMwNjA2MTIzOTIwWhcNMjQwNjA1MTIzOTIwWjAm +MSQwIgYDVQQDDBtDbGllbnQgcnVubmluZyBvbiBsb2NhbGhvc3QwWTATBgcqhkjO +PQIBBggqhkjOPQMBBwNCAAS1ILQo8ae8ydqFlt5RncUT7joQiozk6Omunb0vxVz5 +toJRDmVqc1s6KhpCTipUV5coTcaK1TBz0+fft+9VH7cwoxgwFjAUBgNVHREEDTAL +gglsb2NhbGhvc3QwCgYIKoZIzj0EAwIDSQAwRgIhAN7ohtsBLrjlgmSe9ngovxZM +z61n0+/7w2mtX/OrLMWIAiEAu+D2S2o0s7E9pp2Rkug8cT5T4GCWgFgEHk5x2L/E +RVI= +-----END CERTIFICATE----- diff --git a/sys/svcs/serverphone/default.nix b/sys/svcs/serverphone/default.nix new file mode 100644 index 00000000..20125a75 --- /dev/null +++ b/sys/svcs/serverphone/default.nix @@ -0,0 +1,49 @@ +{ + config, + serverphone, + system, + lib, + ... +}: { + config = lib.mkIf config.soispha.secrets.enable { + services.serverphone = { + package = "${serverphone.packages.${system}.default}"; + enable = true; + domain = "localhost"; + configureDoas = true; + acceptedSshKeys = [ + "AAAAC3NzaC1lZDI1NTE5AAAAIGBFuTNNn71Rhfnop2cdz3r/RhWWlCePnSBOhTBbu2ME" + ]; + authorized = { + acceptedGpgKeys = [ + { + source = ./keys/key_1; + trust = "ultimate"; + } + { + source = ./keys/key_2; + trust = "ultimate"; + } + ]; + }; + caCertificate = "${./certificates/ca.crt}"; + certificate = "${./certificates/server.crt}"; + privateKey = config.age.secrets.serverphoneServer.path; + certificateRequest = { + acceptedUsers = [ + "soispha $argon2id$v=19$m=19456,t=2,p=1$EvhPENIBqL5b1RO5waNMWA$pJ8vDrCNJKDlqwB5bVDLjHVPEXm9McQhtt9OXSD8Zkc" + ]; + caPrivateKey = config.age.secrets.serverphoneCa.path; + }; + }; + + users.users.serverphone = { + group = "serverphone"; + isSystemUser = true; + home = "/run/serverphone"; + }; + users.groups.serverphone = { + members = ["serverphone"]; + }; + }; +} diff --git a/sys/svcs/serverphone/keys/key_1 b/sys/svcs/serverphone/keys/key_1 new file mode 120000 index 00000000..67720882 --- /dev/null +++ b/sys/svcs/serverphone/keys/key_1 @@ -0,0 +1 @@ +../../../../home-manager/soispha/config/gpg/keys/key_1 \ No newline at end of file diff --git a/sys/svcs/serverphone/keys/key_2 b/sys/svcs/serverphone/keys/key_2 new file mode 120000 index 00000000..24df7207 --- /dev/null +++ b/sys/svcs/serverphone/keys/key_2 @@ -0,0 +1 @@ +../../../../home-manager/soispha/config/gpg/keys/key_2 \ No newline at end of file diff --git a/sys/svcs/snapper/default.nix b/sys/svcs/snapper/default.nix new file mode 100644 index 00000000..41e4b381 --- /dev/null +++ b/sys/svcs/snapper/default.nix @@ -0,0 +1,41 @@ +{...}: { + services.snapper = { + configs = { + srv = { + SUBVOLUME = "/srv"; + FSTYPE = "btrfs"; + # users and groups allowed to work with config + ALLOW_GROUPS = ["wheel"]; + + # sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots + # directory + SYNC_ACL = true; + + # run daily number cleanup + NUMBER_CLEANUP = false; + + # limit for number cleanup + NUMBER_MIN_AGE = 1800; + NUMBER_LIMIT = 50; + NUMBER_LIMIT_IMPORTANT = 10; + + # create hourly snapshots + TIMELINE_CREATE = true; + + # cleanup hourly snapshots after some time + TIMELINE_CLEANUP = true; + + # limits for timeline cleanup + TIMELINE_MIN_AGE = 1800; + TIMELINE_LIMIT_HOURLY = 7; + TIMELINE_LIMIT_DAILY = 3; + TIMELINE_LIMIT_WEEKLY = 2; + TIMELINE_LIMIT_MONTHLY = 0; + TIMELINE_LIMIT_YEARLY = 2; + + # cleanup empty pre-post-pairs + EMPTY_PRE_POST_CLEANUP = true; + }; + }; + }; +} diff --git a/sys/svcs/steam/default.nix b/sys/svcs/steam/default.nix new file mode 100644 index 00000000..54091493 --- /dev/null +++ b/sys/svcs/steam/default.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + pkgs, + ... +}: let + cfg = config.soispha.services.steam; +in { + options.soispha.services.steam = { + enable = lib.mkOption { + default = false; + description = lib.mdDoc "Steam"; + }; + }; + config = lib.mkIf cfg.enable { + programs.steam = { + enable = true; + }; + environment.systemPackages = [ + pkgs.wineWowPackages.waylandFull + ]; + }; +} diff --git a/sys/svcs/swaylock/default.nix b/sys/svcs/swaylock/default.nix new file mode 100644 index 00000000..6cbcef28 --- /dev/null +++ b/sys/svcs/swaylock/default.nix @@ -0,0 +1,4 @@ +{...}: { + # otherwise swaylock can't access the user password. + security.pam.services.swaylock = {}; +} diff --git a/sys/svcs/xdg/default.nix b/sys/svcs/xdg/default.nix new file mode 100644 index 00000000..297928ce --- /dev/null +++ b/sys/svcs/xdg/default.nix @@ -0,0 +1,11 @@ +{pkgs, ...}: { + xdg = { + portal = { + enable = true; + # TODO: only enable the below, when on river (or wlr based compositor) + wlr.enable = true; + extraPortals = [pkgs.xdg-desktop-portal-wlr]; + }; + }; + # TODO: mime = {}; +} diff --git a/sys/tempfiles/default.nix b/sys/tempfiles/default.nix new file mode 100644 index 00000000..2d48b02e --- /dev/null +++ b/sys/tempfiles/default.nix @@ -0,0 +1,6 @@ +{config, ...}: { + systemd.tmpfiles.rules = [ + # this file is needed to trash stuff on the temp fs + "d /.Trash 1777 root root" # TODO: move this to the lf config + ]; +} diff --git a/sys/users/default.nix b/sys/users/default.nix new file mode 100644 index 00000000..365ffd41 --- /dev/null +++ b/sys/users/default.nix @@ -0,0 +1,44 @@ +{ + config, + pkgs, + lib, + ... +}: let + cfg = config.soispha.users; +in { + options.soispha.users = { + # enable = lib.mkEnableOption (lib.mdDoc "users"); + hashedPassword = lib.mkOption { + type = lib.types.str; + example = lib.literalExpression "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; + default = "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; + description = lib.mdDoc "Hashed password for the user"; + }; + }; + config = { + # I was told, that this solves some nasty problems: + programs.zsh.enable = true; + + users = { + groups = { + plugdev.members = ["soispha"]; + }; + mutableUsers = false; + users.soispha = { + isNormalUser = true; + home = "/home/soispha"; + createHome = true; + shell = pkgs.zsh; + initialHashedPassword = cfg.hashedPassword; + extraGroups = [ + "plugdev" # although deprecated, this helps with old udev rules, that still use this group. TODO: check for an open issue + "wheel" + ]; + uid = 1000; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBFuTNNn71Rhfnop2cdz3r/RhWWlCePnSBOhTBbu2ME soispha" + ]; + }; + }; + }; +} diff --git a/system/boot/boot_pictures/gnu.png b/system/boot/boot_pictures/gnu.png deleted file mode 100755 index d07dee3e..00000000 Binary files a/system/boot/boot_pictures/gnu.png and /dev/null differ diff --git a/system/boot/boot_pictures/gnulin_emb_1.png b/system/boot/boot_pictures/gnulin_emb_1.png deleted file mode 100755 index 483f2681..00000000 Binary files a/system/boot/boot_pictures/gnulin_emb_1.png and /dev/null differ diff --git a/system/boot/boot_pictures/gnulin_emb_2.png b/system/boot/boot_pictures/gnulin_emb_2.png deleted file mode 100755 index 48cd6ad7..00000000 Binary files a/system/boot/boot_pictures/gnulin_emb_2.png and /dev/null differ diff --git a/system/boot/default.nix b/system/boot/default.nix deleted file mode 100644 index 9606c7b3..00000000 --- a/system/boot/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - boot = { - initrd = { - #compressor = "lz4"; - #compressorArgs = ["-9"]; - kernelModules = ["nvme" "btrfs"]; - }; - - kernelPackages = pkgs.linuxPackages_latest; - - lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; - - loader = { - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - systemd-boot.enable = lib.mkForce false; - - grub = { - enable = false; - # theme = pkgs.nixos-grub2-theme; - splashImage = ./boot_pictures/gnu.png; - efiSupport = true; - device = "nodev"; # only for efi - }; - - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; - }; - }; -} diff --git a/system/default.nix b/system/default.nix deleted file mode 100644 index 5faa402d..00000000 --- a/system/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{lib, ...}: { - imports = [ - ./boot - ./disks - ./font - ./hardware - ./impermanence - ./libvirtd - ./locale - ./network - #./nixpkgs already at flake level imported - ./options - ./polkit - ./power - ./services - ./secrets - ./sound - ./tempfiles - ./users # the position of this item is fully arbitrary - ]; - # remove all the bloat, which nixos installs by default - environment = { - defaultPackages = lib.mkForce []; - }; -} diff --git a/system/disks/default.nix b/system/disks/default.nix deleted file mode 100644 index d238d89a..00000000 --- a/system/disks/default.nix +++ /dev/null @@ -1,130 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - cfg = config.soispha.disks; - defaultMountOptions = [ - "compress-force=zstd:15" # This saves disk space, at a performance cost - "noatime" # should have some performance upsides, and I don't use it anyways - "lazytime" # make time changes in memory - ]; -in { - options.soispha.disks = { - enable = lib.mkEnableOption "disk setup with disko"; - disk = lib.mkOption { - type = lib.types.path; - example = lib.literalExpression "/dev/disk/by-uuid/0442cb6d-f13a-4635-b487-fa76189774c5"; - description = lib.mdDoc "The disk used for installing the OS"; - }; - ssd = lib.mkOption { - type = lib.types.bool; - example = lib.literalExpression "true"; - default = false; - description = lib.mdDoc "Enable ssd specific improvements, like trim"; - }; - swap = { - uuid = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; - description = lib.mdDoc "The uuid of the swapfile"; - }; - resumeOffset = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "134324224"; - description = lib.mdDoc "The resume offset of the swapfile"; - }; - }; - }; - - config = lib.mkIf cfg.enable { - systemd = lib.recursiveUpdate (import ./hibernate.nix {inherit pkgs;}) (import ./fstrim.nix {inherit pkgs lib cfg;}); - - disko.devices = { - disk = { - main = { - device = cfg.disk; - content = { - type = "gpt"; - partitions = { - root = { - size = "100%"; - name = "root"; - content = { - type = "luks"; - name = "nixos"; - extraOpenArgs = ["--allow-discards"]; - content = { - type = "btrfs"; - extraArgs = ["-f" "--label nixos"]; # Override existing partitions - subvolumes = { - "nix" = { - mountpoint = "/nix"; - mountOptions = defaultMountOptions; - }; - "persistent-storage" = { - mountpoint = "/srv"; - mountOptions = defaultMountOptions; - }; - "persistent-storage@snapshots" = { - mountpoint = "/srv/.snapshots"; - mountOptions = defaultMountOptions; - }; - "swap" = { - mountpoint = "/swap"; - mountOptions = defaultMountOptions; - }; - }; - }; - }; - }; - boot = { - type = "EF00"; - size = "512M"; - name = "boot"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; - }; - }; - }; - }; - }; - nodev = { - "/" = { - fsType = "tmpfs"; - mountOptions = ["defaults" "size=8G" "mode=755"]; - }; - }; - }; - fileSystems = { - "/srv" = { - neededForBoot = true; - }; - "/swap" = { - neededForBoot = true; - }; - }; - swapDevices = [ - #{ - # device = "/swap/swapfile"; - # priority = 1; # lower than zramSwap, just in case - # # size = 2048; # TODO: can nixos create a btrfs swapfile correctly? - #} - ]; - zramSwap = { - enable = true; - priority = 10; # needs to be higher than hardware-swap - }; - boot = { - kernelParams = [ - "resume_offset=${cfg.swap.resumeOffset}" - "zswap.enabled=0" # zswap and zram are not really compatible - ]; - resumeDevice = "/dev/disk/by-uuid/${cfg.swap.uuid}"; - }; - }; -} diff --git a/system/disks/fstrim.nix b/system/disks/fstrim.nix deleted file mode 100644 index 6daeb65e..00000000 --- a/system/disks/fstrim.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - pkgs, - lib, - cfg, -}: { - timers.fstrim = lib.mkIf cfg.ssd { - wantedBy = ["timers.target"]; - wants = ["fstrim.service"]; - unitConfig = { - Description = "Discard unused blocks once a week"; - Documentation = "man:fstrim"; - ConditionVirtualization = "!container"; - ConditionPathExists = "!/etc/initrd-release"; - }; - timerConfig = { - OnCalendar = "weekly"; - AccuracySec = "1h"; - Persistent = "true"; - RandomizedDelaySec = "6000"; - }; - }; - services.fstrim = lib.mkIf cfg.ssd { - wantedBy = lib.mkForce []; - unitConfig = { - Description = "Discard unused blocks on filesystems from /etc/fstab"; - Documentation = "man:fstrim(8)"; - ConditionVirtualization = "!container"; - }; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.util-linux}/bin/fstrim --listed-in /etc/fstab:/proc/self/mountinfo --verbose --quiet-unsupported"; - PrivateDevices = "no"; - PrivateNetwork = "yes"; - PrivateUsers = "no"; - ProtectKernelTunables = "yes"; - ProtectKernelModules = "yes"; - ProtectControlGroups = "yes"; - MemoryDenyWriteExecute = "yes"; - SystemCallFilter = "@default @file-system @basic-io @system-service"; - }; - }; -} diff --git a/system/disks/hibernate.nix b/system/disks/hibernate.nix deleted file mode 100644 index b0aed423..00000000 --- a/system/disks/hibernate.nix +++ /dev/null @@ -1,45 +0,0 @@ -{pkgs}: { - services = { - hibernate-preparation = { - # TODO: check if they work - wantedBy = ["systemd-hibernate.service"]; - unitConfig = { - Description = "Enable swap file and disable zram before hibernate"; - Before = "systemd-hibernate.service"; - }; - serviceConfig = { - Type = "oneshot"; - User = "root"; - ExecStart = "${pkgs.bash}/bin/bash -c \"${pkgs.util-linux}/bin/swapon /swap/swapfile && ${pkgs.util-linux}/bin/swapoff /dev/zram0\""; - }; - }; - hibernate-resume = { - wantedBy = ["systemd-hibernate.service"]; - unitConfig = { - Description = "Disable swap after resuming from hibernation"; - After = "hibernate.target"; - }; - serviceConfig = { - Type = "oneshot"; - User = "root"; - ExecStart = "${pkgs.util-linux}/bin/swapoff /swap/swapfile"; - }; - }; - # swapoff-start = { - # wantedBy = ["multi-user.target"]; - # unitConfig = { - # Description = "Disable hardware swap after booting"; - # }; - # serviceConfig = { - # Type = "oneshot"; - # User = "root"; - # ExecStart = "${pkgs.util-linux}/bin/swapoff /swap/swapfile"; - # }; - # }; - systemd-hibernate.serviceConfig.Environment = "SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1"; - systemd-logind.serviceConfig.Environment = "SYSTEMD_BYPASS_HIBERNATION_MEMORY_CHECK=1"; - }; - sleep.extraConfig = '' - HibernateDelaySec=5m - ''; -} diff --git a/system/font/default.nix b/system/font/default.nix deleted file mode 100644 index 303efcf7..00000000 --- a/system/font/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: let - nerdFont = pkgs.nerdfonts.override { - fonts = [ - "SourceCodePro" - ]; - }; -in { - # TODO: maybe add other fonts? - fonts = { - packages = [ - nerdFont - ]; - fontconfig = { - defaultFonts = { - # serif = ["Vazir"]; - # sansSerif = ["Vazir"]; - monospace = ["SourceCodePro"]; - }; - }; - }; -} diff --git a/system/hardware/default.nix b/system/hardware/default.nix deleted file mode 100644 index 77d3d3f0..00000000 --- a/system/hardware/default.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - pkgs, - ... -}: { - hardware = { - keyboard.zsa.enable = false; - onlykey.enable = true; - opengl = { - enable = true; - extraPackages = builtins.attrValues { - inherit - (pkgs) - vaapiVdpau - libvdpau-va-gl - ; - }; - }; - }; - services.udev.extraRules = '' - # Rules for Oryx web flashing and live training - KERNEL=="hidraw*", ATTRS{idVendor}=="16c0", MODE="0664", GROUP="plugdev" - KERNEL=="hidraw*", ATTRS{idVendor}=="3297", MODE="0664", GROUP="plugdev" - - # Legacy rules for live training over webusb (Not needed for firmware v21+) - # Rule for all ZSA keyboards - SUBSYSTEM=="usb", ATTR{idVendor}=="3297", GROUP="plugdev" - # Rule for the Moonlander - SUBSYSTEM=="usb", ATTR{idVendor}=="3297", ATTR{idProduct}=="1969", GROUP="plugdev" - # Rule for the Ergodox EZ - SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="1307", GROUP="plugdev" - # Rule for the Planck EZ - SUBSYSTEM=="usb", ATTR{idVendor}=="feed", ATTR{idProduct}=="6060", GROUP="plugdev" - - # Wally Flashing rules for the Ergodox EZ - ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", ENV{ID_MM_DEVICE_IGNORE}="1" - ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789A]?", ENV{MTP_NO_PROBE}="1" - SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789ABCD]?", MODE:="0666" - KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="04[789B]?", MODE:="0666" - - # Wally Flashing rules for the Moonlander and Planck EZ - SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", \ - MODE:="0666", \ - SYMLINK+="stm32_dfu" - ''; -} diff --git a/system/impermanence/default.nix b/system/impermanence/default.nix deleted file mode 100644 index a9be951a..00000000 --- a/system/impermanence/default.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.impermanence; - networkmanager = - if config.networking.networkmanager.enable - then [ - "/etc/NetworkManager" # store the networkmanager configs - ] - else []; - secureboot = - if config.boot.lanzaboote.enable - then [ - "/etc/secureboot" - ] - else []; - directories = - [ - "/etc/nixos" - "/var/log" - # TODO: the following entries need to be checked - #"/var/lib/bluetooth" - #"/var/lib/nixos" - #"/var/lib/systemd/coredump" - ] - ++ networkmanager - ++ secureboot; -in { - options.soispha.impermanence = { - enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = lib.mdDoc "Disk setup with disko"; - }; - }; - config = lib.mkIf cfg.enable { - # needed for the hm impermanence config - programs.fuse.userAllowOther = true; - - environment.persistence = { - "/srv" = { - hideMounts = true; - inherit directories; - files = [ - "/etc/machine-id" - ]; - }; - }; - }; -} diff --git a/system/libvirtd/default.nix b/system/libvirtd/default.nix deleted file mode 100644 index 3b9c7d85..00000000 --- a/system/libvirtd/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{pkgs, ...}: { - virtualisation = { - spiceUSBRedirection.enable = true; # TODO: this allows usb access to any user, which shouldn't be that bad - # cores = 8; - # diskSize = 25000; - # useEFIBoot = true; - # resolution = { - # x = 1920; - # y = 1080; - # }; - # memorySize = 8024; - # sharedDirectories = {}; # TODO: add some - libvirtd = { - enable = true; - qemu = { - package = pkgs.qemu_full; - ovmf = { - enable = true; - packages = [pkgs.OVMFFull.fd]; - }; - }; - }; - }; - users.users.soispha.extraGroups = [ - "libvirtd" # to run libvirt stuff as this user - ]; -} diff --git a/system/locale/default.nix b/system/locale/default.nix deleted file mode 100644 index 1e7786cc..00000000 --- a/system/locale/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.locale; -in { - options.soispha.locale = { - enable = lib.mkEnableOption (lib.mdDoc "locale"); - keyMap = lib.mkOption { - type = lib.types.str; - example = "us"; - default = "dvorak"; - }; - }; - - config = lib.mkIf cfg.enable { - # Set your time zone. - time.timeZone = "Europe/Berlin"; - - # Select internationalisation properties. - i18n = { - defaultLocale = "en_CA.UTF-8"; - extraLocaleSettings = { - LANGUAGE = "en_CA:en_US:en"; - LC_TIME = "en_DK.UTF-8"; - LC_COLLATE = "C.UTF-8"; - }; - }; - - # Layout - console = { - inherit (cfg) keyMap; - }; - }; -} diff --git a/system/network/default.nix b/system/network/default.nix deleted file mode 100644 index 9c570f3b..00000000 --- a/system/network/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ - config, - lib, - ... -}: -{ - systemd.network = { - networks = { - "tap0" = { - name = "tap0"; - bridge = [ - "virbr0" - ]; - }; - "enp4s0" = { - name = "enp4s0"; - networkConfig = { - DHCP = "yes"; - DNSOverTLS = "yes"; - DNSSEC = "yes"; - }; - bridge = [ - "virbr0" - ]; - }; - }; - netdevs = { - "tap0" = { - netdevConfig = { - Name = "tap0"; - Kind = "tap"; - }; - tapConfig = { - User = "${config.users.users.soispha.uid}"; - Group = "libvirtd"; - }; - }; - "virbr0" = { - netdevConfig = { - Name = "br0"; - Kind = "bridge"; - }; - }; - }; - }; -} -// lib.mkIf config.networking.networkmanager.enable { - users.users.soispha.extraGroups = [ - "networkmanager" # allows to configure networkmanager as this user - ]; -} diff --git a/system/nixpkgs/default.nix b/system/nixpkgs/default.nix deleted file mode 100644 index c37d5582..00000000 --- a/system/nixpkgs/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - system, - overlays ? [], -}: { - # TODO: inheriting system here is discouraged, localSystem or hostSystem should be inspected - inherit system overlays; - config = { - # TODO: this fails because of the root tempsize, which should be increased - #contentAddressedByDefault = true; - - allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "steam" - "steam-original" - "steam-runtime" - "steam-run" - ]; - }; -} diff --git a/system/options/default.nix b/system/options/default.nix deleted file mode 100644 index 72ebc4fb..00000000 --- a/system/options/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - lib, - config, - ... -}: let - cfg = config.soispha; -in { - options.soispha = { - laptop = { - enable = lib.mkEnableOption "Laptop improvemens"; - backlight = lib.mkOption { - type = lib.types.str; - example = lib.mdDoc "intel_backlight"; - description = lib.mdDoc "Which backlight to query for the screen brightness"; - }; - }; - secrets = { - #enable = lib.mkEnableOption "Secrets through agenix"; - enable = lib.mkOption { - type = lib.types.bool; - default = true; - description = lib.mdDoc "Enable secrets through agenix"; - }; - }; - }; -} diff --git a/system/polkit/default.nix b/system/polkit/default.nix deleted file mode 100644 index 9de68f35..00000000 --- a/system/polkit/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - security.polkit.enable = true; -} diff --git a/system/power/default.nix b/system/power/default.nix deleted file mode 100644 index d20a97f2..00000000 --- a/system/power/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{...}: { - # see this for reference: https://github.com/NixOS/nixpkgs/issues/211345 - services = { - # conflicts with tlp - power-profiles-daemon.enable = false; - thermald.enable = true; - tlp = { - enable = true; - settings = { - CPU_BOOST_ON_AC = 1; - CPU_BOOST_ON_BAT = 0; - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - SATA_LINKPWR_ON_AC = "max_performance"; - SATA_LINKPWR_ON_BAT = "min_power"; - }; - }; - }; -} diff --git a/system/secrets/default.nix b/system/secrets/default.nix deleted file mode 100644 index d1fc1714..00000000 --- a/system/secrets/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - config, - lib, - ... -}: let - name = config.networking.hostName; -in { - config = lib.mkIf config.soispha.secrets.enable { - age = { - secrets = { - nheko = { - file = ./nheko/conf. + name; - mode = "700"; - owner = "soispha"; - group = "users"; - }; - serverphoneCa = { - file = ./serverphone/ca.key; - mode = "700"; - owner = "serverphone"; - group = "serverphone"; - }; - serverphoneServer = { - file = ./serverphone/server.key; - mode = "700"; - owner = "serverphone"; - group = "serverphone"; - }; - }; - }; - }; -} diff --git a/system/secrets/nheko/conf.apzu b/system/secrets/nheko/conf.apzu deleted file mode 100644 index a4f704ea..00000000 --- a/system/secrets/nheko/conf.apzu +++ /dev/null @@ -1,45 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBYUVBnV3NkVlZuN0IrdzdZ -UmlXZUF5cmFvd1pzOGFZNlJuRzdFY3pWV25vCjVVNksrYjhPRi9ZTy9DOXA4anY2 -N3AxWXJTT0dZZU0zOEFCSUo2dUZhK0EKLT4gc3NoLWVkMjU1MTkgN0hmRlV3IC9U -UUhPY29BU2tVY2Z3YTJicjVwZjc0dVVRVHd5bzlqS3pKMDlDc1hjM3MKVmRxc3c2 -SkZvdk9nTzhSdkV2OEdrRjFqT3gyOTFZN3BRT1pZb09nQUg1SQotPiBiLWdyZWFz -ZSBsR0txeUoKanFDNm5BCi0tLSBqWCtNdWk2cWh6WDFXRTBsTjBHaXNRdDVlY2ps -dENOeVc1YmZnNEpZVWRrCpj1HsID0+Oi3IoVUCsFVPIxeKsvptv+8T+Zycu8tmfS -gZZm0XHdJHJFh81d75YyHRBhAhuq/Rg5sR5Wdu9UAAo0NqDIlKICFfKmdrbxEj8D -QL/W6TThKeR/rDZNy2E8Y1hRgQz5y1YG91kjoZpUQReNZBugaq5P0n1UiI4YYa2Y -Dp2E0S53pnLfd3f8UyVkli8fxciFCD0l3h+pueRhEalpaJlJAublyMLXO1rPFvw5 -MiqeP77+kcEtXWC3icfPwNdVhQJEIdOHNsUh6CdD37WORZmg8Kwq2vN0cO+xlZt0 -5zRe3pcBFSzqVmVC8BYRfeJPyygEo70kqbqd5JmnC4wcqvwbHyB8JNBspqkVc0Kh -+u2iYGFjtz6hN6wCxssIOxKLhgqmY5mS0qC21stDa3MrH83cAthtTWEf4IIHduHC -qDnmcpD4dJtB5fboxBrgZ4K3TxMPgRx7J+2tqY3wtxZUEonFFH1L7MyEGmJ6cFiU -RV1cbJRwOYH5nesA4nqAP7/d42vB0unbeTrkYOpTaUSa/hOXfycCtqhtHWFB5378 -2I5wvDdZeTzt+FmQO12Qj01Pqy19FbjMmUeQtKfAiBgOSdvdGOKBA7VmFlG1sow2 -vsU09JluQok/cuDEqunun4cHxLlzTJtH9eGAKceXx3trnKz/zyzbWw55G7VQqM7a -snpi0rsikr+7i0/oxAcrMoBOEX6EDShS6Vio6IIz8KNU5zUPQW5tNbbkfMQW1GM7 -rlZScSlk4N2CmR34BwtEUbAEKzPuNZU3zOX/urDd7rN6gjqwTwa8AGH8bCItMWSI -xxzPq00znHsf2hQkLOI40ENrs84/9ZiW4X3lJSPGaT/t1plzjiPUiIb37hSA6rhR -95zo5qzsjhVJqLB5V4S9wkWJ2vN5Yc4CY6hgoRnZz3n4XoxRed/rdXZ5eUQr2kg8 -h07CNpzeCUfx73kzsrFFIkBiNe0pd3ss2UXR8ilKyY2qMjqQc9Ypd0dLFU34nK+J -t8rQShs+288ni6kXu4PgBVzT891LRuwSxzv8lIZGHtUQ7XJFSJaeFBl+jIGo3iP2 -bdxlFuikGkhyvo+H/RFrAsmxHKgVs4y+ccCkMoapyUiVRvHA2X+LK935EEbGdTI/ -wNmUTPNmB3xlnIsrPxjqw4iUCf3OXZGFd1tSGc4C+5+IYryPPX4rln8fEnmYWq8f -mbHwIjri7YOuC/dVmI+fh74M0tqL7qGtTm8j//AYo1U1a0kgOPItiRzJRLX1TZ7M -JnjQbCmyPX17liRAVbeTJGLAorYIHhCXMRSf7TYwBGgOFHGcdQteFYms2eh9asDe -Zt6Zlmk5yJxz1je+ayWFzp7rms/wEkHR3kZ9dKUMtvAtLzusWcLL4A0zuBU9+GpW -thA+tcskvhX+UR8sYLT3d71JjGPqXujdHFpp4kM/RN+vdpdF+tOm0HVIn/ZuVcNV -pvGdAcKddXH9NXrc/5EDfQWfHbUrjgdHdZVo+BcD/4EZ/k7pQ4Q8EP9IXDvYmORU -5buuZsphAs8JFnuAu0FkwOuQQHX1NjVv0XGjwWMJsTDtRpZTfTL1wJmIdolqJRcZ -5EvhzViERXdZaOOXvUzy5N2BeZA/lX8Ls5P9ygOiCfF5rDajfk6CZLqrvJ+czW6m -07lkpfCo1CsxYGQPcNWlVQOnvO9lW7EtErEOcjdt1VcWJEm462O4FiILVm6Ef0Ax -/qDJUPwFd1NjmvW9e+GkHMXHDnADKxNxQU/KJJsLVdUyZVX4BzQ3W86N/kMyyWQd -1kgAzH1Aba1XyjDGyBAwC0ll0jwemqsD1F5Wzsvmm1dHMWev9y8P/jnQ3hsZ2j1c -n91KbPiZSaqK8ARRROzaVwJMGJIqnGAtqlwD/h1dE1cfHly/OxBHoo5VXPX8R9r7 -W31vHWjKrH7ZlZUa095f3X3xxUvhhnlFFhAwXluWc+FO5IlcqWMdfaeZKYORANdR -sB/moDP0n9WDQZrql15gfca+TQZMNcba8bsa9xnnkow+Gnl3LXE8SPTCE/nWK7lr -gXczbdNe7hpj4cK4lpQMlfk4iMeHYj47k8FFBEh0dbkAz9EpZQcRTjwJScybD51S -XhcOtSD1DJsNcl4RlaraDI4LRlfPqkTGbdmWfxaBmxgSupezF3wa9IC7iXmZeCt+ -doPKlB4LGmrr9ZHX0mDEJZtdrLT1x3xR80afZPlHCI4p3bKIgcmIKyxKxDpoKCou -OPpi0J2mtDZRG7M+u4dDJhiTiYPnhWxOmlL3yHGgN09xb2ZlmO6PhH5yL7eqiItS -n/iJA0bOZE/wT19+D5DofKzs2yjGTx4L+W4= ------END AGE ENCRYPTED FILE----- diff --git a/system/secrets/nheko/conf.isimud b/system/secrets/nheko/conf.isimud deleted file mode 100644 index ef6c52b6..00000000 --- a/system/secrets/nheko/conf.isimud +++ /dev/null @@ -1,47 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAwa0Fvb0p0aU5yRGFCSm5h -d1lNSWc3aWl1NS9FcXpsalVVVGpuZGNRMnlrClVBM2R3aXpSa3pjZFpQbEV0Njcv -QUkySlJRNkV3THBjYUt3RWY3ZWRtaTgKLT4gc3NoLWVkMjU1MTkgN0hmRlV3IHda -dUU2WEwxdjNIZ0R2Wi9rbFQyb1l1TlFBZUJMWlFuMXZNSWZaZFIza2MKVGwyOExv -cW5GK0JsOFVRLzloaVUyQjhvYzR5QnNIc1RTaStISXdnT003ZwotPiBjejctZ3Jl -YXNlIFR9UFRJZyAwTjpdfCBrXlc4TXVnCmlHWTBMOUhPWU4vTzV1ZWFZVTVzTTRC -aitrNHJMQlBrMm85bWhBU29ONHpvSnkvSEFzcnZOTk5Ma1FNM20yVDUKMGF0M25C -UzR5RDdrN3cKLS0tIFNUQk1jU05lSStkQXdYMkttYjY2UVczMi9xZkhZYkdIQWw1 -RkpIOTBvWncKIACBrSaYzKJ84Kjpj57B/WC2vjIvvDAfy3TF1gVEWFOUgYkCpO52 -4sjWpd3JVpdLzsJczS7Ty0HZYBlmz3Qtejf7x6b4xftJSari5WUK6loGtmGKbgJW -lk2LZonpTsnyyALFavanlQKkv1isR9jqWxRe0KZu76zbX/QTUVfHyjV+4m6kleUI -ZJj1mLUKxYdJn2aGyTr4kwTfbLYR8/xxJYGqPUmCrFrLhsr7qy/yBXvPyIfJ+sd/ -ab2/Qz2U8wE8d0JRiwoguFaRTbrIKBzliF84CrbDznJtLQjn02zbc78lzn4n/7MV -3VArXkqw1pICkbrfLl1+own3Mw6ge73tDnSunzgJWBKSOFOrs/b/J1uMMjoiTGWi -THy8+asIFw/zZTmrUnlfmm0gE20nm/HYTJ+428nGrMwdh++LqgocxqX+CNcNTT56 -QhXwR3JuliST8jptRaFo8fzoJUImclSj+o3X2/KORm4fS8u67lcDA6KB/lw6WOie -UE09CVsrkR4X7ACe5Y7PYr0fWYNh1PrYxIabYttQq3aus5SunfkrCX+/+xtbMNsm -FX0TxMintrp3UV4eWEZzsHNz18PaXtyZTFCF4sTmnxjfP7TelZRTHNh/LbKLFrqL -kna9ChqIUiHIEYbugkZsSWUICWMbEGBWQxD4CT6DfGuve4vOgw5FWtqdvHz43f0j -9Agjvab5H+fBvDJTbJiHOFn681Wl219hR4z1plM1eVu+59JIFECVeEePoDrjGy9n -K50HUNs5Vq0p8RFus2BbjTuECmggkzd0P7mZb34bVo6K/89lCny21WeGyhwim8Hr -KKBmpm+hCh7gikBKXP0tnpmt4A5sPg30+YxePgaKCNtUjLLnN4moEGzzAsks1qsJ -GYvzSZv7AmTfyww2cjVm9ZSrlo4EHL5dMPEVBHpy6pcSV6WotkZiDklYPD4g0ZO2 -wgbLU5/YDhve9FOKoP7Y4wocP18O6ffjiPVeCg9XDUmoKq5Y/Ea1d317q973G2hf -YxUD8z9I8+fGlfqmgIjJZx8/0wTFlrCxI1oam6xPDmbSjrdVI+nr/2lfNqy/VOYN -SQMr/Po7DcAwB5SS4ItxYXKYo9FAFyoHAljYhV156l7dveqehZDKaqBzBF+pCefQ -BfiwvYg3by/R9jtMdh6MwfMeF1Z0siJdrPouIKmsuITLexuj85GkzPzSPDa69H2s -iInDepGDX2YvH2BUsUi8QPwoxRXROFwDqaIpA/aaPf224YN7D46TzU+a2HQzlpmV -xWqh/pBEwKdTpbgtdoG9GLrETDD5/2FV9FiQXxQgvV8934nlOAvdwHEJqGMlNIT2 -mlNhZyx49lOfx8BFP+NXb2adUY49Aahkdx4/uB6fN0H/RyNh39R74DCbjvIQUxRV -OUKyWZ2a2wSbZbA6tNmB5sXYtfCUOZLfE8mUwJgUSVrEccQ7UlSlEy9+gZDiHjS+ -OYnTBdRdG2AjPy3mBAdfqooTdzQwT5HNnFskg7Q3wnWRf230yZ6Qr2lBOyBgtnm1 -Hj8fI9VrACfAtYMIWUarBAnnoWHB1pHfoZOui6Zr4jtqlH7lgOAUFx/b60g4SsSF -jAJnRCFyUYbTv53GefabjkDg3WkCiyxrNhr7gS7oONa1qHai/1TQeWPCe9zj9kaR -nMRZQKI1/wmK8szhH7sA+tShtM3ktqkNlIWXuwId3OJ8ne2vcES92NRfyUI8qY39 -atndXRUg47+2MubBZhP1pnLEdxpvdOQVgDIzoNx3mu0mWkSi2K3Dy/Y4mZGVaee/ -K98cPo3S42eKEulsN/iyTWD1nJpaDNp4fWDCDMSK8dy7vSWYcT3htzzR3a4WIlLk -PV3/7l99y/HLjlJmqUwRri1hydRdC74Lk3FSV6gc6snn54WnaLUCVOpCIgHefNVr -zYmUR+4I6zioxp9540zrD8YvrK8YSSs47PtbpDYI8E9O4L7+uy7gujwJtSupZVRc -BP48+5NddK3gpQt4BagYj6CO/vENwDmUiA+kUM9WdQbnV/lmeNPdqm2VjVbxNObZ -5xHlXODOOCVg+LSpFybFT+3A2MNA/jRKGID5Kai0a9c7jY/XIrUdIaCpyVylj2dX -4JDC6AsRb1VXu7FaqhLhOabZZzW+o8m94ZjayWA2BT3IMf5Kd6eq+v9zh5RPlvtu -vcoLBTEsLPZeAyERpaTto431yRqzSKMvDQ6nwpXbdIcHLIvbp+utRoaqtel2JGO4 -PBz21qEI/ACc6sDhyUHHLz+MybEQilTSrBJ+jYSohFfm0DEpG8cThgm6mMSDUMEM -6ehgKHIYdlMa7YIBcIpJBsl8Xs6If2+FA7cbeh6xqbw= ------END AGE ENCRYPTED FILE----- diff --git a/system/secrets/nheko/conf.tiamat b/system/secrets/nheko/conf.tiamat deleted file mode 100644 index 51cab7df..00000000 --- a/system/secrets/nheko/conf.tiamat +++ /dev/null @@ -1,45 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCUDQ4ZUtkcEVTVWpTQ0Zy -Yi9naWRDaDJFYm9GR0k1QVhJR3V2Rmc0a2hNClNxeTQ2YmFHRkxRWnhlc3IrKzJE -eHpWNGFSTEV2WDR0OHNwTEZiMGdxOFEKLT4gc3NoLWVkMjU1MTkgelpFb25nIDFH -M3orVXZFMndGc0hPN1hWY0xyeXJuYmFLVks4bFVqdHFQVEN5eUhNRmcKUWlZdjlH -ZWtrcGlnZ2ZGVHBwNEZrM29CT3c0MERBNm5SVjhMdWxGbEgvbwotPiBULWdyZWFz -ZSBoOGYKdzBOVGpYNVJFdXoxK1dZdU9rdG5jU21UbUp4UjJYZXRoTTJqNnJvCi0t -LSBwZTJaUS9XRVRINmpNVFhxMnkvdGxkVTJaNkZTZG1PUGVZN0F5QmpJWkxrCohN -YfE5W/OxshJPerGCFWpYkFcQhJaz/HEknz13rCqH4yXfp3M7uoHWKfEFi1uzFdZs -H9MnIKS5NN8bLW4xssBaogalqCAigEUDuLPKmep8224Y4h9i+7fWOMBhgHjU322N -7iJCjnHiKT2tM4uv95c9Fa676xHcfZwzaCFDxbasQZmZL3G3U1wDseSK7EHCZ78R -sXqqd54ApUQyAwdSLPFVvX/YlhOIL6MMUWvhmmgHcNRYa71cQcoojleJI28fu53w -6X0qez81+/D8txyCEtF07m7ckCtYTe7oKT+mF5cvT99lHqEJBJzq/PxUIQt2dA2y -AQr09/7LJ5h8RYVG8emwlqzBasvCdLFXwtCNRMQGb5kDJ5CcZKy50SIpYvDdj269 -Ap4Lq/luQIeOMXQudbc+ECToxbrRKy4gcG8oKsvIXytIOszA8x4WjR14zSBTNunx -Z4mOb0zDy1GdKWsgPcyYdiOBIKzEpTLvjCbWYWJunGSPIlsksBvAAP6MsCbV0WQo -brp48ds24jlCjtqW+AdSIvo5+YVdyCEho8Gdw7k134cIhjoC0SU1vmNNzh1swoW0 -yRKG8ql2Tj6myIDcLM/KDozsgu/gNC2ugRwTCDv+gcApZBmKUXN2w0abhI2UMksH -FEw2ITrWDhPE87bXWNua+vdaBa619lg43xoJTGeJHqF5gXEV3blZ5bTvVjT2H7Dy -uBfCk+XQ4G51Dwh5iyjrQyWxCkYS0FJGD6WUTBU0nrxc6d9UERcxVurtPr7I9Tmf -IVdl6jkrjpfVIL/Imo+YgfdG9CvhyEl/x50c4umDsLxEi67v8TE/yEBhY+o5RnKD -EU0NjdHDIgtI9+Fa0KujnkIN6DqJ0V+QHKv7K8yiR8BScIq2YD1LOOApb6pom7+4 -440vZwmo4NgPsPyM/GgGUIyTeR4tU42BPyMTPjKEuN97ZwWZqIFreUl+nyLzViK/ -bGLYcRfVjjHTJPIeZRosYUo0ZMFggXAuslx5trQcb1B4iHvL7k2jjnMRJmyYZX2d -CWohscc+7+1iFNdH++tefcED8T8HCGpM1RxSM31kfpnKnINeBdo9E9ZDmNCElZm+ -nds5fgTm/MLKsuC/t+MecVdfeHTufc/Akh343DMdIMNmZ35xLcpNLmxTJ+iCALS7 -nheIWAFUaTh6GB6IGocSSjQ0RwS0wIftka4QdW+UEtEjnvB0D/CjwDLSO3pUl0mj -44r8fH8IZVcQcnqhuEsFoih/XOlH3N95O0HxXCvUcI13/HaSpUKdJqyAIn8w/jBM -FL/boJVA1zOH5sIY0AD2IMavuS5b/ZgJtPsESrc0LUiL4nztDVdAEtpHUM0OEzb9 -tSAIN888UKTC8MFSIwA+4cXIyCEpxXP3HbSNaar5gp75oG5/BqOu1aF5sC0kKpmn -9C9+z9sLTDigzV1GKlPpUGd9lVOeH2JpAY8ZUyn2gxh7C6IHwwUbWUclEPy2siYd -HcAMneEwXpm6DfJevMi2o0wOdVakcpN+YUNzIgferM/IU5FbgtC8gNBpDCBo2yLe -X7ERSzP177QWwXLIF2WhZeG4Cvszj4tySYsRJhoZPc9jpRjiK/ccOoNo8A1UKbJC -H/836MNskBmmbNoPsS979mLv8ijpRzvjnwbWn+ZlCo3gZAKVM7PcXuTODcWfoAJ4 -2ugEHCAiOobGQtGUp5HOhXYfAK2Wene0a9RmSAT3SgPmx95u1Fy8n+m/PDK2opIe -REpj9UTcoT0+5aHIwp2gqLVpQH2953Prd0qaNfc1t6gQKwDXDDU+b+QmxAaPBwpu -0TEIEYKsx237lX314XSaq+Nt7Ko1OPABR4gkz/ELL4WOKwFbf7oAAV3UiNPwweY8 -R3cpVvQ70y+M2Nnwepxf7wSruo+FDtgsic9vtobdpwBViPC+AG2QbI1hTD3uhslE -KunFtbO08ARcTMeMgZ0BE3XXnrgxdKjXmPEybQiyObFxDGbV1EX/2i1MKArQdQzs -MxCpKOzDi5axr3Qd/W6Y/foMZWfRYgb+0xITHU7haR8QRD80uTbt9TfsqK98H1A1 -UMosMKhkzKG70qdNvTiEh+OqBAIbUL42IKNn4SCiZt7ZCQ6/QqwcCi6ND0w8+dO1 -u8vZdRF+r/3AAPpa3W7BiIiLUmmU8IUI8A/72cCrY6PyrjaomXnpVWlZjQ616i9Q -TU9IwBahMa2j/a4317pv/7ltQQCpCkRs/HweQy5CQS+yFuOcoOVikL0ZHd9XC4YX -QJ/T6R5+OngxkJgoPRtJ ------END AGE ENCRYPTED FILE----- diff --git a/system/secrets/secrets.nix b/system/secrets/secrets.nix deleted file mode 100644 index 36757546..00000000 --- a/system/secrets/secrets.nix +++ /dev/null @@ -1,15 +0,0 @@ -let - soispha = "age1mshh4ynzhhzhff25tqwkg4j054g3xwrfznh98ycchludj9wjj48qn2uffn"; - - tiamat = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMD87QQIUXdEv3TaNRrI9clD9VgpsuVLFg2CrNGa5lVB"; - apzu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBivF5b6PyxsR/t+4Qg4IEDXHVXrjmZpslTUNXpvcVbO"; -in { - "nheko/conf.tiamat".publicKeys = [soispha tiamat]; - "nheko/conf.apzu".publicKeys = [soispha apzu]; - - # only here to satisfy the nix evaluation - "nheko/conf.isimud".publicKeys = [soispha]; - - "serverphone/ca.key".publicKeys = [soispha tiamat apzu]; - "serverphone/server.key".publicKeys = [soispha tiamat apzu]; -} diff --git a/system/secrets/serverphone/ca.key b/system/secrets/serverphone/ca.key deleted file mode 100644 index d49c5395..00000000 --- a/system/secrets/serverphone/ca.key +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyaGJNQkRRVy9MRXZ3b2tJ -Q2R1NUcrYUNGRE5uQkNyUDdkSm5rUWYxaXpjCjduMG1FSG1VamozdnJoVFFZUDYz -T2pyK1k3ekZ4RnFMaDFKdUZPWVNuR3MKLT4gc3NoLWVkMjU1MTkgelpFb25nIEpP -d0xwS3Nia3AwNmppRjZhODdzNXhEcnRsZW5rUzBQcTN6NWhWeTNiQ0EKTkpUZ1Jk -NHE3WVRzVEhpMnJGaVFpdkFBVW5QNThCSUdFSHVQR1RrQUJsZwotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgdjJKUUtlRjE5UFEyR2tBOWhEbHNMVlNSOUMyZ1dkYkhYZWRW -by9QZ2UxTQpVSnhJcFFYay9LSStrSFFJcXJPWUxydXNGbUNXRVpLcHJibjM2TDlw -RnlVCi0+IGNHPjMiSyQtZ3JlYXNlIGcgdWZkbApmY0YzMmhDdzBWT0RKaWlUUmZP -bmRPOExuRVJ3Yk5mMFhYSnhlRENqWXJxK1VWdnBibUxzNWV1NHMyNVNXN054CmR0 -VFAzYUR0RHVaZUpOTlB3USt2TXVDcXdLOGtpZwotLS0gaTliQzBjbjdUYkVidURX -em9wcU04cDhNMHB6KzNBSVMyMmtSRERKS240SQryB70ZEgDQ4eJ/pjIWh6MBEUQr -iAx2i+J+XJu+74bC9DfB5rWpR4/HAdp8EF6wmi05TuEPUpG9brwm/mHi+FB/Drpu -00viGfM3dlCyALz1jB2W/MbruouK85o2L3RWDCgc+eT1gA+u2C7ZxO6iYA3aP4lu -ShDcSHlsKkh9lx4cRsNTua/8N+GQZLciSC7iMDroruxWj1HET9IxeeVN+VSuqcjW -ocX3LU2uU8vP9WT9zT1lbQB5Z0EM7W+ez61SjGpzrpXB2mpmi+SHOIWF3VdG1H8R -18BIyRjKIj5Op+8XD7qAe6nl9SSCnMURH+arc7yjNMgEbzFykfldfug2ibI2G/kW -OxeiEBoSFlC+V8ivS6I= ------END AGE ENCRYPTED FILE----- diff --git a/system/secrets/serverphone/server.key b/system/secrets/serverphone/server.key deleted file mode 100644 index a2720406..00000000 --- a/system/secrets/serverphone/server.key +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBJZnBXSzF4K0ljR3B1Rkk1 -M0lSSkVmVlA2Tjcrd0JCRmhHWDY4bzNoYnhjCmsvQjJmYU5vNVh1Umw0dzhCQjNF -WVRhVHpUTUIzRVBxaXhFWHpuenZHN0kKLT4gc3NoLWVkMjU1MTkgelpFb25nIHAz -aG02dkxiNVRreVNadXJjbnc0bXBtSFRSNDhrYjljanUrNldwVFlabXcKU2c2L25r -VlNjeDFENUdQeWllenRGWlRqRW53UU5VNEdCaUZsbHpaL1ZFTQotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgZytvUUhZSXhwQ01mQmtkZmhzdHJUd2tlQS9yYkxCdTBYZ2pJ -UEd4WEF4SQp4WVh2UEJReDVES2tCWlpqQS9aanQzRGRsSTA4S0VXSWZxZ2hoKzZq -YllzCi0+IEc4eC1ncmVhc2UgaGQhIGFydERoaS4gLERUcQprczdDdHhaOXpmN1VU -MDlHNlYzVmMxY09Oa2xzTVN6M0ZyYnpRSzJEMS9nMmlqRVo4Wk1qN1lKZnp0N0RT -UStuCm51L01Rb3ZxNUhEa0c5Z3orYlp0YmlXMkhpeHVJMjNkRFZYWmR3QmV2Zwot -LS0gdWJDeHZvc0xOMU9uUjUyMlRGUnlGSW9PZzVKWWNoa3pWbVM1OE9LdFk2NAo+ -WS82jL1us5iVw+xWVI80luHMs31hxZfQgJDBuFbtpY0nKkM97U7rusl6t8P+s93c -R0IYBEUuz6n33GTeVOLipDqkZftlOOvSZkFneZ766+GpEO01dCjeSW9KViDC1jI/ -721IXq9TQNZw0Ou3Vf5E0nDypsfG0UhEoLCy6QZL9YCIyl5s//kyFFnpQjyaGT/P -pRHGhD0BxZa2ib07WDWzBpsTFtVemwcn9lqAx7DlYV2X3UwCT3qVOVjDuA/j6qUt -8bCDoXs4/dWleHNHzpwRhe+j2W4OWDKp7o0zYqxkUuPpEWXL7+A+B/+/08nAtZQk -ZvJyaZSL5wicIPAjLxrD00z2QcE/ZPyUrXsi0gOovuk= ------END AGE ENCRYPTED FILE----- diff --git a/system/services/backup/default.nix b/system/services/backup/default.nix deleted file mode 100644 index 171f1043..00000000 --- a/system/services/backup/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ - lib, - sysLib, - pkgs, - config, - ... -}: let - snap-sync-forked = sysLib.writeShellScriptWithLibrary { - name = "snap-sync-forked"; - src = ./snap-sync-forked; - dependencies = with pkgs; [ - bash - btrfs-progs - coreutils - gawk - gnugrep - snapper - util-linux - - # optional: - libnotify - openssh - pv - rsync - sudo - ]; - }; - backup-script = pkgs.writeShellScriptBin "backsnap" '' - ${pkgs.util-linux}/bin/mount --mkdir "/dev/disk/by-uuid/${cfg.backupDiskUuid}" "/run/media/${cfg.backupDiskUuid}"; - ${snap-sync-forked}/bin/snap-sync-forked --UUID "${cfg.backupDiskUuid}" --noconfirm; - ${pkgs.util-linux}/bin/umount "/run/media/${cfg.backupDiskUuid}"; - ''; - cfg = config.soispha.fs.backup; -in { - options.soispha.fs.backup = { - enable = lib.mkEnableOption (lib.mdDoc "backups with snap-sync"); - backupDiskUuid = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "d1d20ae7-3d8a-44da-86da-677dbbb10c89"; - description = lib.mdDoc "The UUID of the backup disk"; - }; - }; - config = lib.mkIf cfg.enable { - systemd = { - services.backup = { - wantedBy = lib.mkForce []; - unitConfig = { - Description = "Backup the last snapshots of the persitent-storage subvolume."; - }; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${backup-script}/bin/backsnap"; - }; - }; - timers.backup = { - wantedBy = ["timers.target"]; - unitConfig = { - Description = "Backup 15min after boot and every 8 hours"; - }; - timerConfig = { - OnBootSec = "15min"; - OnUnitActiveSec = "8h"; - }; - }; - }; - }; -} diff --git a/system/services/backup/snap-sync-forked b/system/services/backup/snap-sync-forked deleted file mode 100755 index a66f31ae..00000000 --- a/system/services/backup/snap-sync-forked +++ /dev/null @@ -1,529 +0,0 @@ -#!/usr/bin/env bash -# snap-sync -# https://github.com/wesbarnett/snap-sync -# Copyright (C) 2016-2021 Wes Barnett - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., - -# ------------------------------------------------------------------------- - -# Takes snapshots of each snapper configuration. It then sends the snapshot to -# a location on an external drive. After the initial transfer, it does -# incremental snapshots on later calls. It's important not to delete the -# snapshot created on your system since that will be used to determine the -# difference for the next incremental snapshot. - -set -o errtrace - -version="0.7" -name="snap-sync" - -printf "\nsnap-sync version %s, Copyright (C) 2016-2021 Wes Barnett\n" "$version" -printf "snap-sync comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. See the license for more information. \n\n" - -# The following line is modified by the Makefile or -# find_snapper_config script -SNAPPER_CONFIG=/etc/sysconfig/snapper - -donotify=0 -if ! command -v notify-send &> /dev/null; then - donotify=1 -fi - -doprogress=0 -if ! command -v pv &> /dev/null; then - doprogress=1 -fi - -error() { - printf "==> ERROR: %s\n" "$@" - notify_error 'Error' 'Check journal for more information.' -} >&2 - -die() { - error "$@" - exit 1 -} - -traperror() { - printf "Exited due to error on line %s.\n" "$1" - printf "exit status: %s\n" "$2" - printf "command: %s\n" "$3" - printf "bash line: %s\n" "$4" - printf "function name: %s\n" "$5" - exit 1 -} - -trapkill() { - die "Exited due to user intervention." -} - -trap 'traperror ${LINENO} $? "$BASH_COMMAND" $BASH_LINENO "${FUNCNAME[@]}"' ERR -trap trapkill SIGTERM SIGINT - -usage() { - cat < snapper configuration to backup - -d, --description snapper description - -h, --help print this message - -n, --noconfirm do not ask for confirmation - -k, --keepold keep old incremental snapshots instead of deleting them - after backup is performed - -p, --port remote port; used with '--remote'. - -q, --quiet do not send notifications; instead print them. - -r, --remote
    ip address of a remote machine to backup to - --sudo use sudo on the remote machine - -s, --subvolid subvolume id of the mounted BTRFS subvolume to back up to - -u, --UUID UUID of the mounted BTRFS subvolume to back up to - -See 'man snap-sync' for more details. -EOF -} - -ssh="" -sudo=0 -while [[ $# -gt 0 ]]; do - key="$1" - case $key in - -d|--description) - description="$2" - shift 2 - ;; - -c|--config) - selected_configs="$2" - shift 2 - ;; - -u|--UUID) - uuid_cmdline="$2" - shift 2 - ;; - -s|--subvolid) - subvolid_cmdline="$2" - shift 2 - ;; - -k|--keepold) - keep="yes" - shift - ;; - -n|--noconfirm) - noconfirm="yes" - shift - ;; - -h|--help) - usage - exit 1 - ;; - -q|--quiet) - donotify=1 - shift - ;; - -r|--remote) - remote=$2 - shift 2 - ;; - -p|--port) - port=$2 - shift 2 - ;; - --sudo) - sudo=1 - shift - ;; - *) - die "Unknown option: '$key'. Run '$name -h' for valid options." - ;; - esac -done - -notify() { - for u in $(users | tr ' ' '\n' | sort -u); do - sudo -u "$u" DISPLAY=:0 \ - DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(sudo -u "$u" id -u)/bus" \ - notify-send -a $name "$1" "$2" --icon="dialog-$3" - done -} - -notify_info() { - if [[ $donotify -eq 0 ]]; then - notify "$1" "$2" "information" - else - printf '%s\n' "$1: $2" - fi -} - -notify_error() { - if [[ $donotify -eq 0 ]]; then - notify "$1" "$2" "error" - else - printf '%s\n' "$1: $2" - fi -} - -[[ $EUID -ne 0 ]] && die "Script must be run as root. See '$name -h' for a description of options" -! [[ -f $SNAPPER_CONFIG ]] && die "$SNAPPER_CONFIG does not exist." - -description=${description:-"latest incremental backup"} -uuid_cmdline=${uuid_cmdline:-"none"} -subvolid_cmdline=${subvolid_cmdline:-"5"} -noconfirm=${noconfirm:-"no"} - -if [[ -z $remote ]]; then - if ! command -v rsync &> /dev/null; then - die "--remote specified but rsync command not found" - fi -fi - -if [[ "$uuid_cmdline" != "none" ]]; then - if [[ -z $remote ]]; then - notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid=$subvolid_cmdline..." - else - notify_info "Backup started" "Starting backups to $uuid_cmdline subvolid $subvolid_cmdline at $remote..." - fi -else - if [[ -z $remote ]]; then - notify_info "Backup started" "Starting backups. Use command line menu to select disk." - else - notify_info "Backup started" "Starting backups. Use command line menu to select disk on $remote." - fi -fi - -if [[ -n $remote ]]; then - ssh="ssh $remote" - if [[ -n $port ]]; then - ssh="$ssh -p $port" - fi - if [[ $sudo -eq 1 ]]; then - ssh="$ssh sudo" - fi -fi - -if [[ "$($ssh findmnt -n -v --target / -o FSTYPE)" == "btrfs" ]]; then - EXCLUDE_UUID=$($ssh findmnt -n -v -t btrfs --target / -o UUID) - TARGETS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $2}') - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID,TARGET --list | grep -v "$EXCLUDE_UUID" | awk '{print $1}') -else - TARGETS=$($ssh findmnt -n -v -t btrfs -o TARGET --list) - UUIDS=$($ssh findmnt -n -v -t btrfs -o UUID --list) -fi - -declare -a TARGETS_ARRAY -declare -a UUIDS_ARRAY -declare -a SUBVOLIDS_ARRAY - -i=0 -for x in $TARGETS; do - SUBVOLIDS_ARRAY[$i]=$($ssh btrfs subvolume show "$x" | awk '/Subvolume ID:/ { print $3 }') - TARGETS_ARRAY[$i]=$x - i=$((i+1)) -done - -i=0 -disk=-1 -disk_count=0 -for x in $UUIDS; do - UUIDS_ARRAY[$i]=$x - if [[ "$x" == "$uuid_cmdline" && ${SUBVOLIDS_ARRAY[$((i))]} == "$subvolid_cmdline" ]]; then - disk=$i - disk_count=$((disk_count+1)) - fi - i=$((i+1)) -done - -if [[ "${#UUIDS_ARRAY[$@]}" -eq 0 ]]; then - die "No external btrfs subvolumes found to backup to. Run '$name -h' for more options." -fi - -if [[ "$disk_count" -gt 1 ]]; then - printf "Multiple mount points were found with UUID %s and subvolid %s.\n" "$uuid_cmdline" "$subvolid_cmdline" - disk="-1" -fi - -if [[ "$disk" == -1 ]]; then - if [[ "$disk_count" == 0 && "$uuid_cmdline" != "none" ]]; then - error "A device with UUID $uuid_cmdline and subvolid $subvolid_cmdline was not found to be mounted, or it is not a BTRFS device." - fi - if [[ -z $ssh ]]; then - printf "Select a mounted BTRFS device on your local machine to backup to.\nFor more options, exit and run '%s -h'.\n" "$name" - else - printf "Select a mounted BTRFS device on %s to backup to.\nFor more options, exit and run '%s -h'.\n" "$remote" "$name" - fi - while [[ $disk -lt 0 || $disk -gt $i ]]; do - for x in "${!TARGETS_ARRAY[@]}"; do - printf "%4s) %s (uuid=%s, subvolid=%s)\n" "$((x+1))" "${TARGETS_ARRAY[$x]}" "${UUIDS_ARRAY[$x]}" "${SUBVOLIDS_ARRAY[$x]}" - done - printf "%4s) Exit\n" "0" - read -e -r -p "Enter a number: " disk - if ! [[ $disk == ?(-)+([0-9]) ]] || [[ $disk -lt 0 || $disk -gt $i ]]; then - printf "\nNo disk selected. Select a disk to continue.\n" - disk=-1 - fi - done - if [[ $disk == 0 ]]; then - exit 0 - fi - disk=$((disk-1)) -fi - -selected_subvolid="${SUBVOLIDS_ARRAY[$((disk))]}" -selected_uuid="${UUIDS_ARRAY[$((disk))]}" -selected_mnt="${TARGETS_ARRAY[$((disk))]}" -printf "\nYou selected the disk with uuid=%s, subvolid=%s.\n" "$selected_uuid" "$selected_subvolid" -if [[ -z $ssh ]]; then - printf "The disk is mounted at '%s'.\n" "$selected_mnt" -else - printf "The disk is mounted at '%s:%s'.\n" "$remote" "$selected_mnt" -fi - -# shellcheck source=/etc/default/snapper -source "$SNAPPER_CONFIG" - -if [[ -z $selected_configs ]]; then - printf "\nInteractively cycling through all snapper configurations...\n" -fi -selected_configs=${selected_configs:-$SNAPPER_CONFIGS} - -declare -a BACKUPDIRS_ARRAY -declare -a MYBACKUPDIR_ARRAY -declare -a OLD_NUM_ARRAY -declare -a OLD_SNAP_ARRAY -declare -a NEW_NUM_ARRAY -declare -a NEW_SNAP_ARRAY -declare -a NEW_INFO_ARRAY -declare -a BACKUPLOC_ARRAY -declare -a CONT_BACKUP_ARRAY - -# Initial configuration of where backup directories are -i=0 -for x in $selected_configs; do - - if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {cnt++} END {print cnt}')" -gt 1 ]]; then - error "More than one snapper entry found with UUID $selected_uuid subvolid $selected_subvolid for configuration $x. Skipping configuration $x." - continue - fi - - if [[ "$(snapper -c "$x" list --disable-used-space -t single | awk '/'$name' backup in progress/ {cnt++} END {print cnt}')" -gt 0 ]]; then - printf "\nNOTE: Previous failed %s backup snapshots found for '%s'.\n" "$name" "$x" - if [[ $noconfirm == "yes" ]]; then - printf "'noconfirm' option passed. Failed backups will not be deleted.\n" - else - read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N]? " delete_failed - while [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && - "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && - "$delete_failed" != [Nn] ]]; do - read -e -r -p "Delete failed backup snapshot(s)? (These local snapshots from failed backups are not used.) [y/N] " delete_failed - if [[ -n "$delete_failed" && "$delete_failed" != [Yy]"es" && - "$delete_failed" != [Yy] && "$delete_failed" != [Nn]"o" && - "$delete_failed" != [Nn] ]]; then - printf "Select 'y' or 'N'.\n" - fi - done - if [[ "$delete_failed" == [Yy]"es" || "$delete_failed" == [Yy] ]]; then - # explicit split list of snapshots (on whitespace) into multiple arguments - # shellcheck disable=SC2046 - snapper -c "$x" delete $(snapper -c "$x" list --disable-used-space | awk '/'$name' backup in progress/ {print $1}') - fi - fi - fi - - SNAP_SYNC_EXCLUDE=no - - if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/etc/snapper/config-templates/default - source "/etc/snapper/configs/$x" - else - die "Selected snapper configuration $x does not exist." - fi - - if [[ $SNAP_SYNC_EXCLUDE == "yes" ]]; then - continue - fi - - printf "\n" - - old_num=$(snapper -c "$x" list --disable-used-space -t single | awk '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $1}') - old_snap=$SUBVOLUME/.snapshots/$old_num/snapshot - - OLD_NUM_ARRAY[$i]=$old_num - OLD_SNAP_ARRAY[$i]=$old_snap - - if [[ -z "$old_num" ]]; then - printf "No backups have been performed for '%s' on this disk.\n" "$x" - read -e -r -p "Enter name of subvolume to store backups, relative to $selected_mnt (to be created if not existing): " mybackupdir - printf "This will be the initial backup for snapper configuration '%s' to this disk. This could take awhile.\n" "$x" - BACKUPDIR="$selected_mnt/$mybackupdir" - $ssh test -d "$BACKUPDIR" || $ssh btrfs subvolume create "$BACKUPDIR" - else - mybackupdir=$(snapper -c "$x" list --disable-used-space -t single | awk -F"|" '/'"subvolid=$selected_subvolid, uuid=$selected_uuid"'/ {print $5}' | awk -F "," '/backupdir/ {print $1}' | awk -F"=" '{print $2}') - BACKUPDIR="$selected_mnt/$mybackupdir" - $ssh test -d "$BACKUPDIR" || die "%s is not a directory on %s.\n" "$BACKUPDIR" "$selected_uuid" - fi - BACKUPDIRS_ARRAY[$i]="$BACKUPDIR" - MYBACKUPDIR_ARRAY[$i]="$mybackupdir" - - printf "Creating new local snapshot for '%s' configuration...\n" "$x" - new_num=$(snapper -c "$x" create --print-number -d "$name backup in progress") - new_snap=$SUBVOLUME/.snapshots/$new_num/snapshot - new_info=$SUBVOLUME/.snapshots/$new_num/info.xml - sync - backup_location=$BACKUPDIR/$x/$new_num/ - if [[ -z $ssh ]]; then - printf "Will backup %s to %s\n" "$new_snap" "$backup_location/snapshot" - else - printf "Will backup %s to %s\n" "$new_snap" "$remote":"$backup_location/snapshot" - fi - - if ($ssh test -d "$backup_location/snapshot") ; then - printf "WARNING: Backup directory '%s' already exists. This configuration will be skipped!\n" "$backup_location/snapshot" - printf "Move or delete destination directory and try backup again.\n" - fi - - NEW_NUM_ARRAY[$i]="$new_num" - NEW_SNAP_ARRAY[$i]="$new_snap" - NEW_INFO_ARRAY[$i]="$new_info" - BACKUPLOC_ARRAY[$i]="$backup_location" - - cont_backup="K" - CONT_BACKUP_ARRAY[$i]="yes" - if [[ $noconfirm == "yes" ]]; then - cont_backup="yes" - else - while [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && - "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && - "$cont_backup" != [Nn] ]]; do - read -e -r -p "Proceed with backup of '$x' configuration [Y/n]? " cont_backup - if [[ -n "$cont_backup" && "$cont_backup" != [Yy]"es" && - "$cont_backup" != [Yy] && "$cont_backup" != [Nn]"o" && - "$cont_backup" != [Nn] ]]; then - printf "Select 'Y' or 'n'.\n" - fi - done - fi - - if [[ "$cont_backup" != [Yy]"es" && "$cont_backup" != [Yy] && -n "$cont_backup" ]]; then - CONT_BACKUP_ARRAY[$i]="no" - printf "Not backing up '%s' configuration.\n" "$x" - snapper -c "$x" delete "$new_num" - fi - - i=$((i+1)) - -done - -# Actual backing up -printf "\nPerforming backups...\n" -i=-1 -for x in $selected_configs; do - - i=$((i+1)) - - SNAP_SYNC_EXCLUDE=no - - if [[ -f "/etc/snapper/configs/$x" ]]; then - # shellcheck source=/etc/snapper/config-templates/default - source "/etc/snapper/configs/$x" - else - die "Selected snapper configuration $x does not exist." - fi - - cont_backup=${CONT_BACKUP_ARRAY[$i]} - if [[ $cont_backup == "no" || $SNAP_SYNC_EXCLUDE == "yes" ]]; then - notify_info "Backup in progress" "NOTE: Skipping $x configuration." - continue - fi - - notify_info "Backup in progress" "Backing up $x configuration." - - printf "\n" - - old_num="${OLD_NUM_ARRAY[$i]}" - old_snap="${OLD_SNAP_ARRAY[$i]}" - BACKUPDIR="${BACKUPDIRS_ARRAY[$i]}" - mybackupdir="${MYBACKUPDIR_ARRAY[$i]}" - new_num="${NEW_NUM_ARRAY[$i]}" - new_snap="${NEW_SNAP_ARRAY[$i]}" - new_info="${NEW_INFO_ARRAY[$i]}" - backup_location="${BACKUPLOC_ARRAY[$i]}" - - if ($ssh test -d "$backup_location/snapshot") ; then - printf "ERROR: Backup directory '%s' already exists. Skipping backup of this configuration!\n" "$backup_location/snapshot" - continue - fi - - $ssh mkdir -p "$backup_location" - - if [[ -z "$old_num" ]]; then - printf "Sending first snapshot for '%s' configuration...\n" "$x" - if [[ $doprogress -eq 0 ]]; then - btrfs send "$new_snap" | pv | $ssh btrfs receive "$backup_location" &>/dev/null - else - btrfs send "$new_snap" | $ssh btrfs receive "$backup_location" &>/dev/null - fi - else - - printf "Sending incremental snapshot for '%s' configuration...\n" "$x" - # Sends the difference between the new snapshot and old snapshot to the - # backup location. Using the -c flag instead of -p tells it that there - # is an identical subvolume to the old snapshot at the receiving - # location where it can get its data. This helps speed up the transfer. - - if [[ $doprogress -eq 0 ]]; then - btrfs send -c "$old_snap" "$new_snap" | pv | $ssh btrfs receive "$backup_location" - else - btrfs send -c "$old_snap" "$new_snap" | $ssh btrfs receive "$backup_location" - fi - - if [[ $keep == "yes" ]]; then - printf "Modifying data for old local snapshot for '%s' configuration...\n" "$x" - snapper -v -c "$x" modify -d "old snap-sync snapshot (you may remove)" -u "backupdir=,subvolid=,uuid=" -c "number" "$old_num" - else - printf "Deleting old snapshot for %s...\n" "$x" - snapper -c "$x" delete "$old_num" - fi - - fi - - if [[ -z $remote ]]; then - cp "$new_info" "$backup_location" - else - if [[ -z $port ]]; then - rsync -avzq "$new_info" "$remote":"$backup_location" - else - rsync -avzqe "ssh -p $port" "$new_info" "$remote":"$backup_location" - fi - fi - - # It's important not to change this userdata in the snapshots, since that's how - # we find the previous one. - - userdata="backupdir=$mybackupdir, subvolid=$selected_subvolid, uuid=$selected_uuid" - - # Tag new snapshot as the latest - printf "Tagging local snapshot as latest backup for '%s' configuration...\n" "$x" - snapper -v -c "$x" modify -d "$description" -u "$userdata" "$new_num" - - printf "Backup complete for '%s' configuration.\n" "$x" - -done - -printf "\nDone!\n" - -if [[ "$uuid_cmdline" != "none" ]]; then - notify_info "Finished" "Backups to $uuid_cmdline complete!" -else - notify_info "Finished" "Backups complete!" -fi diff --git a/system/services/dconf/default.nix b/system/services/dconf/default.nix deleted file mode 100644 index db35208e..00000000 --- a/system/services/dconf/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - # needed to make home-manager play nice with some apps. See: - # https://nix-community.github.io/home-manager/index.html#_why_do_i_get_an_error_message_about_literal_ca_desrt_dconf_literal_or_literal_dconf_service_literal - programs.dconf.enable = true; -} diff --git a/system/services/default.nix b/system/services/default.nix deleted file mode 100644 index c4b95394..00000000 --- a/system/services/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{...}: { - imports = [ - ./backup - ./dconf - ./fwupd - ./nix - ./openssh - ./postgresql - ./printing - ./scanning - #./serverphone - ./snapper - ./steam - ./swaylock - ./xdg - ]; -} diff --git a/system/services/fwupd/default.nix b/system/services/fwupd/default.nix deleted file mode 100644 index 999ca72b..00000000 --- a/system/services/fwupd/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{...}: { - services.fwupd.enable = true; -} diff --git a/system/services/nix/default.nix b/system/services/nix/default.nix deleted file mode 100644 index 97b7220d..00000000 --- a/system/services/nix/default.nix +++ /dev/null @@ -1,39 +0,0 @@ -{ - pkgs, - nixpkgs_as_input, - templates, - ... -}: let - nixpkgs = nixpkgs_as_input; -in { - nix = { - package = pkgs.nixStable; - - registry = { - nixpkgs.flake = nixpkgs; - n.flake = nixpkgs; - t.flake = templates; - }; - - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 7d"; - }; - settings = { - auto-optimise-store = true; - experimental-features = [ - "nix-command" - "flakes" - #"ca-derivations" - ]; - - #substituters = ["https://cache.ngi0.nixos.org/"]; - #trusted-public-keys = ["cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA="]; - fallback = true; # TODO: what does this do? - - keep-failed = true; # keep failed tmp build dirs - pure-eval = true; # restrict file system and network access to hash - }; - }; -} diff --git a/system/services/openssh/default.nix b/system/services/openssh/default.nix deleted file mode 100644 index b733dbe7..00000000 --- a/system/services/openssh/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{...}: { - services.openssh = { - enable = true; - hostKeys = [ - { - path = "/srv/sshd/ssh_host_ed25519_key"; - rounds = 1000; - type = "ed25519"; - } - ]; - settings = { - PasswordAuthentication = false; - }; - }; -} diff --git a/system/services/postgresql/default.nix b/system/services/postgresql/default.nix deleted file mode 100644 index 4fc26034..00000000 --- a/system/services/postgresql/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{...}: { - services.postgresql = { - enable = false; - }; -} diff --git a/system/services/printing/default.nix b/system/services/printing/default.nix deleted file mode 100644 index 7b8a871e..00000000 --- a/system/services/printing/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - services.avahi = { - enable = true; - nssmdns = true; - openFirewall = true; - }; - services.printing = { - enable = true; - startWhenNeeded = true; - webInterface = false; - drivers = []; - }; - hardware = { - printers = { - ensurePrinters = [ - { - name = "Brother"; - description = "Brother DCP-9022CDW"; - model = "everywhere"; - deviceUri = "ipp://BRWACD1B84F4503.local:631/ipp/print"; - } - ]; - ensureDefaultPrinter = "Brother"; - }; - }; -} diff --git a/system/services/scanning/default.nix b/system/services/scanning/default.nix deleted file mode 100644 index 6621e08f..00000000 --- a/system/services/scanning/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - hardware = { - sane = { - enable = true; - extraBackends = [pkgs.sane-airscan]; - }; - }; - - users.users.soispha.extraGroups = [ - "scanner" # for permission to access the scanner. - ]; -} diff --git a/system/services/serverphone/certificates/ca.crt b/system/services/serverphone/certificates/ca.crt deleted file mode 100644 index 7a4ae6f9..00000000 --- a/system/services/serverphone/certificates/ca.crt +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBXDCCAQOgAwIBAgIIRQ2wXiaD5pMwCgYIKoZIzj0EAwIwGTEXMBUGA1UEAwwO -U2VydmVycGhvbmUgQ0EwHhcNMjMwNjA2MTIzNzM3WhcNMzMwNjAzMTIzNzM3WjAZ -MRcwFQYDVQQDDA5TZXJ2ZXJwaG9uZSBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEH -A0IABDZMtz3liWniBedisStXDO2sxFCKBH239ezH7uADu8g5peGssmNu1rXEDrg1 -sFwVUjQeJAocYYNoUeHiVpODf1ejNTAzMB0GA1UdDgQWBBST5oMmXrANRbCLIQpN -W7e5uSCL3DASBgNVHRMBAf8ECDAGAQH/AgEBMAoGCCqGSM49BAMCA0cAMEQCIFig -xA3MvRNP4uXaUEWwdP1pYL/R8N46G4NZrPEfiNV4AiA+NJSTFRCOUqEsvSb7PTFx -YuMuJF4XxWnmStz3ym7xXA== ------END CERTIFICATE----- diff --git a/system/services/serverphone/certificates/server.crt b/system/services/serverphone/certificates/server.crt deleted file mode 100644 index f994cdc8..00000000 --- a/system/services/serverphone/certificates/server.crt +++ /dev/null @@ -1,10 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIBTjCB9KADAgECAgkAhKrdjsoiOrkwCgYIKoZIzj0EAwIwGTEXMBUGA1UEAwwO -U2VydmVycGhvbmUgQ0EwHhcNMjMwNjA2MTIzOTIwWhcNMjQwNjA1MTIzOTIwWjAm -MSQwIgYDVQQDDBtDbGllbnQgcnVubmluZyBvbiBsb2NhbGhvc3QwWTATBgcqhkjO -PQIBBggqhkjOPQMBBwNCAAS1ILQo8ae8ydqFlt5RncUT7joQiozk6Omunb0vxVz5 -toJRDmVqc1s6KhpCTipUV5coTcaK1TBz0+fft+9VH7cwoxgwFjAUBgNVHREEDTAL -gglsb2NhbGhvc3QwCgYIKoZIzj0EAwIDSQAwRgIhAN7ohtsBLrjlgmSe9ngovxZM -z61n0+/7w2mtX/OrLMWIAiEAu+D2S2o0s7E9pp2Rkug8cT5T4GCWgFgEHk5x2L/E -RVI= ------END CERTIFICATE----- diff --git a/system/services/serverphone/default.nix b/system/services/serverphone/default.nix deleted file mode 100644 index 20125a75..00000000 --- a/system/services/serverphone/default.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ - config, - serverphone, - system, - lib, - ... -}: { - config = lib.mkIf config.soispha.secrets.enable { - services.serverphone = { - package = "${serverphone.packages.${system}.default}"; - enable = true; - domain = "localhost"; - configureDoas = true; - acceptedSshKeys = [ - "AAAAC3NzaC1lZDI1NTE5AAAAIGBFuTNNn71Rhfnop2cdz3r/RhWWlCePnSBOhTBbu2ME" - ]; - authorized = { - acceptedGpgKeys = [ - { - source = ./keys/key_1; - trust = "ultimate"; - } - { - source = ./keys/key_2; - trust = "ultimate"; - } - ]; - }; - caCertificate = "${./certificates/ca.crt}"; - certificate = "${./certificates/server.crt}"; - privateKey = config.age.secrets.serverphoneServer.path; - certificateRequest = { - acceptedUsers = [ - "soispha $argon2id$v=19$m=19456,t=2,p=1$EvhPENIBqL5b1RO5waNMWA$pJ8vDrCNJKDlqwB5bVDLjHVPEXm9McQhtt9OXSD8Zkc" - ]; - caPrivateKey = config.age.secrets.serverphoneCa.path; - }; - }; - - users.users.serverphone = { - group = "serverphone"; - isSystemUser = true; - home = "/run/serverphone"; - }; - users.groups.serverphone = { - members = ["serverphone"]; - }; - }; -} diff --git a/system/services/serverphone/keys/key_1 b/system/services/serverphone/keys/key_1 deleted file mode 120000 index 67720882..00000000 --- a/system/services/serverphone/keys/key_1 +++ /dev/null @@ -1 +0,0 @@ -../../../../home-manager/soispha/config/gpg/keys/key_1 \ No newline at end of file diff --git a/system/services/serverphone/keys/key_2 b/system/services/serverphone/keys/key_2 deleted file mode 120000 index 24df7207..00000000 --- a/system/services/serverphone/keys/key_2 +++ /dev/null @@ -1 +0,0 @@ -../../../../home-manager/soispha/config/gpg/keys/key_2 \ No newline at end of file diff --git a/system/services/snapper/default.nix b/system/services/snapper/default.nix deleted file mode 100644 index 41e4b381..00000000 --- a/system/services/snapper/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{...}: { - services.snapper = { - configs = { - srv = { - SUBVOLUME = "/srv"; - FSTYPE = "btrfs"; - # users and groups allowed to work with config - ALLOW_GROUPS = ["wheel"]; - - # sync users and groups from ALLOW_USERS and ALLOW_GROUPS to .snapshots - # directory - SYNC_ACL = true; - - # run daily number cleanup - NUMBER_CLEANUP = false; - - # limit for number cleanup - NUMBER_MIN_AGE = 1800; - NUMBER_LIMIT = 50; - NUMBER_LIMIT_IMPORTANT = 10; - - # create hourly snapshots - TIMELINE_CREATE = true; - - # cleanup hourly snapshots after some time - TIMELINE_CLEANUP = true; - - # limits for timeline cleanup - TIMELINE_MIN_AGE = 1800; - TIMELINE_LIMIT_HOURLY = 7; - TIMELINE_LIMIT_DAILY = 3; - TIMELINE_LIMIT_WEEKLY = 2; - TIMELINE_LIMIT_MONTHLY = 0; - TIMELINE_LIMIT_YEARLY = 2; - - # cleanup empty pre-post-pairs - EMPTY_PRE_POST_CLEANUP = true; - }; - }; - }; -} diff --git a/system/services/steam/default.nix b/system/services/steam/default.nix deleted file mode 100644 index 54091493..00000000 --- a/system/services/steam/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - lib, - config, - pkgs, - ... -}: let - cfg = config.soispha.services.steam; -in { - options.soispha.services.steam = { - enable = lib.mkOption { - default = false; - description = lib.mdDoc "Steam"; - }; - }; - config = lib.mkIf cfg.enable { - programs.steam = { - enable = true; - }; - environment.systemPackages = [ - pkgs.wineWowPackages.waylandFull - ]; - }; -} diff --git a/system/services/swaylock/default.nix b/system/services/swaylock/default.nix deleted file mode 100644 index 6cbcef28..00000000 --- a/system/services/swaylock/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{...}: { - # otherwise swaylock can't access the user password. - security.pam.services.swaylock = {}; -} diff --git a/system/services/xdg/default.nix b/system/services/xdg/default.nix deleted file mode 100644 index 297928ce..00000000 --- a/system/services/xdg/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs, ...}: { - xdg = { - portal = { - enable = true; - # TODO: only enable the below, when on river (or wlr based compositor) - wlr.enable = true; - extraPortals = [pkgs.xdg-desktop-portal-wlr]; - }; - }; - # TODO: mime = {}; -} diff --git a/system/sound/default.nix b/system/sound/default.nix deleted file mode 100644 index 318dcb8b..00000000 --- a/system/sound/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, ...}: { - # Enable sound with pipewire. - sound.enable = true; - hardware.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; - environment.etc.pipewire-pulse-config = { - target = "pipewire/pipewire-pulse.conf.d/pipewire-pulse-config.conf"; - text = '' - # Extra scripts can be started here. Setup in default.pa can be moved in - # a script or in pulse.cmd below - context.exec = [ - { path = "${pkgs.pulseaudio}/bin/pactl" args = "set-sink-volume 0 13%" } - ] - ''; - }; -} diff --git a/system/tempfiles/default.nix b/system/tempfiles/default.nix deleted file mode 100644 index 2d48b02e..00000000 --- a/system/tempfiles/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{config, ...}: { - systemd.tmpfiles.rules = [ - # this file is needed to trash stuff on the temp fs - "d /.Trash 1777 root root" # TODO: move this to the lf config - ]; -} diff --git a/system/users/default.nix b/system/users/default.nix deleted file mode 100644 index 365ffd41..00000000 --- a/system/users/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - cfg = config.soispha.users; -in { - options.soispha.users = { - # enable = lib.mkEnableOption (lib.mdDoc "users"); - hashedPassword = lib.mkOption { - type = lib.types.str; - example = lib.literalExpression "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; - default = "$y$jFT$ONrCqZIJKB7engmfA4orD/$0GO58/wV5wrYWj0cyONhyujZPjFmbT0XKtx2AvXLG0B"; - description = lib.mdDoc "Hashed password for the user"; - }; - }; - config = { - # I was told, that this solves some nasty problems: - programs.zsh.enable = true; - - users = { - groups = { - plugdev.members = ["soispha"]; - }; - mutableUsers = false; - users.soispha = { - isNormalUser = true; - home = "/home/soispha"; - createHome = true; - shell = pkgs.zsh; - initialHashedPassword = cfg.hashedPassword; - extraGroups = [ - "plugdev" # although deprecated, this helps with old udev rules, that still use this group. TODO: check for an open issue - "wheel" - ]; - uid = 1000; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGBFuTNNn71Rhfnop2cdz3r/RhWWlCePnSBOhTBbu2ME soispha" - ]; - }; - }; - }; -} -- cgit 1.4.1