{ config, inputs, lib, pkgs, ... }: let packages = builtins.attrValues { inherit (pkgs) shellcheck # Shell script linter shfmt # Shell parser and formatter ; # LSP for Bash and sh inherit (pkgs.nodePackages) bash-language-server; }; in { options = { my.dev.sh = { enable = lib.mkEnableOption "Install shell scripting tools globally"; users = lib.mkOption { type = lib.types.either lib.types.str (lib.types.listOf lib.types.str); default = config.my.toggleUsers.dev; merge = inputs.self.lib.mergeUsersOption lib; description = "Users to install shell scripting packages for"; }; }; devShells.sh = lib.mkOption { type = lib.types.package; default = pkgs.mkShell { inherit packages; name = "sh-dev-shell"; shellHook = '' echo "💻 Shell scripting dev environment" ''; }; description = "Shell scripting dev shell"; }; }; config = lib.mkIf config.my.dev.sh.enable { users.users = inputs.self.lib.mkUserAttrs lib config.my.dev.sh.users { inherit packages; }; }; }