{"id":20613186,"url":"https://github.com/konradmalik/neovim-flake","last_synced_at":"2025-04-15T07:11:42.765Z","repository":{"id":172990147,"uuid":"650068136","full_name":"konradmalik/neovim-flake","owner":"konradmalik","description":"standalone neovim flake with my configuration","archived":false,"fork":false,"pushed_at":"2025-04-13T18:35:45.000Z","size":1282,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T07:11:37.236Z","etag":null,"topics":["development","dotfiles","neovim","nix"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/konradmalik.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-06T09:10:23.000Z","updated_at":"2025-04-13T18:35:47.000Z","dependencies_parsed_at":"2023-10-16T11:03:38.142Z","dependency_job_id":"ba215203-a292-4696-b740-710ea0c1af56","html_url":"https://github.com/konradmalik/neovim-flake","commit_stats":null,"previous_names":["konradmalik/neovim-flake"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fneovim-flake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fneovim-flake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fneovim-flake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/konradmalik%2Fneovim-flake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/konradmalik","download_url":"https://codeload.github.com/konradmalik/neovim-flake/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023731,"owners_count":21199960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development","dotfiles","neovim","nix"],"created_at":"2024-11-16T11:09:02.745Z","updated_at":"2025-04-15T07:11:42.759Z","avatar_url":"https://github.com/konradmalik.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Actions Status](https://github.com/konradmalik/neovim-flake/actions/workflows/linux.yml/badge.svg)](https://github.com/konradmalik/neovim-flake/actions)\n[![Actions Status](https://github.com/konradmalik/neovim-flake/actions/workflows/darwin.yml/badge.svg)](https://github.com/konradmalik/neovim-flake/actions)\n\n# Neovim Flake\n\nNeovim in nix.\n\nTry it out:\n\n```bash\n$ nix run github:konradmalik/neovim-flake\n```\n\nRun checks (stylua, luacheck, typecheck via lua-language-server):\n\n```bash\n$ make check-fmt\n$ make check-lint\n```\n\nRun tests (busted using nvim as an interpreter):\n\n```bash\n$ make test\n```\n\n## Assumptions\n\n- keeps all Neovim config in lua as it's supposed to be\n- uses nix for system dependencies, plugins and packaging\n\nThat way nix is a layer on top, just used for packaging and reproducibility. It does not interfere with the standard way\nto configure Neovim.\n\n## Language servers, formatters, linters\n\nThose are managed by nix and appended to the end of PATH for Neovim.\nThis allows Neovim to use them, but also to use other versions by prepending them to PATH.\n\nAn example - you can have some project which uses an older version of `black` which formats files a bit differently.\nAssuming that this project has a devshell defined, you can just enter that devshell and run Neovim.\nThe older `black` from the devshell will take precedence over the one provided by this flake, because devshell works by\nprepending to PATH.\n\n## Things to note\n\n- Uses `NVIM_APPNAME` to differentiate from other Neovim instances. It's set to `neovim-pde` or `neovim-pde-hm` for\n  home-manager (configurable) or `nvim` when running in \"dev mode\".\n\n### Home Manager\n\nThere is a home-manager module provided, which links the configuration to your `XDG_CONFIG_HOME` folder and loads it from there.\n\nThis is the recommended way to use this flake \"day-to-day\" in your NixOS system.\n\n### Self-contained mode\n\nWhen running/using `neovim-pde` from the flake directly it runs in `self-contained` mode.\n\nThis means that it appends its config in nix store to your `$XDG_CONFIG_DIRS` and use `-u` flag to force-load this specific `init.lua`.\nThis means that any `init.lua` in your local `$XDG_CONFIG_HOME/$NVIM_APPNAME` won't be loaded, even if `$NVIM_APPNAME` is `neovim-pde`\n(I think that `after` folders and others that don't need to be required explicitly will be loaded, so those should work if put to the proper `$NVIM_APPNAME` folder, but I've never tested this).\n\nThat also means that `exrc` functionality won't work (e.g. local `.nvim.lua` files won't be loaded automatically).\nIf you rely on that feature (I sometimes do) then consider using the provided home-manager module.\n\n## Experimentation\n\nOne of the cons of using Neovim in nix is - no \"dirty\" modifications to Neovim to try something out quickly. Experimentation becomes harder.\nYou always need to rebuild it, but `nix build` and then `./result/bin/nvim` is quick and easy enough for it to not be a deal-breaker.\n\nAnother solution implemented in this repo is `nvim-dev` command that becomes available inside devShell here.\nIt runs the neovim package defined in the repo with plugins and `nix`-generated lua files provided, but the native lua\nconfig gets read \"live\" from `./config/nvim` here in the repo. This allows for instant feedback and dynamic\ndevelopment just like when using neovim without nix.\n\n## Notes\n\n\u003e composed of my reddit posts\n\nWhat's great in using Neovim through nix is a way to generate lua files from nix. It allows configuring LSP to use binaries directly from nix store as opposed to getting them from PATH, especially useful for the most common LSPs that I always expect to have.\n\nWhat I don't like in those \"nixvim\" flakes is that people most often use only nix for everything. While most certainly you can generate all of your config, all of your lua files from nix, I think it's a bad idea since you lose all completion, diagnostics, and all neodev niceness for lua.\n\n## Credits\n\nInspired by:\n\n- https://primamateria.github.io/blog/neovim-nix/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonradmalik%2Fneovim-flake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkonradmalik%2Fneovim-flake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkonradmalik%2Fneovim-flake/lists"}