From 947cf90878155f2b37f458188d28f9af9a4eb906 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 | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 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..7b64528 --- /dev/null +++ b/flake/develop.nix @@ -0,0 +1,30 @@ +{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 = {}; + + customNeovim = lib.nvim.neovimConfiguration { + inherit pkgs; + modules = [configuration]; + }; + in + customNeovim.neovim; + }; +}