mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-27 16:33:05 +03:00
feat: generate shell for each package but make default the combined shell
This commit is contained in:
parent
0176f85f80
commit
faa2b46f46
@ -76,18 +76,32 @@
|
||||
(name: version: {"${version}" = buildPackage name version;})
|
||||
args.packages;
|
||||
|
||||
mkShellForDrvs = drvs:
|
||||
pkgs.callPackage ../devshell.nix {
|
||||
name = "devshell";
|
||||
inherit drvs;
|
||||
};
|
||||
|
||||
pkgShells =
|
||||
l.mapAttrs
|
||||
(
|
||||
name: version: let
|
||||
pkg = allPackages.${name}.${version};
|
||||
in
|
||||
mkShellForDrvs [pkg]
|
||||
)
|
||||
args.packages;
|
||||
|
||||
allPackagesList =
|
||||
l.mapAttrsToList
|
||||
(name: version: allPackages.${name}.${version})
|
||||
args.packages;
|
||||
shell = pkgs.callPackage ../devshell.nix {
|
||||
name = "devshell";
|
||||
drvs = allPackagesList;
|
||||
};
|
||||
in {
|
||||
packages = allPackages;
|
||||
devShells = {
|
||||
default = shell;
|
||||
};
|
||||
devShells =
|
||||
pkgShells
|
||||
// {
|
||||
default = mkShellForDrvs allPackagesList;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -136,6 +136,22 @@
|
||||
(name: version: {"${version}" = buildPackage name version;})
|
||||
args.packages;
|
||||
|
||||
mkShellForDrvs = drvs:
|
||||
pkgs.callPackage ../devshell.nix {
|
||||
name = "devshell";
|
||||
inherit drvs;
|
||||
};
|
||||
|
||||
pkgShells =
|
||||
l.mapAttrs
|
||||
(
|
||||
name: version: let
|
||||
pkg = allPackages.${name}.${version};
|
||||
in
|
||||
mkShellForDrvs [pkg.passthru.dependencies pkg]
|
||||
)
|
||||
args.packages;
|
||||
|
||||
allPackagesList = l.flatten (
|
||||
l.mapAttrsToList
|
||||
(
|
||||
@ -145,14 +161,12 @@
|
||||
)
|
||||
args.packages
|
||||
);
|
||||
shell = pkgs.callPackage ../devshell.nix {
|
||||
name = "devshell";
|
||||
drvs = allPackagesList;
|
||||
};
|
||||
in {
|
||||
packages = allPackages;
|
||||
devShells = {
|
||||
default = shell;
|
||||
};
|
||||
devShells =
|
||||
pkgShells
|
||||
// {
|
||||
default = mkShellForDrvs allPackagesList;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -47,19 +47,18 @@
|
||||
all
|
||||
// env
|
||||
// {
|
||||
packages = (all.packages or []) ++ (env.packages or []);
|
||||
buildInputs = (all.buildInputs or []) ++ (env.buildInputs or []);
|
||||
nativeBuildInputs = (all.nativeBuildInputs or []) ++ (env.nativeBuildInputs or []);
|
||||
propagatedBuildInputs = (all.propagatedBuildInputs or []) ++ (env.propagatedBuildInputs or []);
|
||||
propagatedNativeBuildInputs = (all.propagatedNativeBuildInputs or []) ++ (env.propagatedNativeBuildInputs or []);
|
||||
}
|
||||
)
|
||||
{}
|
||||
envs;
|
||||
_shellEnv = combineEnvs (l.map getEnvs drvs);
|
||||
shellEnv =
|
||||
(combineEnvs (l.map getEnvs drvs))
|
||||
_shellEnv
|
||||
// {
|
||||
inherit name;
|
||||
passthru.env = _shellEnv;
|
||||
};
|
||||
in
|
||||
(mkShell.override {stdenv = (l.head drvs).stdenv;}) shellEnv
|
||||
|
Loading…
Reference in New Issue
Block a user