From f206162e212e52f6f12e8ea51f87edda4dd77a5f Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Sun, 5 Jun 2022 14:23:59 -0600 Subject: Try to fix for legacy and new nix --- flake.nix | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/flake.nix b/flake.nix index 0d45aa0..af59dc8 100644 --- a/flake.nix +++ b/flake.nix @@ -19,12 +19,24 @@ ]; }; in rec { - # From nix >= 2.7 the default app syntax changes - defaultApp.${system} = { - type = "app"; - program = "${packages.${system}.neovimCH}/bin/nvim"; + # For nix < 2.7 + # For nix >= 2.7 they should grab from: + # apps.${system}.default + # packages.${system}.default + # automatically + defaultApp.${system} = apps.${system}.default; + defaultPackage.${system} = packages.${system}.default; + + apps.${system} = rec { + nvim = { + type = "app"; + program = "${packages.${system}.default}/bin/nvim"; + }; + default = nvim; }; - packages.${system}.neovimCH = with pkgs; symlinkJoin { + packages.${system} = with pkgs; rec { + default = neovimCH; + neovimCH = symlinkJoin { name = "neovim"; paths = [ pkgs.neovim ]; buildInputs = [ pkgs.makeWrapper ]; @@ -44,4 +56,5 @@ ''; }; }; + }; } -- cgit v1.2.3