diff --git a/flake.lock b/flake.lock index bde4188..53b7082 100644 --- a/flake.lock +++ b/flake.lock @@ -311,6 +311,56 @@ "type": "github" } }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": "nmd", + "nmt": "nmt" + }, + "locked": { + "lastModified": 1666720474, + "narHash": "sha256-iWojjDS1D19zpeZXbBdjWb9MiKmVVFQCqtJmtTXgPx8=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "14876cc8fe94a3d329964ecb073b4c988c7b61f5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, + "nix-on-droid": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd_2" + }, + "locked": { + "lastModified": 1688144254, + "narHash": "sha256-8KL1l/7eP2Zm1aJjdVaSOk0W5kTnJo9kcgW03gqWuiI=", + "owner": "nix-community", + "repo": "nix-on-droid", + "rev": "2301e01d48c90b60751005317de7a84a51a87eb6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-23.05", + "repo": "nix-on-droid", + "type": "github" + } + }, "nixgl": { "inputs": { "flake-utils": "flake-utils", @@ -361,6 +411,22 @@ "type": "indirect" } }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1686921029, + "narHash": "sha256-J1bX9plPCFhTSh6E3TWn9XSxggBh/zDD4xigyaIQBy8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ff1b9b95620ce8728c0d7bd501c458e6da9e04", + "type": "github" + } + }, "nixpkgs-stable": { "locked": { "lastModified": 1685801374, @@ -386,17 +452,78 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { + "dirtyRev": "c96d7b46d05a78e695ed1c725d1596b65509b4f9-dirty", + "dirtyShortRev": "c96d7b46-dirty", "lastModified": 1702044539, - "narHash": "sha256-TNmEd6MipLxsrWromxqNfU4y17MoBr15QF7iEOagPy8=", + "narHash": "sha256-YAWtzc+5KDOHDGz/NBB7ysIusXbYYKtsbDOsRhSWKYk=", + "type": "git", + "url": "file:/home/geoffrey/nixvim" + }, + "original": { + "type": "git", + "url": "file:/home/geoffrey/nixvim" + } + }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmd_2": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, + "nur": { + "locked": { + "lastModified": 1705693547, + "narHash": "sha256-/6rVfbj1oaycjvYJeZRqL+ApzNL2FNf6pmfWuk+9Bhs=", "owner": "nix-community", - "repo": "nixvim", - "rev": "c96d7b46d05a78e695ed1c725d1596b65509b4f9", + "repo": "NUR", + "rev": "868aa9b52241ad7c8cb89cdd207f8d0149ebf95b", "type": "github" }, "original": { "owner": "nix-community", - "repo": "nixvim", - "rev": "c96d7b46d05a78e695ed1c725d1596b65509b4f9", + "repo": "NUR", "type": "github" } }, @@ -429,10 +556,12 @@ "inputs": { "disko": "disko", "home-manager": "home-manager", + "nix-on-droid": "nix-on-droid", "nixgl": "nixgl", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nixvim": "nixvim", + "nur": "nur", "stylix": "stylix" } }, diff --git a/flake.nix b/flake.nix index 6d536d9..cf0b4fc 100644 --- a/flake.nix +++ b/flake.nix @@ -25,8 +25,9 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nixvim = { - url = "github:nix-community/nixvim/c96d7b46d05a78e695ed1c725d1596b65509b4f9"; - # 24.05 Anything after this commit works + url = "github:GeoffreyFrogeye/nixvim/frogeye-23.11"; + # 24.05 Ensure merged: https://github.com/nix-community/nixvim/pull/953 + # url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; nixgl = { diff --git a/hm/dev/default.nix b/hm/dev/default.nix index a71e778..9cb97f7 100644 --- a/hm/dev/default.nix +++ b/hm/dev/default.nix @@ -4,6 +4,7 @@ ./common.nix ./go.nix ./node.nix + ./prose.nix ./python.nix ]; } diff --git a/hm/dev/prose.nix b/hm/dev/prose.nix new file mode 100644 index 0000000..5c68cc8 --- /dev/null +++ b/hm/dev/prose.nix @@ -0,0 +1,23 @@ +# Prose is a programming language, fight me +{ pkgs, lib, config, ... }: +{ + config = lib.mkIf config.frogeye.dev.prose { + home = { + packages = with pkgs; [ + hunspell + hunspellDicts.en_GB-ize + hunspellDicts.en_US + hunspellDicts.fr-moderne + hunspellDicts.nl_NL + # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr + ]; + }; + programs.nixvim.plugins.none-ls = { + enable = true; + sources = { + code_actions.ltrs.enable = true; + diagnostics.ltrs.enable = true; + }; + }; + }; +} diff --git a/hm/extra.nix b/hm/extra.nix index 84002cf..6257482 100644 --- a/hm/extra.nix +++ b/hm/extra.nix @@ -34,12 +34,6 @@ # TODO Convert existing LaTeX documents into using Nix build system # texlive is big and not that much used, sooo pdftk - hunspell - hunspellDicts.en_GB-ize - hunspellDicts.en_US - hunspellDicts.fr-moderne - hunspellDicts.nl_NL - # TODO libreoffice-extension-languagetool or libreoffice-extension-grammalecte-fr ] ++ lib.optionals config.frogeye.desktop.xorg [ diff --git a/hm/vim/default.nix b/hm/vim/default.nix index 55a19af..b4d862d 100644 --- a/hm/vim/default.nix +++ b/hm/vim/default.nix @@ -91,8 +91,6 @@ # Language-specific tcomment_vim # Language-aware (un)commenting - ] ++ lib.optionals config.frogeye.extra [ - vim-LanguageTool # Check grammar for human languages ] ++ lib.optionals config.programs.pandoc.enable [ vim-pandoc # Pandoc-specific stuff because there's no LSP for it vim-pandoc-syntax @@ -100,7 +98,6 @@ ansible-vim # Doesn't generate snippets, but those are for UltiSnip anyways ]; - extraConfigLua = builtins.readFile ./symbols-outline-nvim.lua; extraConfigVim = '' " GENERAL @@ -110,11 +107,6 @@ command Reload source $MYVIMRC " PLUGINS - '' + lib.optionalString config.frogeye.extra '' - " languagetool - let g:languagetool_cmd = "${pkgs.languagetool}/bin/languagetool-commandline" - " TODO Doesn't work - '' + lib.optionalString config.programs.pandoc.enable '' " vim-pandox let g:pandoc#modules#disabled = ["folding"] @@ -153,9 +145,6 @@ # PLUGINS - # symbols-outline-nvim - { key = "s"; action = "SymbolsOutline"; options = { silent = true; }; } - # undotree { key = "u"; action = "UndotreeToggle"; options = { silent = true; }; } diff --git a/hm/vim/lsp.nix b/hm/vim/lsp.nix index a1c085f..03df26e 100644 --- a/hm/vim/lsp.nix +++ b/hm/vim/lsp.nix @@ -12,25 +12,6 @@ lsp_signature-nvim # Show argument definition when typing a function ]; keymaps = [ - # barbar - { key = ""; action = "BufferPrevious"; options = { silent = true; }; } - { key = ""; action = "BufferNext"; options = { silent = true; }; } - # TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/ - { key = ""; action = "BufferMovePrevious"; options = { silent = true; }; } - { key = ""; action = "BufferMoveNext"; options = { silent = true; }; } - # TODO gotos don't work - { key = ""; action = "BufferGoto 1"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 2"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 3"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 4"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 5"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 6"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 7"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 8"; options = { silent = true; }; } - { key = ""; action = "BufferGoto 9"; options = { silent = true; }; } - { key = ""; action = "BufferLast"; options = { silent = true; }; } - { key = "gb"; action = "BufferPick"; options = { silent = true; }; } - # TODO Other useful options? ]; plugins = { # Language Server @@ -44,6 +25,7 @@ "]e" = "goto_next"; }; lspBuf = { + # TODO Include the Telescope ones in this file "gD" = "declaration"; "K" = "hover"; "gi" = "implementation"; @@ -55,6 +37,7 @@ # Also makes nvim crash like this, so uncommented "D" = "type_definition"; "rn" = "rename"; + "ca" = "code_action"; "f" = "format"; # TODO Full thing was function() vim.lsp.buf.format { async = true } end, so async while this isn't # Maybe replace this with lsp-format? diff --git a/hm/vim/symbols-outline-nvim.lua b/hm/vim/symbols-outline-nvim.lua deleted file mode 100644 index 4649eb7..0000000 --- a/hm/vim/symbols-outline-nvim.lua +++ /dev/null @@ -1,19 +0,0 @@ -vim.g.symbols_outline = { - highlight_hovered_item = true, - show_guides = true, - auto_preview = true, - position = 'right', - show_numbers = false, - show_relative_numbers = false, - show_symbol_details = true, - keymaps = { - close = "", - goto_location = "", - focus_location = "o", - hover_symbol = "", - rename_symbol = "r", - code_actions = "a", - }, - lsp_blacklist = {}, -} --- TODO Should be hierarchical, doesn't seem to be :/ diff --git a/options.nix b/options.nix index a4ca176..0f9f151 100644 --- a/options.nix +++ b/options.nix @@ -40,6 +40,7 @@ node = lib.mkEnableOption "NodeJS dev stuff"; perl = lib.mkEnableOption "Perl dev stuff"; php = lib.mkEnableOption "PHP dev stuff"; + prose = lib.mkEnableOption "Writing stuff"; python = lib.mkEnableOption "Python dev stuff"; }; }; @@ -47,6 +48,7 @@ config = { frogeye = { dev = { + prose = lib.mkDefault true; python = lib.mkDefault true; }; };