mirror of
https://github.com/nix-community/flakelight.git
synced 2024-11-22 07:23:11 +01:00
Allow overriding of default devShell
This sets the default devShell using mkDefault, letting user set default shells override it. Previously, to set a different default shell, one would have to not set any of the devShell.* options and then define devShells.default, or use mkForce.
This commit is contained in:
parent
fad306c589
commit
e401f68030
@ -4,8 +4,8 @@
|
||||
|
||||
{ config, lib, flakelight, ... }:
|
||||
let
|
||||
inherit (lib) any attrValues filterAttrs mapAttrs mkIf mkMerge mkOption
|
||||
optionalAttrs;
|
||||
inherit (lib) any attrValues filterAttrs mapAttrs mkDefault mkIf mkMerge
|
||||
mkOption optionalAttrs;
|
||||
inherit (lib.types) lazyAttrsOf functionTo lines listOf nullOr package str;
|
||||
inherit (flakelight) supportedSystem;
|
||||
inherit (flakelight.types) optFunctionTo packageDef;
|
||||
@ -45,7 +45,7 @@ in
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf (any (x: x != null) (attrValues config.devShell)) {
|
||||
devShells.default = { pkgs, mkShell }: mkShell (
|
||||
devShells.default = mkDefault ({ pkgs, mkShell }: mkShell (
|
||||
optionalAttrs (config.devShell.env != null)
|
||||
(config.devShell.env pkgs)
|
||||
// optionalAttrs (config.devShell.inputsFrom != null) {
|
||||
@ -57,7 +57,7 @@ in
|
||||
// optionalAttrs (config.devShell.shellHook != null) {
|
||||
shellHook = config.devShell.shellHook pkgs;
|
||||
}
|
||||
);
|
||||
));
|
||||
})
|
||||
|
||||
(mkIf (config.devShells != { }) {
|
||||
|
Loading…
Reference in New Issue
Block a user