nyoom-engineering / nyoom.nvim

A Neovim framework and doom emacs alternative for the stubborn martian hacker. Powered by fennel and the oxocarbon theme
MIT License
1.39k stars 82 forks source link

Install via NixOS home-manager #79

Closed mabequinho closed 1 year ago

mabequinho commented 1 year ago

I would like to suggest an know what do you think about my installation approach.

{ config, pkgs, lib, ... }:

{
  home.packages = (with pkgs ;[
    gcc
    cargo
    nerdfonts
]); 
  programs.neovim = {
    enable = true;
    viAlias = true;
    vimAlias = true;
    vimdiffAlias = true;
    withPython3 = true;
    extraPackages = (with pkgs ;[ tree-sitter nodejs ripgrep fd unzip ]);
  };

  home.file = {
    "nyoom.nvim" = {
      source = pkgs.fetchFromGitHub {
        owner = "shaunsingh";
        repo = "nyoom.nvim";
        rev = "ec3faaacb52207e99c54a66e04f5425adb772faa";
        sha256 = "0r3xwrjw07f8n35fb3s9w4kkavsciqwsw408bfi7vdfyax5fxc5x";
      };
    target = ".config/nvim";
    recursive = true;
    };
  };
}

gitsigns: require("gitsigns.health").check()
========================================================================
  - OK: git version 2.38.1

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - WARNING: **Go**: not available
  - OK: **cargo**: `cargo 1.64.0`
  - WARNING: **luarocks**: not available
  - OK: **Ruby**: `ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]`
  - OK: **RubyGem**: `3.3.20`
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **npm**: `8.19.2`
  - OK: **node**: `v18.12.1`
  - WARNING: **python3**: not available
  - WARNING: **pip3**: not available
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - ERROR: **wget**: not available
  - OK: **curl**: `curl 7.86.0 (x86_64-pc-linux-gnu) libcurl/7.86.0 OpenSSL/3.0.7 zlib/1.2.13 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libssh2/1.10.0 nghttp2/1.49.0`
  - OK: **gzip**: `gzip 1.12`
  - OK: **tar**: `tar (GNU tar) 1.34`
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: **python3_host_prog**: `Python 3.10.8`
  - WARNING: **python3_host_prog pip**: not available
  - OK: GitHub API rate limit. Used: 2. Remaining: 58. Limit: 60. Reset: qua 16 nov 2022 10:01:42.

nvim: health#nvim#check
========================================================================
## Configuration
  - OK: no issues found

## Performance
  - OK: Build type: Release

## Remote Plugins
  - OK: Up to date

## terminal
  - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  - INFO: $COLORTERM='truecolor'

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - OK: `tree-sitter` found 0.20.7 (parser generator, only needed for :TSInstallFromGrammar)
  - OK: `node` found v18.12.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: gcc (GCC) 11.3.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## Parser/Features H L F I J
  - help           ✓ . . . .
  - latex          ✓ . ✓ . ✓
  - nix            ✓ ✓ ✓ . ✓
  - lua            ✓ ✓ ✓ ✓ ✓
  - markdown       ✓ . ✓ . ✓
  - java           ✓ ✓ . ✓ ✓
  - c              ✓ ✓ ✓ ✓ ✓
  - fish           ✓ ✓ ✓ ✓ ✓
  - cpp            ✓ ✓ ✓ ✓ ✓
  - python         ✓ ✓ ✓ ✓ ✓
  - markdown_inline✓ . . . ✓
  - fennel         ✓ ✓ . . ✓
  - bash           ✓ ✓ ✓ . ✓
  - rust           ✓ ✓ ✓ ✓ ✓
  - comment        ✓ . . . .
  - toml           ✓ ✓ ✓ ✓ ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: wl-copy

## Python 3 provider (optional)
  - INFO: Disabled (g:loaded_python3_provider=0).

## Python virtualenv
  - OK: no $VIRTUAL_ENV

## Ruby provider (optional)
  - INFO: Disabled (g:loaded_ruby_provider=0).

## Node.js provider (optional)
  - INFO: Disabled (g:loaded_node_provider=0).

## Perl provider (optional)
  - INFO: Disabled (g:loaded_perl_provider=0).

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/lucio/.local/state/nvim/lsp.log
  - INFO: Log size: 2 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for bash: ABI version 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for comment: ABI version 13
  - OK: Loaded parser for cpp: ABI version 14
  - OK: Loaded parser for fennel: ABI version 13
  - OK: Loaded parser for fish: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for java: ABI version 13
  - OK: Loaded parser for latex: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for markdown: ABI version 13
  - OK: Loaded parser for markdown_inline: ABI version 13
  - OK: Loaded parser for nix: ABI version 13
  - OK: Loaded parser for python: ABI version 14
  - OK: Loaded parser for rust: ABI version 14
  - OK: Loaded parser for toml: ABI version 13
shaunsingh commented 1 year ago

Looks good, I think it'll be a good addition for the flake.nix. I'll be incorporating a lock file using packer.nvim, so in the future maybe I could have nix parse that file and install plugins through nix as well. Just some random thoughts

mabequinho commented 1 year ago

https://gist.github.com/archite/a42683880e99560e0a573a1876b8e965#file-astronvim-nix

This guy made a astroNvim home-manager module, it works flawlessly if adapted to nyoom. the only problem is to add a way to override nyoom files for custom configuration. That sould not be a problem, i know barely nothing about nix language but i know it can be done.

Also, sumneko lua server(i'm running the nixpkgs version for now) doesn't work if installed via Mason, i think the problem is because he tries to call the language server executable using a bash script inside mason /bin, the bash script would need to be called using steam-run command to get a FHS environment.

Vanderscycle commented 1 year ago

@mabequinho Sorry to piggy back on this old issue. I used the exact nix configuration you posted to get started on nyoom. My question is Nix related but how can I clone the repo from Github then move my various config files like config.fnl, packages.fnl, etc.

In this current configuration, my config files overide everything.

  # nix-prefect-git <repo>
  home = {
    file = {
      "nyoom.nvim" = {
        source = pkgs.fetchFromGitHub {
          owner = "shaunsingh";
          repo = "nyoom.nvim";
          rev = "947afef56a58e3d926e424d2c3d37194d357a40e";
          sha256 = "1bqc7w5vvr38xjab80mfn69l6cdqr4b4ill2qpi8hysjpgh26nbg";
        };
        target = ".config/nvim";
        recursive = true;
      };
      # config files
      ".config/nvim/fnl/packages.fnl".source = "${dotfiles_dir}/.config/nyoom/packages.fnl";
      ".config/nvim/fnl/macros.fnl".source = "${dotfiles_dir}/.config/nyoom/macros.fnl";
      ".config/nvim/fnl/config.fnl".source = "${dotfiles_dir}/.config/nyoom/config.fnl";
      ".config/nvim/fnl/modules.fnl".source = "${dotfiles_dir}/.config/nyoom/modules.fnl";
    };
  };

Thanks for any help