From 3b05dcdb0914122c824569c2bbcf382ff2842a8d Mon Sep 17 00:00:00 2001 From: Drazen Popovic Date: Fri, 2 Feb 2024 13:04:18 +0100 Subject: [PATCH 1/8] Migrating pre-commit-hooks from LB --- .envrc | 1 + .gitignore | 1 + examples/build.nix | 1 + examples/pre-commit.nix | 15 +++++++++ flake-lang/build.nix | 24 +++++++++++--- flake-lang/pre-commit-hooks/deno.nix | 33 +++++++++++++++++++ flake-lang/pre-commit-hooks/rust-monorepo.nix | 19 +++++++++++ flake-lang/pre-commit-hooks/tools.nix | 23 +++++++++++++ pre-commit.nix | 6 ++-- 9 files changed, 116 insertions(+), 7 deletions(-) create mode 100644 .envrc create mode 100644 examples/pre-commit.nix create mode 100644 flake-lang/pre-commit-hooks/deno.nix create mode 100644 flake-lang/pre-commit-hooks/rust-monorepo.nix create mode 100644 flake-lang/pre-commit-hooks/tools.nix diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..11f188f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake .#default diff --git a/.gitignore b/.gitignore index 38efb0f..e8345f4 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ cabal.project.local cabal.project.local~ .HTF/ .ghc.environment.* +.direnv/ \ No newline at end of file diff --git a/examples/build.nix b/examples/build.nix index 27898b3..d40ecb8 100644 --- a/examples/build.nix +++ b/examples/build.nix @@ -5,6 +5,7 @@ _: { imports = [ + ./pre-commit.nix ./haskell-flake-project/build.nix ./rust-flake-project/build.nix ./typescript-flake-project/build.nix diff --git a/examples/pre-commit.nix b/examples/pre-commit.nix new file mode 100644 index 0000000..3e69b14 --- /dev/null +++ b/examples/pre-commit.nix @@ -0,0 +1,15 @@ +{ inputs, config, ... }: { + imports = [ + inputs.pre-commit-hooks.flakeModule + config.flake-lang.rustMonorepoPreCommit + config.flake-lang.denoPreCommit + ]; + perSystem = _: { + pre-commit.settings = { + hooks = { + rust-monorepo.enable = true; + my-deno.enable = true; + }; + }; + }; +} diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 0b7e03f..155fe8c 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -1,5 +1,4 @@ -# Note(jaredponn): - +# NOTE(jaredponn): # Loosely, the key idea is that in this flake we want to have an attribute like # ``` # lib. = { @@ -10,7 +9,7 @@ # }; # ``` # This is unfortunately not super easy to do with flake-parts! Some useful -# links + examples are as follows. +# links + examples are as follows. # - [1] https://github.com/hercules-ci/flake-parts/blob/main/lib.nix # - [2] https://github.com/hercules-ci/flake-parts/pull/63/files # - [3] https://github.com/hercules-ci/flake-parts/blob/main/modules/formatter.nix @@ -79,8 +78,23 @@ default = import ./typescript/flake-typescript.nix pkgs; readOnly = true; description = lib.mdDoc builtins.readFile ./typescript/description.md; - # TODO(jaredponn): add an example - # example = lib.mdDoc '' ''; + example = lib.mdDoc ''TODO(jaredponn)''; + }; + + rustMonorepoPreCommit = lib.mkOption { + type = lib.types.flakeModule; + default = ./pre-commit-hooks/rust-monorepo.nix; + readOnly = true; + description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; + example = lib.mdDoc ''TODO(bladyjoker)''; + }; + + denoPreCommit = lib.mkOption { + type = lib.types.flakeModule; + default = ./pre-commit-hooks/deno.nix; + readOnly = true; + description = lib.mdDoc ''pre-commit-hooks.nix hook for Deno in a monorepo setting''; + example = lib.mdDoc ''TODO(bladyjoker)''; }; }; diff --git a/flake-lang/pre-commit-hooks/deno.nix b/flake-lang/pre-commit-hooks/deno.nix new file mode 100644 index 0000000..ee32178 --- /dev/null +++ b/flake-lang/pre-commit-hooks/deno.nix @@ -0,0 +1,33 @@ +{ inputs, ... }: { + imports = [ + inputs.pre-commit-hooks.flakeModule # Adds perSystem.pre-commit options + ./tools.nix + ]; + perSystem = { config, ... }: + { + pre-commit.settings.hooks = { + # TODO(jaredponn): Why do we use our strange version of `denofmt` and + # `denolint`? The default implemented version in `pre-commit-hooks.nix` + # is a bit buggy (see + # https://github.com/cachix/pre-commit-hooks.nix/issues/374), and the + # latest version of `deno` on nix doesn't allow explicitly applying + # the formatter to specific files + my-denofmt = + { + name = "denofmt"; + description = "Format Typescript code."; + entry = "${config.flake-lang.pre-commit-hooks.tools.deno}/bin/deno fmt"; + files = "(\\.m?ts$)|(^tsconfig?(-base)\\.json$)"; + }; + + my-denolint = + { + name = "denolint"; + description = "Lint Typescript code."; + entry = "${config.flake-lang.pre-commit-hooks.tools.deno}/bin/deno lint"; + files = "\\.m?ts$"; + }; + + }; + }; +} diff --git a/flake-lang/pre-commit-hooks/rust-monorepo.nix b/flake-lang/pre-commit-hooks/rust-monorepo.nix new file mode 100644 index 0000000..c8efa6a --- /dev/null +++ b/flake-lang/pre-commit-hooks/rust-monorepo.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: { + imports = [ + inputs.pre-commit-hooks.flakeModule # Adds perSystem.pre-commit options + ./tools.nix + ]; + perSystem = { config, ... }: + { + pre-commit.settings.hooks = { + rustfmt-monorepo = + { + name = "rustfmt"; + description = "Format Rust code."; + entry = "${config.flake-lang.pre-commit-hooks.tools.rustfmt}/bin/rustfmt --color always"; + files = "\\.rs$"; + }; + + }; + }; +} diff --git a/flake-lang/pre-commit-hooks/tools.nix b/flake-lang/pre-commit-hooks/tools.nix new file mode 100644 index 0000000..9962e62 --- /dev/null +++ b/flake-lang/pre-commit-hooks/tools.nix @@ -0,0 +1,23 @@ +{ flake-parts-lib, lib, ... }: { + perSystem = flake-parts-lib.mkPerSystemOption ({ pkgs, pkgsForRust, ... }: { + options = { + flake-lang.pre-commit-hooks.tools = { + + rustfmt = lib.mkOption { + type = lib.types.derivation; + default = pkgsForRust.rustfmt; + readOnly = false; + description = lib.mdDoc ''Rust formatter to use for pre-commit hooks''; + }; + + deno = lib.mkOption { + type = lib.types.derivation; + default = pkgs.deno; + readOnly = false; + description = lib.mdDoc ''Deno tool to use for pre-commit hooks''; + }; + + }; + }; + }); +} diff --git a/pre-commit.nix b/pre-commit.nix index 6d3db92..6e75ce9 100644 --- a/pre-commit.nix +++ b/pre-commit.nix @@ -1,7 +1,9 @@ { inputs, ... }: { - imports = [ inputs.pre-commit-hooks.flakeModule ]; + imports = [ + inputs.pre-commit-hooks.flakeModule + ]; perSystem = { config, ... }: { - devShells.dev-pre-commit = config.pre-commit.devShell; + devShells.default = config.pre-commit.devShell; pre-commit.settings = { hooks = { # Typos From 9446ce37d900152cf1a51d11926ed0e140db4b63 Mon Sep 17 00:00:00 2001 From: jared <> Date: Fri, 2 Feb 2024 18:07:39 -0700 Subject: [PATCH 2/8] Various features + fixes: - Removed `./examples/pre-commit.nix` in favour of augmenting `./pre-commit.nix` - Justification: I'd prefer to keep all the `pre-commit` things in a single file. - Added a `flakeModule.rustMonorepoPreCommit` attribute which contains a module for formatting rust code - Justification: This copies the API given in https://github.com/cachix/pre-commit-hooks.nix/blob/7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf/flake.nix#L27. My reading of this is that we want to expose a flake module which enables the rust formatter. @szg251 if we're happy with this, I can try to get this patched in `pre-commit-hooks.nix` as a more permanent fix. - Removed deno precommit hooks - Justification: originally we rolled our own `deno` precommit things because the default was slightly broken. But it has now been patched -- see https://github.com/cachix/pre-commit-hooks.nix/pull/377 --- examples/build.nix | 1 - examples/pre-commit.nix | 15 ----------- flake-lang/build.nix | 39 ++++++++++++++++----------- flake-lang/pre-commit-hooks/deno.nix | 33 ----------------------- flake-lang/pre-commit-hooks/tools.nix | 31 +++++++++------------ pre-commit.nix | 14 ++++++++++ 6 files changed, 49 insertions(+), 84 deletions(-) delete mode 100644 examples/pre-commit.nix delete mode 100644 flake-lang/pre-commit-hooks/deno.nix diff --git a/examples/build.nix b/examples/build.nix index d40ecb8..27898b3 100644 --- a/examples/build.nix +++ b/examples/build.nix @@ -5,7 +5,6 @@ _: { imports = [ - ./pre-commit.nix ./haskell-flake-project/build.nix ./rust-flake-project/build.nix ./typescript-flake-project/build.nix diff --git a/examples/pre-commit.nix b/examples/pre-commit.nix deleted file mode 100644 index 3e69b14..0000000 --- a/examples/pre-commit.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ inputs, config, ... }: { - imports = [ - inputs.pre-commit-hooks.flakeModule - config.flake-lang.rustMonorepoPreCommit - config.flake-lang.denoPreCommit - ]; - perSystem = _: { - pre-commit.settings = { - hooks = { - rust-monorepo.enable = true; - my-deno.enable = true; - }; - }; - }; -} diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 155fe8c..5d7b815 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -7,6 +7,9 @@ # typescriptFlake = ... # ... # }; +# flakeModule = { +# rustMonorepoPreCommit = ... +# }; # ``` # This is unfortunately not super easy to do with flake-parts! Some useful # links + examples are as follows. @@ -16,11 +19,31 @@ { config, inputs, flake-parts-lib, lib, ... }: { options = { flake = flake-parts-lib.mkSubmoduleOptions { + # Expose attributes which are generated by the `perSystem` `lib` options + # e.g. it gives an option for things like + # ``` + # lib..haskellFlake = .. + # ``` lib = lib.mkOption { type = lib.types.lazyAttrsOf (lib.types.lazyAttrsOf (lib.types.functionTo lib.types.attrs)); default = { }; visible = false; }; + + # Expose attributes like + # ``` + # flakeModule.rustMonorepoPreCommit = .. + # ``` + flakeModule = { + rustMonorepoPreCommit = lib.mkOption { + type = lib.types.lazyAttrsOf lib.types.unspecified; + default = ./pre-commit-hooks/rust-monorepo.nix; + readOnly = true; + description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; + example = lib.mdDoc ''TODO(bladyjoker)''; + }; + + }; }; perSystem = flake-parts-lib.mkPerSystemOption ({ pkgs, pkgsForCtl, pkgsForHaskellNix, pkgsForRust, ... }: { options = { @@ -81,22 +104,6 @@ example = lib.mdDoc ''TODO(jaredponn)''; }; - rustMonorepoPreCommit = lib.mkOption { - type = lib.types.flakeModule; - default = ./pre-commit-hooks/rust-monorepo.nix; - readOnly = true; - description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; - example = lib.mdDoc ''TODO(bladyjoker)''; - }; - - denoPreCommit = lib.mkOption { - type = lib.types.flakeModule; - default = ./pre-commit-hooks/deno.nix; - readOnly = true; - description = lib.mdDoc ''pre-commit-hooks.nix hook for Deno in a monorepo setting''; - example = lib.mdDoc ''TODO(bladyjoker)''; - }; - }; }; }); diff --git a/flake-lang/pre-commit-hooks/deno.nix b/flake-lang/pre-commit-hooks/deno.nix deleted file mode 100644 index ee32178..0000000 --- a/flake-lang/pre-commit-hooks/deno.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ inputs, ... }: { - imports = [ - inputs.pre-commit-hooks.flakeModule # Adds perSystem.pre-commit options - ./tools.nix - ]; - perSystem = { config, ... }: - { - pre-commit.settings.hooks = { - # TODO(jaredponn): Why do we use our strange version of `denofmt` and - # `denolint`? The default implemented version in `pre-commit-hooks.nix` - # is a bit buggy (see - # https://github.com/cachix/pre-commit-hooks.nix/issues/374), and the - # latest version of `deno` on nix doesn't allow explicitly applying - # the formatter to specific files - my-denofmt = - { - name = "denofmt"; - description = "Format Typescript code."; - entry = "${config.flake-lang.pre-commit-hooks.tools.deno}/bin/deno fmt"; - files = "(\\.m?ts$)|(^tsconfig?(-base)\\.json$)"; - }; - - my-denolint = - { - name = "denolint"; - description = "Lint Typescript code."; - entry = "${config.flake-lang.pre-commit-hooks.tools.deno}/bin/deno lint"; - files = "\\.m?ts$"; - }; - - }; - }; -} diff --git a/flake-lang/pre-commit-hooks/tools.nix b/flake-lang/pre-commit-hooks/tools.nix index 9962e62..c4d473d 100644 --- a/flake-lang/pre-commit-hooks/tools.nix +++ b/flake-lang/pre-commit-hooks/tools.nix @@ -1,23 +1,16 @@ { flake-parts-lib, lib, ... }: { - perSystem = flake-parts-lib.mkPerSystemOption ({ pkgs, pkgsForRust, ... }: { - options = { - flake-lang.pre-commit-hooks.tools = { - - rustfmt = lib.mkOption { - type = lib.types.derivation; - default = pkgsForRust.rustfmt; - readOnly = false; - description = lib.mdDoc ''Rust formatter to use for pre-commit hooks''; + options = { + perSystem = flake-parts-lib.mkPerSystemOption ({ pkgsForRust, ... }: { + options = { + flake-lang.pre-commit-hooks.tools = { + rustfmt = lib.mkOption { + type = lib.types.package; + default = pkgsForRust.rustfmt; + readOnly = false; + description = lib.mdDoc ''Rust formatter to use for pre-commit hooks''; + }; }; - - deno = lib.mkOption { - type = lib.types.derivation; - default = pkgs.deno; - readOnly = false; - description = lib.mdDoc ''Deno tool to use for pre-commit hooks''; - }; - }; - }; - }); + }); + }; } diff --git a/pre-commit.nix b/pre-commit.nix index 6e75ce9..0a9560a 100644 --- a/pre-commit.nix +++ b/pre-commit.nix @@ -1,6 +1,7 @@ { inputs, ... }: { imports = [ inputs.pre-commit-hooks.flakeModule + ./flake-lang/pre-commit-hooks/rust-monorepo.nix ]; perSystem = { config, ... }: { devShells.default = config.pre-commit.devShell; @@ -20,6 +21,19 @@ cabal-fmt.enable = true; hlint.enable = true; fourmolu.enable = true; + + # Typescript + denofmt = { + enable = true; + # NOTE(jaredponn): We follow the default files deno formats, except + # we exclude markdown files. See: + # [1] https://docs.deno.com/runtime/manual/tools/formatter + files = ''^.*\.(js|ts|jsx|tsx|json|jsonc)$''; + }; + denolint.enable = true; + + # Rust + rustfmt-monorepo.enable = true; }; }; }; From 87aec9ed2dcc34bbe3d55ca3960e5b8d4da65b6d Mon Sep 17 00:00:00 2001 From: jared <> Date: Fri, 2 Feb 2024 18:29:11 -0700 Subject: [PATCH 3/8] Run precommit for TS --- .../package.json | 5 +---- .../src/MyLib/index.ts | 4 ++-- .../src/MyLib/index.ts | 6 ++---- examples/typescript-flake-project/package.json | 5 +---- examples/typescript-flake-project/src/MyLib/index.ts | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/examples/typescript-flake-project-with-extra-dependency/package.json b/examples/typescript-flake-project-with-extra-dependency/package.json index d02a1e3..4c4ca15 100644 --- a/examples/typescript-flake-project-with-extra-dependency/package.json +++ b/examples/typescript-flake-project-with-extra-dependency/package.json @@ -18,10 +18,7 @@ }, "author": "Jared Pon", "license": "ISC", - "files": - [ "./dist/**/*" - , "./.extra-dependencies/**/*" - ], + "files": ["./dist/**/*", "./.extra-dependencies/**/*"], "dependencies": { "typescript": "^5.3.3", "typescript-flake-project": "file:.extra-dependencies/typescript-flake-project-1.0.0.tgz" diff --git a/examples/typescript-flake-project-with-extra-dependency/src/MyLib/index.ts b/examples/typescript-flake-project-with-extra-dependency/src/MyLib/index.ts index d96af6b..ab7f0ed 100644 --- a/examples/typescript-flake-project-with-extra-dependency/src/MyLib/index.ts +++ b/examples/typescript-flake-project-with-extra-dependency/src/MyLib/index.ts @@ -1,5 +1,5 @@ -import * as TsFlakeProject from 'typescript-flake-project' +import * as TsFlakeProject from "typescript-flake-project"; export function helloWorld() { - TsFlakeProject.helloWorld(); + TsFlakeProject.helloWorld(); } diff --git a/examples/typescript-flake-project-with-transitive-extra-dependency/src/MyLib/index.ts b/examples/typescript-flake-project-with-transitive-extra-dependency/src/MyLib/index.ts index a87341a..ce636fe 100644 --- a/examples/typescript-flake-project-with-transitive-extra-dependency/src/MyLib/index.ts +++ b/examples/typescript-flake-project-with-transitive-extra-dependency/src/MyLib/index.ts @@ -1,9 +1,7 @@ -import * as TsFlakeProject from 'typescript-flake-project' +import * as TsFlakeProject from "typescript-flake-project"; export function helloWorld() { - TsFlakeProject.helloWorld(); + TsFlakeProject.helloWorld(); } - - helloWorld(); diff --git a/examples/typescript-flake-project/package.json b/examples/typescript-flake-project/package.json index 12fdb58..72743de 100644 --- a/examples/typescript-flake-project/package.json +++ b/examples/typescript-flake-project/package.json @@ -18,10 +18,7 @@ }, "author": "Jared Pon", "license": "ISC", - "files": - [ "./dist/**/*" - , "./.extra-dependencies/**/*" - ], + "files": ["./dist/**/*", "./.extra-dependencies/**/*"], "dependencies": { "typescript": "^5.3.3" } diff --git a/examples/typescript-flake-project/src/MyLib/index.ts b/examples/typescript-flake-project/src/MyLib/index.ts index 10b9730..5117dc2 100644 --- a/examples/typescript-flake-project/src/MyLib/index.ts +++ b/examples/typescript-flake-project/src/MyLib/index.ts @@ -1,3 +1,3 @@ export function helloWorld() { - console.log("Hello world!"); + console.log("Hello world!"); } From 64563a8932af1190bf48ce47baafe0a1480729ab Mon Sep 17 00:00:00 2001 From: Drazen Popovic Date: Mon, 5 Feb 2024 16:02:40 +0100 Subject: [PATCH 4/8] Trying to import the rust-monorepo module --- flake-lang/build.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 5d7b815..960b866 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -37,7 +37,7 @@ flakeModule = { rustMonorepoPreCommit = lib.mkOption { type = lib.types.lazyAttrsOf lib.types.unspecified; - default = ./pre-commit-hooks/rust-monorepo.nix; + default = import ./pre-commit-hooks/rust-monorepo.nix; readOnly = true; description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; example = lib.mdDoc ''TODO(bladyjoker)''; From 8c86c85d69cde1198f1ce00704b0d06272e5e80f Mon Sep 17 00:00:00 2001 From: Drazen Popovic Date: Mon, 5 Feb 2024 16:11:05 +0100 Subject: [PATCH 5/8] Parens? --- flake-lang/build.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 960b866..7a1c35f 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -37,7 +37,7 @@ flakeModule = { rustMonorepoPreCommit = lib.mkOption { type = lib.types.lazyAttrsOf lib.types.unspecified; - default = import ./pre-commit-hooks/rust-monorepo.nix; + default = (import ./pre-commit-hooks/rust-monorepo.nix); readOnly = true; description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; example = lib.mdDoc ''TODO(bladyjoker)''; From 84a64c025b0379ec6035ca76c3ecf1d4a7849e29 Mon Sep 17 00:00:00 2001 From: Drazen Popovic Date: Mon, 5 Feb 2024 16:20:57 +0100 Subject: [PATCH 6/8] Unspecify the type --- flake-lang/build.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 7a1c35f..d363cb4 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -36,8 +36,8 @@ # ``` flakeModule = { rustMonorepoPreCommit = lib.mkOption { - type = lib.types.lazyAttrsOf lib.types.unspecified; - default = (import ./pre-commit-hooks/rust-monorepo.nix); + type = lib.types.unspecified; + default = import ./pre-commit-hooks/rust-monorepo.nix; readOnly = true; description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; example = lib.mdDoc ''TODO(bladyjoker)''; From 8ba7752a4f93b14c8f79c3631f7e9fbd2ed24826 Mon Sep 17 00:00:00 2001 From: Drazen Popovic Date: Mon, 5 Feb 2024 20:38:39 +0100 Subject: [PATCH 7/8] Try types.deferredModule --- flake-lang/build.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 40fbeed..24da72b 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -36,7 +36,7 @@ # ``` flakeModule = { rustMonorepoPreCommit = lib.mkOption { - type = lib.types.unspecified; + type = lib.types.deferredModule; default = import ./pre-commit-hooks/rust-monorepo.nix; readOnly = true; description = lib.mdDoc ''pre-commit-hooks.nix hook for Rust in a monorepo setting''; From f6ceaf6dfda41e25b1e01036fe4e0251aa7e254f Mon Sep 17 00:00:00 2001 From: jared <> Date: Tue, 6 Feb 2024 01:27:14 -0700 Subject: [PATCH 8/8] Renamed `flakeModule.` --> `flakeModules.` (NOTE THE PLURAL) since it lines up nicely with the already existing system with flake-parts https://flake.parts/options/flake-parts#opt-flake.flakeModules --- flake-lang/build.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake-lang/build.nix b/flake-lang/build.nix index 24da72b..68f6321 100644 --- a/flake-lang/build.nix +++ b/flake-lang/build.nix @@ -7,7 +7,7 @@ # typescriptFlake = ... # ... # }; -# flakeModule = { +# flakeModules = { # rustMonorepoPreCommit = ... # }; # ``` @@ -32,9 +32,9 @@ # Expose attributes like # ``` - # flakeModule.rustMonorepoPreCommit = .. + # flakeModules.rustMonorepoPreCommit = .. # ``` - flakeModule = { + flakeModules = { rustMonorepoPreCommit = lib.mkOption { type = lib.types.deferredModule; default = import ./pre-commit-hooks/rust-monorepo.nix;