Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use_flake .
174 changes: 168 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
nixvim.url = "github:nix-community/nixvim";
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
};

outputs =
{ flake-parts, ... }@inputs:
let
neovim-overlay = import ./nix/neovim-overlay.nix { inherit inputs; };
in
flake-parts.lib.mkFlake { inherit inputs; } {
# debug = true;

Expand All @@ -18,7 +22,30 @@
];

imports = [
./flake-module.nix
./nixvim.nix
];

perSystem =
{ pkgs, system, ... }:
{
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
neovim-overlay
inputs.gen-luarc.overlays.default
];
};

devShells.default = pkgs.mkShell {
name = "nvim-devShell";
buildInputs = with pkgs; [
lua-language-server
nil
stylua
luajitPackages.luacheck
nvim-dev
];
};
};
};
}
37 changes: 37 additions & 0 deletions nix/neovim-overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ inputs }:
final: prev:
with final.pkgs.lib;
let
pkgs = final;

# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
# otherwise it could have an incompatible signature when applying this overlay.
pkgs-locked = inputs.nixpkgs.legacyPackages.${pkgs.system};

mkNeovim = pkgs.callPackage ./mkNeovim.nix {
inherit (pkgs-locked) neovimUtils wrapNeovimUnstable;
};

plugins = [ ];

extraPackages = with pkgs; [
lua-language-server
nil
];
in
{
# This is the neovim derivation
# returned by the overlay
nvim-pkg = mkNeovim {
inherit extraPackages plugins;
};

# This is meant to be used within a devshell.
# Instead of loading the lua Neovim configuration from
# the Nix store, it is loaded from $XDG_CONFIG_HOME/nvim-dev
nvim-dev = mkNeovim {
inherit extraPackages plugins;
appName = "nvim-dev";
wrapRc = false;
};
}
File renamed without changes.
Loading