diff --git a/website/content/default.nix b/website/content/default.nix index f1d19ea7..0aa4dc38 100644 --- a/website/content/default.nix +++ b/website/content/default.nix @@ -23,7 +23,7 @@ in [Learn more about Fediversity](${link pages.fediversity}) ''; outputs.html = (cfg.templates.html.page config).override ( - final: prev: { + _final: prev: { html = { head.title.text = "Fediversity"; head.link.stylesheets = prev.html.head.link.stylesheets ++ [ diff --git a/website/content/events/2024-11-zurich-zhf.nix b/website/content/events/2024-11-zurich-zhf.nix index ab0e5672..8f634586 100644 --- a/website/content/events/2024-11-zurich-zhf.nix +++ b/website/content/events/2024-11-zurich-zhf.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, ... }: { collections.events.entry = { link, ... }: diff --git a/website/content/navigation.nix b/website/content/navigation.nix index 2beb657d..5f7481bf 100644 --- a/website/content/navigation.nix +++ b/website/content/navigation.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, ... }: let inherit (config) pages; in diff --git a/website/content/news/2024-11-zurich-zhf.nix b/website/content/news/2024-11-zurich-zhf.nix index 84a8a05d..be331c04 100644 --- a/website/content/news/2024-11-zurich-zhf.nix +++ b/website/content/news/2024-11-zurich-zhf.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: +{ config, ... }: { collections.news.entry = { link, ... }: diff --git a/website/content/news/project-launch.nix b/website/content/news/project-launch.nix index 30a773c7..5d59a853 100644 --- a/website/content/news/project-launch.nix +++ b/website/content/news/project-launch.nix @@ -1,7 +1,8 @@ -{ config, lib, ... }: +{ ... }: + { collections.news.entry = - { link, ... }: + { ... }: { title = "Fediversity project publicly announced"; description = "The Fediversity project has officially been announced"; diff --git a/website/lib.nix b/website/lib.nix index f18adf2e..4ca8d77d 100644 --- a/website/lib.nix +++ b/website/lib.nix @@ -20,7 +20,7 @@ rec { in result' // { - override = new: (template g (x': base') x).override new; + override = new: (template g (_: base') x).override new; }; }; diff --git a/website/presentation/dom.nix b/website/presentation/dom.nix index 0911a7a5..3946758b 100644 --- a/website/presentation/dom.nix +++ b/website/presentation/dom.nix @@ -6,8 +6,8 @@ Similar work from the OCaml ecosystem: https://github.com/ocsigen/tyxml */ { config, lib, ... }: + let - cfg = config; inherit (lib) mkOption types; inherit (types) submodule; @@ -45,7 +45,7 @@ let }; # options with types for all the defined DOM elements - element-types = lib.mapAttrs (name: value: mkOption { type = submodule value; }) elements; + element-types = lib.mapAttrs (_name: value: mkOption { type = submodule value; }) elements; # attrset of categories, where values are module options with the type of the # elements that belong to these categories @@ -69,7 +69,7 @@ let ) ); - global-attrs = lib.mapAttrs (name: value: mkOption value) { + global-attrs = lib.mapAttrs (_name: value: mkOption value) { class = { type = with types; listOf nonEmptyStr; default = [ ]; @@ -105,7 +105,7 @@ let # all possible attributes to `` elements. # since not all of them apply to each `rel=` type, the separate implementations can pick from this collection - link-attrs = lib.mapAttrs (name: value: mkOption value) { + link-attrs = lib.mapAttrs (_name: value: mkOption value) { href = { # TODO: implement https://html.spec.whatwg.org/multipage/semantics.html#the-link-element:attr-link-href-3 # TODO: https://url.spec.whatwg.org/#valid-url-string @@ -130,7 +130,7 @@ let # TODO: not sure where to put these, since so far they apply to multiple elements, # but have the same properties for all of them - attrs = lib.mapAttrs (name: value: mkOption value) { + attrs = lib.mapAttrs (_name: value: mkOption value) { # TODO: investigate: `href` may be coupled with other attributes such as `target` or `hreflang`, this could simplify things href = { # TODO: https://url.spec.whatwg.org/#valid-url-string @@ -415,7 +415,7 @@ let }; base = - { name, ... }: + { ... }: { imports = [ element ]; # TODO: "A base element must have either an href attribute, a target attribute, or both." @@ -427,7 +427,7 @@ let }; link = - { name, ... }: + { ... }: { imports = [ element ]; options = global-attrs // { @@ -472,7 +472,7 @@ let # is implemented separately because it can be used both in `
` and `` # semantically it's a standalone thing but syntactically happens to be subsumed under `` stylesheet = - { config, name, ... }: + { config, ... }: { imports = [ element ]; options = global-attrs // { @@ -808,7 +808,7 @@ let with lib; removeAttrs (filterAttrs ( - name: value: + _name: value: !any ( c: elem c [ diff --git a/website/presentation/templates.nix b/website/presentation/templates.nix index 80422f93..4fcd88b5 100644 --- a/website/presentation/templates.nix +++ b/website/presentation/templates.nix @@ -1,16 +1,10 @@ { config, - options, lib, pkgs, ... }: -let - inherit (lib) - mkOption - types - ; -in + { config.templates.html = { dom = diff --git a/website/structure/article.nix b/website/structure/article.nix index 464e4205..68694a52 100644 --- a/website/structure/article.nix +++ b/website/structure/article.nix @@ -36,7 +36,7 @@ in config.name = with lib; mkDefault (slug config.title); config.outputs.html = lib.mkForce ( (cfg.templates.html.page config).override ( - final: prev: { + _final: prev: { html = { # TODO: make authors always a list head.meta.authors = if lib.isList config.author then config.author else [ config.author ]; diff --git a/website/structure/assets.nix b/website/structure/assets.nix index 3591d348..a30e5f27 100644 --- a/website/structure/assets.nix +++ b/website/structure/assets.nix @@ -34,7 +34,7 @@ in flatten = attrs: mapAttrsToList ( - name: value: + _name: value: # HACK: we somehow have to distinguish a module value from regular attributes. # arbitrary choice: the outputs attribute if value ? outputs then value else mapAttrsToList value diff --git a/website/structure/collections.nix b/website/structure/collections.nix index 8618e9b1..4eb32db6 100644 --- a/website/structure/collections.nix +++ b/website/structure/collections.nix @@ -2,9 +2,9 @@ config, options, lib, - pkgs, ... }: + let inherit (lib) mkOption @@ -12,6 +12,7 @@ let ; cfg = config; in + { options.collections = mkOption { description = '' diff --git a/website/structure/default.nix b/website/structure/default.nix index 5fb1e27f..225a9120 100644 --- a/website/structure/default.nix +++ b/website/structure/default.nix @@ -2,7 +2,6 @@ config, options, lib, - pkgs, ... }: let @@ -10,7 +9,6 @@ let mkOption types ; - cfg = config; in { imports = lib.nixFiles ./.; @@ -74,7 +72,7 @@ in let path = relativePath (head config.locations) (head target.locations); links = mapAttrs ( - type: output: path + optionalString (type != "") ".${type}" + type: _output: path + optionalString (type != "") ".${type}" # ^^^^^^^^^^^^ # convention for raw files ) target.outputs; diff --git a/website/structure/event.nix b/website/structure/event.nix index 36c2f8be..2d729047 100644 --- a/website/structure/event.nix +++ b/website/structure/event.nix @@ -50,7 +50,7 @@ in config.summary = lib.mkDefault config.description; config.outputs.html = lib.mkForce ( (cfg.templates.html.page config).override ( - final: prev: { + _final: prev: { html.body.content = with lib; map (