From 2ce57b551d7521483d477c74b5ccb56b87bae33c Mon Sep 17 00:00:00 2001 From: "D. Moonfire" Date: Sun, 12 Jan 2025 18:36:48 -0600 Subject: [PATCH] docs: updated read me --- README.md | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3db4a01..dca9174 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,45 @@ _An opinionated setup for projects using MfGames Writing._ -This is a setup flake that adds in the various packages used by MfGames Writing. +This is a setup flake that adds in the various packages used by MfGames Writing. It is intended to be used along with [mfgames-project-setup](https://mfgames.com/mfgames-project-setup-flake/) to provide additional functionality. + +## Nix + +This project is intended to be used with [Nix](https://nixos.wiki/wiki/Flakes) flakes and can be used directly as an input. + +```nix +{ + inputs = { + mfgames-project-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-project-setup-flake.git"; + mfgames-writing-setup.url = "git+https://src.mfgames.com/nixos-contrib/mfgames-writing-setup-flake.git"; + }; +} +``` + +This flake provides a function in `mfgames-writing-setup.lib.mkConfig` that +creates a shell hook and the various tools required to run those hooks (because +programs like `lefthook` assume that the program is in the `PATH`). + +```nix +devShell = + let + project-config = mfgames-project-setup.lib.mkConfig { + inherit system; + prettier.proseWrap = "never"; # Used to avoid line wrapping at 80 columns + }; + writing-config = mfgames-writing-setup.lib.mkConfig { + inherit system; + }; + in + pkgs.mkShell { + packages = [ ] + ++ project-config.packages + ++ writing-config.packages; + + shellHook = project-config.shellHook; + }; +``` ## Configuration -There are currently no configuration options. +There are currently no configuration options with this flake, but the project setup flake contains some options.