flake: Allow users to modify the dev shell

Copy of xmonad/xmonad-contrib@f1ea1e533d
Documentation for this is already inside of contrib's NIX.md.

Co-authored-by: Ivan Malison <IvanMalison@gmail.com>
This commit is contained in:
Tony Zorman 2023-11-20 19:37:31 +01:00
parent 32afd5e7e8
commit 8421b100dd

View File

@ -74,11 +74,15 @@
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; };
hpkg = pkgs.lib.attrsets.getAttrFromPath (hpath defComp) pkgs; hpkg = pkgs.lib.attrsets.getAttrFromPath (hpath defComp) pkgs;
modifyDevShell =
if builtins.pathExists ./develop.nix
then import ./develop.nix
else _: x: x;
in in
rec { rec {
devShell = hpkg.shellFor { devShell = hpkg.shellFor (modifyDevShell pkgs {
packages = p: [ p.xmonad ]; packages = p: [ p.xmonad ];
}; });
defaultPackage = hpkg.xmonad; defaultPackage = hpkg.xmonad;
# An auxiliary NixOS module that modernises the standard xmonad NixOS module # An auxiliary NixOS module that modernises the standard xmonad NixOS module
# and wrapper script used, replacing them with versions from unstable. # and wrapper script used, replacing them with versions from unstable.