{ inputs, ... }: { imports = [ inputs.devshell.flakeModule inputs.treefmt-nix.flakeModule inputs.pre-commit-hooks.flakeModule ]; perSystem = { config , inputs' , pkgs , ... }: { devshells.default = { name = "world"; packages = with pkgs; [ (config.treefmt.build.wrapper) ]; devshell.startup = { pre-commit.text = config.pre-commit.installationScript; }; commands = [ { package = config.treefmt.build.wrapper; } { name = "update"; help = "Update + Commit the Lock File"; command = "nix flake update --commit-lock-file"; category = "nix"; } { name = "build-darwin"; category = "darwin"; help = "Build the current darwin configuration"; command = "darwin-rebuild build --flake .#"; } { name = "switch-darwin"; category = "darwin"; help = "Switch to the current darwin configuration"; command = "darwin-rebuild switch --flake .#"; } ]; }; treefmt = { projectRootFile = ".git/config"; # list of supported programs # https://github.com/numtide/treefmt-nix programs = { nixpkgs-fmt.enable = true; shfmt.enable = true; shellcheck.enable = true; yamlfmt.enable = true; taplo.enable = true; }; }; pre-commit = { settings = { hooks = { # deadnix.enable = true; treefmt.enable = true; }; }; }; }; }