From a586a6b966d59f53f45a04f8891fbc017dc09dbe Mon Sep 17 00:00:00 2001 From: zimbatm Date: Wed, 26 Aug 2020 20:21:41 +0200 Subject: [PATCH] simpleFlake: support defaultPackage and devShell --- simpleFlake.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/simpleFlake.nix b/simpleFlake.nix index b3d497c..c70eff2 100644 --- a/simpleFlake.nix +++ b/simpleFlake.nix @@ -56,10 +56,21 @@ let # Flake expects a flat attrset containing only derivations as values packages = lib.flattenTree packages; - } // (if shell == null then { } else { - devShell = shell_ { inherit pkgs; }; - }) + } + // + ( + if packages ? defaultPackage then { + defaultPackage = packages.defaultPackage; + } else { } + ) + // + ( + if shell != null then { + devShell = shell_ { inherit pkgs; }; + } else if packages ? devShell then { + devShell = packages.devShell; + } else { } + ) ); - in outputs