aboutsummaryrefslogtreecommitdiff
path: root/pkgs/dev/default.nix
blob: 959be0cc34b9a99268d8fa26faa27685b373b007 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  lib,
  stdenvNoCC,
  makeShellWrapper,
  bash,
  nix,
  devShells,
}:
with lib; let
  shells = concatStringsSep ":" (mapAttrsToList (
      n: v: "${n}=${v.drvPath}=${v}"
    )
    devShells);
in
  stdenvNoCC.mkDerivation {
    name = "personal-devshells";
    src = ./.;

    nativeBuildInputs = [makeShellWrapper];
    installPhase = ''
      makeShellWrapper ${./dev.sh} $out/bin/dev \
        --prefix PATH : ${lib.makeBinPath [bash nix]} \
        --set DEV_SHELLS "${shells}"
    '';

    meta.mainProgram = "dev";
  }