Provide a mechanism by which users can customize the nix devShell

This commit is contained in:
Ivan Malison 2021-08-11 20:55:00 -06:00 committed by slotThe
parent ca25b36aa0
commit f1ea1e533d
2 changed files with 9 additions and 3 deletions

1
.gitignore vendored
View File

@ -27,3 +27,4 @@ tags
stack.yaml.lock stack.yaml.lock
flake.lock

View File

@ -18,13 +18,18 @@
}; };
overlays = xmonad.overlays ++ [ overlay ]; overlays = xmonad.overlays ++ [ overlay ];
in flake-utils.lib.eachDefaultSystem (system: in flake-utils.lib.eachDefaultSystem (system:
let pkgs = import nixpkgs { inherit system overlays; }; let
pkgs = import nixpkgs { inherit system overlays; };
modifyDevShell =
if builtins.pathExists ./develop.nix
then import ./develop.nix
else _: x: x;
in in
rec { rec {
devShell = pkgs.haskellPackages.shellFor { devShell = pkgs.haskellPackages.shellFor (modifyDevShell pkgs {
packages = p: [ p.xmonad-contrib ]; packages = p: [ p.xmonad-contrib ];
nativeBuildInputs = [ pkgs.cabal-install ]; nativeBuildInputs = [ pkgs.cabal-install ];
}; });
defaultPackage = pkgs.haskellPackages.xmonad-contrib; defaultPackage = pkgs.haskellPackages.xmonad-contrib;
}) // { inherit overlay overlays; } ; }) // { inherit overlay overlays; } ;
} }