diff --git a/src/home/email/neomutt/default.nix b/src/home/email/neomutt/default.nix index c5519fa..cc424b8 100644 --- a/src/home/email/neomutt/default.nix +++ b/src/home/email/neomutt/default.nix @@ -23,6 +23,8 @@ in extraConfig = '' set abort_key = "" + set editor = "nvim" + set edit_headers = yes set sidebar_visible set sidebar_format = "%D%?F? [%F]?%* %?N?%N/?%S" diff --git a/src/home/gui/default.nix b/src/home/gui/default.nix index 5d0b568..829aeff 100644 --- a/src/home/gui/default.nix +++ b/src/home/gui/default.nix @@ -10,17 +10,20 @@ ./discord.nix ./firefox.nix ./foot.nix + ./gnome.nix ./kde.nix ./keyd.nix ./kitty.nix - ./gnome.nix + # ./mypaint.nix ./i3status-rust.nix ./slack.nix ./skype.nix ./spotify.nix ./teams.nix ./vscode.nix + ./vlc.nix ./wezterm.nix + ./xournalpp.nix ./zathura.nix ./zoom.nix ]; diff --git a/src/home/gui/mypaint.nix b/src/home/gui/mypaint.nix new file mode 100644 index 0000000..a6addb4 --- /dev/null +++ b/src/home/gui/mypaint.nix @@ -0,0 +1,18 @@ +{ + pkgs, + ... +}: +let + mypaint-custom = pkgs.mypaint.overrideAttrs ( + final: prev: { + checkPhase = ''''; + } + ); +in +{ + home.packages = with pkgs; [ + mypaint-custom + mypaint-brushes + mypaint-brushes1 + ]; +} diff --git a/src/home/gui/vlc.nix b/src/home/gui/vlc.nix new file mode 100644 index 0000000..b31f866 --- /dev/null +++ b/src/home/gui/vlc.nix @@ -0,0 +1,11 @@ +{ + pkgs, + config, + ... +}: + +{ + home.packages = with pkgs; [ + vlc + ]; +} diff --git a/src/home/gui/xournalpp.nix b/src/home/gui/xournalpp.nix new file mode 100644 index 0000000..14c80c2 --- /dev/null +++ b/src/home/gui/xournalpp.nix @@ -0,0 +1,10 @@ +{ + pkgs, + ... +}: + +{ + home.packages = with pkgs; [ + xournalpp + ]; +} diff --git a/src/home/gui/zoom.nix b/src/home/gui/zoom.nix index d79e4dd..76267ee 100644 --- a/src/home/gui/zoom.nix +++ b/src/home/gui/zoom.nix @@ -4,22 +4,22 @@ ... }: let - zoom = pkgs.zoom-us.overrideAttrs (attrs: { - nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.bbe ]; - postFixup = - '' - cp $out/opt/zoom/zoom . - bbe -e 's/\0manjaro\0/\0nixos\0\0\0/' < zoom > $out/opt/zoom/zoom - '' - + (attrs.postFixup or "") - + '' - sed -i 's|Exec=|Exec=env XDG_CURRENT_DESKTOP="gnome" |' $out/share/applications/Zoom.desktop - ''; - }); in +# zoom = pkgs.zoom-us.overrideAttrs (attrs: { +# nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [ pkgs.bbe ]; +# postFixup = +# '' +# cp $out/opt/zoom/zoom . +# bbe -e 's/\0manjaro\0/\0nixos\0\0\0/' < zoom > $out/opt/zoom/zoom +# '' +# + (attrs.postFixup or "") +# + '' +# sed -i 's|Exec=|Exec=env XDG_CURRENT_DESKTOP="gnome" |' $out/share/applications/Zoom.desktop +# ''; +# }); { home.packages = with pkgs; [ - zoom + zoom-us ]; custom.persist = { diff --git a/src/home/shell/neovim/config/init.lua b/src/home/shell/neovim/config/init.lua index 06757c4..ecce23d 100644 --- a/src/home/shell/neovim/config/init.lua +++ b/src/home/shell/neovim/config/init.lua @@ -215,14 +215,14 @@ require("lazy").setup({ local builtin = require("telescope.builtin") vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) - vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) + -- vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) - vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) + -- vim.keymap.set("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) + -- vim.keymap.set("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set("n", "/", function() @@ -250,15 +250,14 @@ require("lazy").setup({ keys = { "sh", "sk", - "sf", - "sf", + -- "sf", "ss", "sw", - "sg", + -- "sg", "sd", "sr", "s.", - "", + -- "", "/", "s/", "sn", @@ -544,7 +543,14 @@ require("lazy").setup({ -- No, but seriously. Please read `:help ins-completion`, it is really good! mapping = cmp.mapping.preset.insert({ -- Select the [n]ext item - [""] = cmp.mapping.select_next_item(), + -- [""] = cmp.mapping.select_next_item(), + [""] = function() + if cmp.visible() then + cmp.select_next_item() + else + cmp.complete() + end + end, -- Select the [p]revious item [""] = cmp.mapping.select_prev_item(), @@ -727,13 +733,31 @@ require("lazy").setup({ "fm", function() local MiniFiles = require("mini.files") - MiniFiles.open(nil) + MiniFiles.open() end, desc = "[F]ile [M]anager", }, }, }, + { + "echasnovski/mini.pick", + -- cmd = { "Pick" }, + version = false, + config = true, + -- stylua: ignore start + keys = { + { "sf", "Pick files", desc = "[S]earch [F]iles" }, + { "sg", "Pick grep_live", desc = "[S]earch by [G]rep" }, + { "", "Pick buffers", desc = "[ ] Find existing buffers" } + }, + -- stylua: ignore end + }, + + { "echasnovski/mini.extra", event = "LazyFile", version = false, config = true }, + + { "echasnovski/mini.starter", event = "LazyFile", version = false, config = true }, + { -- Highlight, edit, and navigate code "nvim-treesitter/nvim-treesitter", event = "LazyFile", @@ -926,10 +950,14 @@ require("lazy").setup({ -- stylua: ignore start -- Add or skip cursor above/below the main cursor. - set({ "n", "v" }, "", function() mc.lineAddCursor(-1) end) - set({ "n", "v" }, "", function() mc.lineAddCursor(1) end) - set({ "n", "v" }, "", function() mc.lineSkipCursor(-1) end) - set({ "n", "v" }, "", function() mc.lineSkipCursor(1) end) + set({ "n", "v" }, "", function() mc.lineAddCursor(-1) end) + set({ "n", "v" }, "", function() mc.lineAddCursor(1) end) + set({ "n", "v" }, "", function() mc.lineSkipCursor(-1) end) + -- set({ "n", "v" }, "", function() mc.lineSkipCursor(-1) end) + -- set({ "n", "v" }, "", function() mc.lineSkipCursor(-1) end) + -- set({ "n", "v" }, "", function() mc.lineSkipCursor(1) end) + set({ "n", "v" }, "", function() mc.lineSkipCursor(1) end) + -- set({ "n", "v" }, "", function() mc.lineSkipCursor(1) end) -- Add or skip adding a new cursor by matching word/selection set({ "n", "v" }, "mn", function() mc.matchAddCursor(1) end) @@ -991,117 +1019,48 @@ require("lazy").setup({ }, { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = {}, - config = function(_, opts) - local harpoon = require("harpoon") - harpoon:setup(opts) - end, - keys = { - { - "ha", - function() - local harpoon = require("harpoon") - harpoon:list():add() - end, - desc = "[H]arpoon [A]dd", - }, - { - "he", - function() - local harpoon = require("harpoon") - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, - desc = "[H]arpoon [E]dit", - }, - { - "hl", - function() - local harpoon = require("harpoon") - local conf = require("telescope.config").values - local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end - - require("telescope.pickers") - .new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }) - :find() - end - toggle_telescope(harpoon:list()) - end, - desc = "[H]arpoon [L]list", - }, - { - "h1", - function() - local harpoon = require("harpoon") - harpoon:list():select(1) - end, - desc = "[H]arpoon [1]st entry", - }, - { - "h2", - function() - local harpoon = require("harpoon") - harpoon:list():select(2) - end, - desc = "[H]arpoon [2]nd entry", - }, - { - "h3", - function() - local harpoon = require("harpoon") - harpoon:list():select(3) - end, - desc = "[H]arpoon [3]rd entry", - }, - { - "h4", - function() - local harpoon = require("harpoon") - harpoon:list():select(4) - end, - desc = "[H]arpoon [4]th entry", - }, - { - "h5", - function() - local harpoon = require("harpoon") - harpoon:list():select(5) - end, - desc = "[H]arpoon [5]th entry", - }, + "otavioschwanck/arrow.nvim", + keys = { ";" }, + dependencies = { + { "echasnovski/mini.icons" }, }, + opts = { + show_icons = true, + leader_key = ";", -- Recommended to be a single key + buffer_leader_key = "m", -- Per Buffer Mappings + }, + config = function(_, opts) + local arrow = require("arrow") + arrow.setup(opts) + local statusline = require("arrow.statusline") + statusline.text_for_statusline_with_icons() + end, }, { "NeogitOrg/neogit", dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration + "nvim-lua/plenary.nvim", -- required + "sindrets/diffview.nvim", -- optional - Diff integration -- Only one of these is needed. "nvim-telescope/telescope.nvim", -- optional -- "ibhagwan/fzf-lua", -- optional -- "echasnovski/mini.pick", -- optional }, + opts = { + telescope = false, + fzf_lua = false, + diffview = true, + mini_pick = true, + }, config = true, - keys = {{ "gg", "Neogit", desc = "Neogit" }}, + keys = { { "gg", "Neogit", desc = "Neogit" } }, }, { "sindrets/diffview.nvim", + config = true, keys = { { "gd", "DiffviewOpen", desc = "[G]it [D]iff" }, }, diff --git a/src/home/shell/neovim/config/lazy-lock.json b/src/home/shell/neovim/config/lazy-lock.json index 69ad200..5d76359 100644 --- a/src/home/shell/neovim/config/lazy-lock.json +++ b/src/home/shell/neovim/config/lazy-lock.json @@ -1,9 +1,10 @@ { "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, + "arrow.nvim": { "branch": "master", "commit": "5438c977e729a29d96bd54c8da3103154e80dbd1" }, "cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "62d5accad8b29d6ba9b58d3dff90c43a55621c60" }, + "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, @@ -11,24 +12,26 @@ "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gruvbox-material": { "branch": "master", "commit": "170148af9350f578f3623f810e54698fa1e5bdbf" }, - "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, - "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, + "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" }, + "mini.extra": { "branch": "main", "commit": "098a9dc55b2bdf05a7d6ed018884e0faf94edcbb" }, "mini.files": { "branch": "main", "commit": "6abe854f1410fc6aec69897a78b1db994c32d9c6" }, "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, + "mini.pick": { "branch": "main", "commit": "141496412ccd8a6d01bdafc126ea307687600cad" }, + "mini.starter": { "branch": "main", "commit": "3e0af795938ee800846708bed92fbe4e8583141a" }, "mini.statusline": { "branch": "main", "commit": "813854243156472c9d0bc9c64ea0af159b9b37ca" }, "mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" }, "multicursor.nvim": { "branch": "1.0", "commit": "b715cc5bf69cf6e338899510eb2b60b1dd7ccce0" }, - "neogit": { "branch": "master", "commit": "efd2a182024e422a4c4061683b9264c782eb684a" }, - "nvim-cmp": { "branch": "main", "commit": "be7bd4c5f860c79da97af3a26d489af50babfd4b" }, - "nvim-lspconfig": { "branch": "master", "commit": "ac936a66fba9a58613bed95d7615cff2c5bf0387" }, - "nvim-treesitter": { "branch": "master", "commit": "efb2e9c607cab1e4f7171493b7c6f63bd39073fc" }, - "oil.nvim": { "branch": "master", "commit": "99ce32f4a2ecf76263b72fcc31efb163faa1a941" }, + "neogit": { "branch": "master", "commit": "26c5550016b20e4f47b376192f12a54be8897aaa" }, + "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, + "nvim-lspconfig": { "branch": "master", "commit": "27008519562f16453813c19dcc6ee97f505e0b1c" }, + "nvim-treesitter": { "branch": "master", "commit": "d14bc4bd15a7b9b5a9e7977c6a28f2cab6c4ad4a" }, + "oil.nvim": { "branch": "master", "commit": "3c2de37accead0240fbe812f5ccdedfe0b973557" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "snacks.nvim": { "branch": "main", "commit": "7564a30cad803c01f8ecc15683a280d2f0e9bdb7" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, diff --git a/src/home/shell/neovim/default.nix b/src/home/shell/neovim/default.nix index 9c16c02..c1471a5 100644 --- a/src/home/shell/neovim/default.nix +++ b/src/home/shell/neovim/default.nix @@ -30,8 +30,12 @@ in custom.persist = { home.directories = [ # ".config/nvim" + ".config/github-copilot" ".local/share/nvim" ".local/state/nvim" ]; + home.cache.directories = [ + ".cache/nvim" + ]; }; } diff --git a/src/hosts/pickwick/default.nix b/src/hosts/pickwick/default.nix index ae6ed76..f030dee 100644 --- a/src/hosts/pickwick/default.nix +++ b/src/hosts/pickwick/default.nix @@ -45,6 +45,7 @@ touchpad.enable = true; fingerprint.enable = true; bluetooth.enable = true; + tablet.enable = true; wm = { i3.enable = true; sway.enable = false; diff --git a/src/nixos/default.nix b/src/nixos/default.nix index 300bfe0..708b52f 100644 --- a/src/nixos/default.nix +++ b/src/nixos/default.nix @@ -21,6 +21,7 @@ ./stylix.nix ./touchpad.nix ./sops.nix + ./tablet.nix ./users.nix ./xdg-portal.nix ./wm diff --git a/src/nixos/tablet.nix b/src/nixos/tablet.nix new file mode 100644 index 0000000..586593d --- /dev/null +++ b/src/nixos/tablet.nix @@ -0,0 +1,23 @@ +{ + pkgs, + config, + lib, + ... +}: + +{ + options.custom = with lib; { + tablet.enable = mkEnableOption "tablet" // { + default = true; + }; + }; + + config = lib.mkIf config.custom.tablet.enable { + hardware.opentabletdriver = { + enable = true; + }; + environment.systemPackages = with pkgs; [ + libsForQt5.xp-pen-deco-01-v2-driver + ]; + }; +} diff --git a/stowify.sh b/stowify.sh new file mode 100755 index 0000000..e5a9740 --- /dev/null +++ b/stowify.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +set -e + +SCRIPT_DIR="$( cd "$( dirname "$BASH_SOURCE[0]" )" && pwd )" + +symlink_file() { + filename="$SCRIPT_DIR/$1" + destination="$HOME/$2/$1" + + mkdir -p $(dirname "$destination") + + if [ -L "$destination" ]; then + echo "[WARNING] $filename already symlinked" + return + fi + + if [ -e "$destination" ]; then + echo "[ERROR] $destination exists but it's not a symlink. Please fix that manually" + exit 1 + fi + + ln -s "$filename" "$destination" + echo "[OK] $filename -> $destination" +} + +deploy_manifest() { + for row in $(cat $SCRIPT_DIR/$1); do + if [[ "$row" =~ ^#.* ]]; then + continue + fi + + filename=$(echo $row | cut -d \| -f 1) + operation=$(echo $row | cut -d \| -f 2) + destination=$(echo $row | cut -d \| -f 3) + + case $operation in + symlink) + symlink_file $filename $destination + ;; + + *) + echo "[WARNING] Unknown operation $operation. Skipping..." + ;; + esac + done +} + +if [ -z "$@" ]; then + echo "Usage: $0 " + echo "ERROR: no MANIFEST file is provided" + exit 1 +fi + +deployManifest $1