diff --git a/overview/content-types/project-list-item.nix b/overview/content-types/project-list-item.nix index ed6ac91fb..9b59a51e4 100644 --- a/overview/content-types/project-list-item.nix +++ b/overview/content-types/project-list-item.nix @@ -41,6 +41,7 @@ in }; __toString = mkOption { type = with types; functionTo str; + readOnly = true; default = self: with lib; ''
diff --git a/overview/content-types/project-list.nix b/overview/content-types/project-list.nix new file mode 100644 index 000000000..55eb7bc6e --- /dev/null +++ b/overview/content-types/project-list.nix @@ -0,0 +1,76 @@ +# The top-level overview for all projects +{ config, lib, ... }: +let + inherit (lib) + mkOption + types + concatMapStringsSep + attrValues + ; + inherit (types) + listOf + nullOr + functionTo + str + submodule + ; +in +{ + options = { + projects = mkOption { + type = listOf (submodule ./project-list-item.nix); + }; + version = mkOption { + type = nullOr str; + }; + lastModified = mkOption { + type = nullOr str; + }; + __toString = mkOption { + type = functionTo str; + readOnly = true; + default = self: '' +
+

NGIpkgs

+ +

+ NGIpkgs is collection of software applications funded by the Next Generation Internet initiative and packaged for NixOS. +

+ +

+ This service is still experimental and under active development. + Don't expect anything specific to work yet: +

+ + + +

+ More information about the project: +

+ + + + ${concatMapStringsSep "\n" toString (self.projects)} + +
+ + + ''; + }; + }; +} diff --git a/overview/default.nix b/overview/default.nix index a9d857219..271b47de7 100644 --- a/overview/default.nix +++ b/overview/default.nix @@ -239,30 +239,6 @@ let
''; - # The snippets for each project that are rendered on https://ngi.nixos.org - projectSnippets = - projects: - eval { - options = { - projects = mkOption { - type = with types; attrsOf (submodule ./content-types/project-list-item.nix); - default = lib.mapAttrs (name: project: { - inherit name; - description = project.metadata.summary or null; - deliverables = { - service = project.nixos.modules ? services && project.nixos.modules.services != { }; - program = project.nixos.modules ? programs && project.nixos.modules.programs != { }; - demo = project.nixos.examples ? demo; - }; - }) projects; - }; - __toString = mkOption { - type = with types; functionTo str; - default = self: with lib; concatMapStringsSep "\n" toString (attrValues self.projects); - }; - }; - }; - demoGlue.one = exampleText: '' # default.nix { @@ -331,50 +307,6 @@ let ''; }; - # The top-level overview for all projects - index = '' -
- ${heading 1 null "NGIpkgs"} - -

- NGIpkgs is collection of software applications funded by the Next Generation Internet initiative and packaged for NixOS. -

- -

- This service is still experimental and under active development. - Don't expect anything specific to work yet: -

- - - -

- More information about the project: -

- - - - ${render.projectSnippets projects} - -
- - - ''; - # HTML project pages projectPages = mapAttrs' ( name: project: @@ -390,6 +322,22 @@ let } ) projects; + index = eval { + imports = [ ./content-types/project-list.nix ]; + + projects = lib.mapAttrsToList (name: project: { + inherit name; + description = project.metadata.summary or null; + deliverables = { + service = project.nixos.modules ? services && project.nixos.modules.services != { }; + program = project.nixos.modules ? programs && project.nixos.modules.programs != { }; + demo = project.nixos.examples ? demo; + }; + }) projects; + inherit version; + inherit lastModified; + }; + # The summary page at the overview root indexPage = { pagetitle = "NGIpkgs software repository";