Skip to content

Commit

Permalink
refactor: 'native' -> 'nvim'
Browse files Browse the repository at this point in the history
  • Loading branch information
konradmalik committed Dec 24, 2024
1 parent 81875f0 commit 21753b0
Show file tree
Hide file tree
Showing 113 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.PHONY: luacheck
luacheck:
@luacheck --codes --no-cache ./config/native
@luacheck --codes --no-cache ./config/nvim

.PHONY: typecheck
typecheck:
@nvim-typecheck ./config/native
@nvim-typecheck ./config/nvim

.PHONY: fmt
fmt:
Expand Down
8 changes: 4 additions & 4 deletions config/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
onlyNix ? false,
}:
let
native = stdenvNoCC.mkDerivation {
name = "neovim-pde-native-config";
src = ./native;
nvim = stdenvNoCC.mkDerivation {
name = "neovim-pde-nvim-config";
src = ./nvim;
dontBuild = true;
installPhase = ''
cp -r $src $out
Expand All @@ -23,5 +23,5 @@ let
in
symlinkJoin {
name = "neovim-pde-config";
paths = nix ++ lib.optionals (!onlyNix) [ native ];
paths = nix ++ lib.optionals (!onlyNix) [ nvim ];
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions flake/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
path = fs.toSource {
root = ./..;
fileset = fs.unions [
./../config/native
./../config/nvim
./../.luacheckrc
];
};
Expand All @@ -30,10 +30,10 @@
in
{
luacheck = makeCheckJob "luacheck" ''
${pkgs.lua.pkgs.luacheck}/bin/luacheck --codes --no-cache ./config/native
${pkgs.lua.pkgs.luacheck}/bin/luacheck --codes --no-cache ./config/nvim
'';
typecheck = makeCheckJob "typecheck" ''
${self'.packages.nvim-typecheck}/bin/nvim-typecheck ./config/native
${self'.packages.nvim-typecheck}/bin/nvim-typecheck ./config/nvim
'';
};
};
Expand Down
2 changes: 1 addition & 1 deletion flake/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
+
# bash
''
ln -fs ${self'.packages.full-luarc-json} ./config/native/.luarc.json
ln -fs ${self'.packages.full-luarc-json} ./config/nvim/.luarc.json
ln -fs ${self'.packages.no-plugins-luarc-json} ./.luarc.json
'';
packages =
Expand Down
13 changes: 6 additions & 7 deletions flake/packages/neovim-pde-dev.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@
let
devConfig = config.override { onlyNix = true; };
pkg = neovim-pde.override {
# this is a hack to load everything in 'native' folder
appName = "native";
appName = "nvim";
selfContained = false;
devMode = true;
config = devConfig;
};
in
(writeShellScriptBin "nvim-dev" ''
if [[ ! $NVIM_PDE_DEV_NATIVE_CONFIG_PATH ]]; then
echo "must set NVIM_PDE_DEV_NATIVE_CONFIG_PATH"
if [[ ! $NVIM_PDE_DEV_CONFIG_PATH ]]; then
echo "must set NVIM_PDE_DEV_CONFIG_PATH"
exit 1
fi
XDG_CONFIG_DIRS="${devConfig}:$NVIM_PDE_DEV_NATIVE_CONFIG_PATH" \
${lib.getExe pkg} -u $NVIM_PDE_DEV_NATIVE_CONFIG_PATH/native/init.lua "$@"
XDG_CONFIG_DIRS="${devConfig}:$NVIM_PDE_DEV_CONFIG_PATH" \
${lib.getExe pkg} -u $NVIM_PDE_DEV_CONFIG_PATH/nvim/init.lua "$@"
'').overrideAttrs
{
shellHook = ''
export NVIM_PDE_DEV_NATIVE_CONFIG_PATH="$PWD/config"
export NVIM_PDE_DEV_CONFIG_PATH="$PWD/config"
'';
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ to configure Neovim.
## Things to note

- Uses `NVIM_APPNAME` to differentiate from other Neovim instances. It's set to `neovim-pde` or `neovim-pde-hm` for
home-manager or `native` when running in "dev mode" (configurable).
home-manager (configurable) or `nvim` when running in "dev mode".

### Home Manager

Expand All @@ -48,7 +48,7 @@ You always need to rebuild it, but `nix build` and then `./result/bin/nvim` is q

Another solution implemented in this repo is `nvim-dev` command that becomes available inside devShell here.
It runs the neovim package defined in the repo with plugins and `nix`-generated lua files provided, but the native lua
config gets read "live" from `./config/native` here in the repo. This allows for instant feedback and dynamic
config gets read "live" from `./config/nvim` here in the repo. This allows for instant feedback and dynamic
development just like when using neovim without nix.

## Notes
Expand Down

0 comments on commit 21753b0

Please sign in to comment.