Compare commits

...

2 commits

Author SHA1 Message Date
0231317ae1
fix(lang/python): Don't include pylsp-mypy as it can't see dev shell libs
Some checks failed
Perform checks / formatting (push) Failing after 9m37s
Perform checks / nix_flake_check (push) Failing after 9m37s
Perform checks / nix_build (push) Failing after 9m40s
2025-06-12 23:52:38 +02:00
e849070a3a
refactor(flake): Get rid of flake-utils to simplify things 2025-06-12 23:51:34 +02:00
3 changed files with 65 additions and 100 deletions

40
flake.lock generated
View file

@ -34,24 +34,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gen-luarc": { "gen-luarc": {
"inputs": { "inputs": {
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
@ -181,11 +163,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1748460289, "lastModified": 1749285348,
"narHash": "sha256-7doLyJBzCllvqX4gszYtmZUToxKvMUrg45EUWaUYmBg=", "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "96ec055edbe5ee227f28cdbc3f1ddf1df5965102", "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -213,28 +195,12 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"gen-luarc": "gen-luarc", "gen-luarc": "gen-luarc",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"presence-nvim": "presence-nvim", "presence-nvim": "presence-nvim",
"workspace-diagnostics-nvim": "workspace-diagnostics-nvim" "workspace-diagnostics-nvim": "workspace-diagnostics-nvim"
} }
}, },
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"workspace-diagnostics-nvim": { "workspace-diagnostics-nvim": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -3,7 +3,6 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json"; gen-luarc.url = "github:mrcjkb/nix-gen-luarc-json";
# Add bleeding-edge plugins here. # Add bleeding-edge plugins here.
@ -25,7 +24,6 @@
outputs = inputs @ { outputs = inputs @ {
self, self,
nixpkgs, nixpkgs,
flake-utils,
gen-luarc, gen-luarc,
... ...
}: let }: let
@ -36,26 +34,42 @@
"aarch64-darwin" "aarch64-darwin"
]; ];
# This is where the Neovim derivation is built.
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
inherit (self) outputs;
# This is a function that generates an attribute by calling a function you # This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument # pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs supportedSystems; forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
in in
flake-utils.lib.eachSystem supportedSystems (system: let {
formatter = forAllSystems(system: nixpkgs.legacyPackages.${system}.alejandra);
overlays = {
neovim-overlay = import ./nix/neovim-overlay.nix {inherit inputs;};
# You can add this overlay to your NixOS configuration
default = self.outputs.overlays.neovim-overlay;
};
packages = forAllSystems (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.outputs.overlays.neovim-overlay ];
};
in {
nvim-pkg = pkgs.nvim-pkg;
default = self.outputs.packages.${system}.nvim-pkg;
}
);
devShells = forAllSystems (system:
let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [
# Import the overlay, so that the final Neovim derivation(s) can be accessed via pkgs.<nvim-pkg> self.outputs.overlays.neovim-overlay
neovim-overlay
# This adds a function can be used to generate a .luarc.json
# containing the Neovim API all plugins in the workspace directory.
# The generated file can be symlinked in the devShell's shellHook.
gen-luarc.overlays.default gen-luarc.overlays.default
]; ];
}; };
shell = pkgs.mkShell { in {
default = pkgs.mkShell {
name = "nvim-devShell"; name = "nvim-devShell";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
# Tools for Lua and Nix development, useful for editing files in this repo # Tools for Lua and Nix development, useful for editing files in this repo
@ -69,18 +83,10 @@
ln -fs ${pkgs.nvim-luarc-json} .luarc.json ln -fs ${pkgs.nvim-luarc-json} .luarc.json
''; '';
}; };
in { }
formatter = nixpkgs.legacyPackages.${system}.alejandra; );
packages = rec {
default = nvim; # templates = {
nvim = pkgs.nvim-pkg; # };
};
devShells = {
default = shell;
};
})
// {
# You can add this overlay to your NixOS configuration
overlays.default = neovim-overlay;
}; };
} }

View file

@ -120,8 +120,7 @@ with final.pkgs.lib; let
# ^ bleeding-edge plugins from flake inputs # ^ bleeding-edge plugins from flake inputs
]; ];
extraPackages = with pkgs; extraPackages = with pkgs; [
[
# Dependencies # Dependencies
ripgrep ripgrep
@ -132,14 +131,8 @@ with final.pkgs.lib; let
nil # nix LSP nil # nix LSP
nodePackages.bash-language-server # Bash language server nodePackages.bash-language-server # Bash language server
lua-language-server lua-language-server
] (pkgs.python312.withPackages (python-pkgs: [ python-pkgs.python-lsp-server python-pkgs.python-lsp-ruff python-pkgs.pylsp-rope]))
++ [ jsonnet-language-server
(pkgs.python312.withPackages (python-pkgs: [
python-pkgs.python-lsp-server
python-pkgs.python-lsp-ruff
python-pkgs.pylsp-mypy
python-pkgs.pylsp-rope
]))
]; ];
in { in {
# This is the neovim derivation # This is the neovim derivation