# SPDX-FileCopyrightText: 2025 Ethan Reece # # SPDX-License-Identifier: MIT { config, flake-parts-lib, inputs, lib, ... }: let entries = builtins.attrNames (builtins.readDir ./.); modules = builtins.filter (dir: builtins.pathExists (./. + "/${dir}/flake-module.nix")) entries; in { imports = builtins.map ( module-name: flake-parts-lib.importApply (./. + "/${module-name}/flake-module.nix") { inherit module-name; } ) modules; perSystem = { pkgs, system, ... }: { devshells.default = { commands = [ # { # help = "󰘥 show nix-darwin documentation"; # name = "man-darwin"; # command = "darwin-help"; # category = " nix-darwin"; # } ] ++ builtins.concatMap ( name: if config.devices.${name}.enable && config.devices.${name}.system == system then [ { help = "  `nix-on-droid switch` for ${name}"; name = "droid-${name}"; command = "${ inputs.nix-on-droid.packages.${system}.nix-on-droid }/bin/nix-on-droid switch --flake .#${name}"; category = " ${name}"; } { help = " 󰸨 `nix-on-droid switch` for ${name} with backup"; name = "droid-${name}-backup"; command = "${ inputs.nix-on-droid.packages.${system}.nix-on-droid }/bin/nix-on-droid switch --flake .#${name} -b backup"; category = " ${name}"; } ] else [ ] ) modules; }; }; }