simpleFlake: support defaultPackage and devShell

This commit is contained in:
zimbatm 2020-08-26 20:21:41 +02:00
parent e34fcedfc7
commit a586a6b966
No known key found for this signature in database
GPG Key ID: 71BAF6D40C1D63D7
1 changed files with 15 additions and 4 deletions

View File

@ -56,10 +56,21 @@ let
# Flake expects a flat attrset containing only derivations as values # Flake expects a flat attrset containing only derivations as values
packages = lib.flattenTree packages; 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 in
outputs outputs