From 3142a1bf688915106bed3dbd73d309a6c45b6a1c Mon Sep 17 00:00:00 2001 From: diniamo Date: Tue, 12 Nov 2024 22:34:13 +0100 Subject: [PATCH] flake: provide dev package --- flake.nix | 16 ++-------------- flake/develop.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 14 deletions(-) create mode 100644 flake/develop.nix diff --git a/flake.nix b/flake.nix index 875fa43..4e417e7 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ ./flake/legacyPackages.nix ./flake/overlays.nix ./flake/packages.nix + ./flake/develop.nix ]; flake = { @@ -56,20 +57,7 @@ }; }; - perSystem = { - self', - config, - pkgs, - ... - }: { - devShells = { - default = self'.devShells.lsp; - nvim-nix = pkgs.mkShell {packages = [config.packages.nix];}; - lsp = pkgs.mkShell { - packages = with pkgs; [nil statix deadnix alejandra]; - }; - }; - + perSystem = {pkgs, ...}: { # Provide the default formatter. `nix fmt` in project root # will format available files with the correct formatter. # P.S: Please do not format with nixfmt! It messes with many diff --git a/flake/develop.nix b/flake/develop.nix new file mode 100644 index 0000000..3d9d31b --- /dev/null +++ b/flake/develop.nix @@ -0,0 +1,29 @@ +{lib, ...}: { + perSystem = { + pkgs, + config, + self', + ... + }: { + devShells = { + default = self'.devShells.lsp; + nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];}; + lsp = pkgs.mkShellNoCC { + packages = with pkgs; [nil statix deadnix alejandra]; + }; + }; + + # This package exists to make development easier by providing the place and + # boilerplate to build a test nvf configuration. Feel free to use this for + # testing, but make sure to discard the changes before creating a pull + # request. + packages.dev = let + configuration = {}; + in + (lib.nvim.neovimConfiguration { + inherit pkgs; + modules = [configuration]; + }) + .neovim; + }; +}