From 079f94c73d28decf4ffd7248e00f7385664b6ea5 Mon Sep 17 00:00:00 2001 From: Stefanos Grammenos Date: Sun, 17 Aug 2025 21:13:30 +0300 Subject: [PATCH 1/2] Documentation. DAG library examples from lib.dag to lib.hm.dag --- docs/manual/configuring/dags.md | 44 ++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/manual/configuring/dags.md b/docs/manual/configuring/dags.md index 34351826..0473178f 100644 --- a/docs/manual/configuring/dags.md +++ b/docs/manual/configuring/dags.md @@ -14,14 +14,14 @@ explains in more detail the overall usage logic of the DAG type. ## entryAnywhere {#sec-types-dag-entryAnywhere} -> `lib.dag.entryAnywhere (value: T) : DagEntry` +> `lib.hm.dag.entryAnywhere (value: T) : DagEntry` Indicates that `value` can be placed anywhere within the DAG. This is also the default for plain attribute set entries, that is ```nix foo.bar = { - a = lib.dag.entryAnywhere 0; + a = lib.hm.dag.entryAnywhere 0; } ``` @@ -37,7 +37,7 @@ are equivalent. ## entryAfter {#ch-types-dag-entryAfter} -> `lib.dag.entryAfter (afters: list string) (value: T) : DagEntry` +> `lib.hm.dag.entryAfter (afters: list string) (value: T) : DagEntry` Indicates that `value` must be placed _after_ each of the attribute names in the given list. For example @@ -45,7 +45,7 @@ given list. For example ```nix foo.bar = { a = 0; - b = lib.dag.entryAfter [ "a" ] 1; + b = lib.hm.dag.entryAfter [ "a" ] 1; } ``` @@ -53,14 +53,14 @@ would place `b` after `a` in the graph. ## entryBefore {#ch-types-dag-entryBefore} -> `lib.dag.entryBefore (befores: list string) (value: T) : DagEntry` +> `lib.hm.dag.entryBefore (befores: list string) (value: T) : DagEntry` Indicates that `value` must be placed _before_ each of the attribute names in the given list. For example ```nix foo.bar = { - b = lib.dag.entryBefore [ "a" ] 1; + b = lib.hm.dag.entryBefore [ "a" ] 1; a = 0; } ``` @@ -69,7 +69,7 @@ would place `b` before `a` in the graph. ## entryBetween {#sec-types-dag-entryBetween} -> `lib.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` +> `lib.hm.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` Indicates that `value` must be placed _before_ the attribute names in the first list and _after_ the attribute names in the second list. For example @@ -77,7 +77,7 @@ list and _after_ the attribute names in the second list. For example ```nix foo.bar = { a = 0; - c = lib.dag.entryBetween [ "b" ] [ "a" ] 2; + c = lib.hm.dag.entryBetween [ "b" ] [ "a" ] 2; b = 1; } ``` @@ -92,13 +92,13 @@ functions take a `tag` as argument and the DAG entries will be named ## entriesAnywhere {#sec-types-dag-entriesAnywhere} -> `lib.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` +> `lib.hm.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. For example ```nix -foo.bar = lib.dag.entriesAnywhere "a" [ 0 1 ]; +foo.bar = lib.hm.dag.entriesAnywhere "a" [ 0 1 ]; ``` is equivalent to @@ -106,13 +106,13 @@ is equivalent to ```nix foo.bar = { a-0 = 0; - a-1 = lib.dag.entryAfter [ "a-0" ] 1; + a-1 = lib.hm.dag.entryAfter [ "a-0" ] 1; } ``` ## entriesAfter {#sec-types-dag-entriesAfter} -> `lib.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` +> `lib.hm.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed are placed _after_ each of the attribute names in @@ -120,7 +120,7 @@ The list of values are placed are placed _after_ each of the attribute names in ```nix foo.bar = - { b = 0; } // lib.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; + { b = 0; } // lib.hm.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -128,14 +128,14 @@ is equivalent to ```nix foo.bar = { b = 0; - a-0 = lib.dag.entryAfter [ "b" ] 1; - a-1 = lib.dag.entryAfter [ "a-0" ] 2; + a-0 = lib.hm.dag.entryAfter [ "b" ] 1; + a-1 = lib.hm.dag.entryAfter [ "a-0" ] 2; } ``` ## entriesBefore {#sec-types-dag-entriesBefore} -> `lib.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` +> `lib.hm.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed _before_ each of the attribute names in `befores`. @@ -143,7 +143,7 @@ For example ```nix foo.bar = - { b = 0; } // lib.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; + { b = 0; } // lib.hm.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -152,13 +152,13 @@ is equivalent to foo.bar = { b = 0; a-0 = 1; - a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-1 = lib.hm.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ``` ## entriesBetween {#sec-types-dag-entriesBetween} -> `lib.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` +> `lib.hm.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed _before_ each of the attribute names in `befores` @@ -166,7 +166,7 @@ and _after_ each of the attribute names in `afters`. For example ```nix foo.bar = - { b = 0; c = 3; } // lib.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; + { b = 0; c = 3; } // lib.hm.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; ``` is equivalent to @@ -175,7 +175,7 @@ is equivalent to foo.bar = { b = 0; c = 3; - a-0 = lib.dag.entryAfter [ "c" ] 1; - a-1 = lib.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-0 = lib.hm.dag.entryAfter [ "c" ] 1; + a-1 = lib.hm.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ``` From dbfeba975cf20dcaa7ed04821fac8a58e6d4b2c4 Mon Sep 17 00:00:00 2001 From: Stefanos Grammenos Date: Sun, 17 Aug 2025 23:21:22 +0300 Subject: [PATCH 2/2] Update the 'dag' library from lib.hm.dag to nvf.lib.nvim.dag --- docs/manual/configuring/dags.md | 47 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/docs/manual/configuring/dags.md b/docs/manual/configuring/dags.md index 0473178f..08e82bab 100644 --- a/docs/manual/configuring/dags.md +++ b/docs/manual/configuring/dags.md @@ -14,14 +14,17 @@ explains in more detail the overall usage logic of the DAG type. ## entryAnywhere {#sec-types-dag-entryAnywhere} -> `lib.hm.dag.entryAnywhere (value: T) : DagEntry` +> `nvf.lib.nvim.dag.entryAnywhere (value: T) : DagEntry` Indicates that `value` can be placed anywhere within the DAG. This is also the default for plain attribute set entries, that is ```nix +# For 'nvf' to be available in module's arguments, +# it needs to be inherited from imports in the modules array as: +# modules = [{ _module.args = { inherit nvf; }; } ...]; foo.bar = { - a = lib.hm.dag.entryAnywhere 0; + a = nvf.lib.nvim.dag.entryAnywhere 0; } ``` @@ -37,7 +40,7 @@ are equivalent. ## entryAfter {#ch-types-dag-entryAfter} -> `lib.hm.dag.entryAfter (afters: list string) (value: T) : DagEntry` +> `nvf.lib.nvim.dag.entryAfter (afters: list string) (value: T) : DagEntry` Indicates that `value` must be placed _after_ each of the attribute names in the given list. For example @@ -45,7 +48,7 @@ given list. For example ```nix foo.bar = { a = 0; - b = lib.hm.dag.entryAfter [ "a" ] 1; + b = nvf.lib.nvim.dag.entryAfter [ "a" ] 1; } ``` @@ -53,14 +56,14 @@ would place `b` after `a` in the graph. ## entryBefore {#ch-types-dag-entryBefore} -> `lib.hm.dag.entryBefore (befores: list string) (value: T) : DagEntry` +> `nvf.lib.nvim.dag.entryBefore (befores: list string) (value: T) : DagEntry` Indicates that `value` must be placed _before_ each of the attribute names in the given list. For example ```nix foo.bar = { - b = lib.hm.dag.entryBefore [ "a" ] 1; + b = nvf.lib.nvim.dag.entryBefore [ "a" ] 1; a = 0; } ``` @@ -69,7 +72,7 @@ would place `b` before `a` in the graph. ## entryBetween {#sec-types-dag-entryBetween} -> `lib.hm.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` +> `nvf.lib.nvim.dag.entryBetween (befores: list string) (afters: list string) (value: T) : DagEntry` Indicates that `value` must be placed _before_ the attribute names in the first list and _after_ the attribute names in the second list. For example @@ -77,7 +80,7 @@ list and _after_ the attribute names in the second list. For example ```nix foo.bar = { a = 0; - c = lib.hm.dag.entryBetween [ "b" ] [ "a" ] 2; + c = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a" ] 2; b = 1; } ``` @@ -92,13 +95,13 @@ functions take a `tag` as argument and the DAG entries will be named ## entriesAnywhere {#sec-types-dag-entriesAnywhere} -> `lib.hm.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` +> `nvf.lib.nvim.dag.entriesAnywhere (tag: string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. For example ```nix -foo.bar = lib.hm.dag.entriesAnywhere "a" [ 0 1 ]; +foo.bar = nvf.lib.nvim.dag.entriesAnywhere "a" [ 0 1 ]; ``` is equivalent to @@ -106,13 +109,13 @@ is equivalent to ```nix foo.bar = { a-0 = 0; - a-1 = lib.hm.dag.entryAfter [ "a-0" ] 1; + a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 1; } ``` ## entriesAfter {#sec-types-dag-entriesAfter} -> `lib.hm.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` +> `nvf.lib.nvim.dag.entriesAfter (tag: string) (afters: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed are placed _after_ each of the attribute names in @@ -120,7 +123,7 @@ The list of values are placed are placed _after_ each of the attribute names in ```nix foo.bar = - { b = 0; } // lib.hm.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; + { b = 0; } // nvf.lib.nvim.dag.entriesAfter "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -128,14 +131,14 @@ is equivalent to ```nix foo.bar = { b = 0; - a-0 = lib.hm.dag.entryAfter [ "b" ] 1; - a-1 = lib.hm.dag.entryAfter [ "a-0" ] 2; + a-0 = nvf.lib.nvim.dag.entryAfter [ "b" ] 1; + a-1 = nvf.lib.nvim.dag.entryAfter [ "a-0" ] 2; } ``` ## entriesBefore {#sec-types-dag-entriesBefore} -> `lib.hm.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` +> `nvf.lib.nvim.dag.entriesBefore (tag: string) (befores: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed _before_ each of the attribute names in `befores`. @@ -143,7 +146,7 @@ For example ```nix foo.bar = - { b = 0; } // lib.hm.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; + { b = 0; } // nvf.lib.nvim.dag.entriesBefore "a" [ "b" ] [ 1 2 ]; ``` is equivalent to @@ -152,13 +155,13 @@ is equivalent to foo.bar = { b = 0; a-0 = 1; - a-1 = lib.hm.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ``` ## entriesBetween {#sec-types-dag-entriesBetween} -> `lib.hm.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` +> `nvf.lib.nvim.dag.entriesBetween (tag: string) (befores: list string) (afters: list string) (values: [T]) : Dag` Creates a DAG with the given values with each entry labeled using the given tag. The list of values are placed _before_ each of the attribute names in `befores` @@ -166,7 +169,7 @@ and _after_ each of the attribute names in `afters`. For example ```nix foo.bar = - { b = 0; c = 3; } // lib.hm.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; + { b = 0; c = 3; } // nvf.lib.nvim.dag.entriesBetween "a" [ "b" ] [ "c" ] [ 1 2 ]; ``` is equivalent to @@ -175,7 +178,7 @@ is equivalent to foo.bar = { b = 0; c = 3; - a-0 = lib.hm.dag.entryAfter [ "c" ] 1; - a-1 = lib.hm.dag.entryBetween [ "b" ] [ "a-0" ] 2; + a-0 = nvf.lib.nvim.dag.entryAfter [ "c" ] 1; + a-1 = nvf.lib.nvim.dag.entryBetween [ "b" ] [ "a-0" ] 2; } ```