Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions overview/content-types/project-list-item.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ in
};
__toString = mkOption {
type = with types; functionTo str;
readOnly = true;
default =
self: with lib; ''
<article class="project">
Expand Down
76 changes: 76 additions & 0 deletions overview/content-types/project-list.nix
Original file line number Diff line number Diff line change
@@ -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: ''
<section class="page-width">
<h1>NGIpkgs</h1>

<p>
NGIpkgs is collection of software applications funded by the <a href="https://www.ngi.eu/ngi-projects/ngi-zero/">Next Generation Internet</a> initiative and packaged for <a href="https://nixos.org">NixOS</a>.
</p>

<p>
This service is still <strong>experimental</strong> and under active development.
Don't expect anything specific to work yet:
</p>

<ul>
<li>The package collection is far incomplete</li>
<li>Many packages lack crucial components</li>
<li>There are no instructions for getting started</li>
<li>How software and the corresponding Nix expressions are exposed is subject to change</li>
</ul>

<p>
More information about the project:
</p>

<ul>
<li>
<a href="https://github.com/ngi-nix/ngipkgs">Source code</a>
</li>
<li>
<a href="https://github.com/ngi-nix/summer-of-nix/issues/41">Issue tracker</a>
</li>
<li>
<a href="https://nixos.org/community/teams/ngi/">Nix@NGI team</a>
</li>
</ul>

${concatMapStringsSep "\n" toString (self.projects)}

</section>

<footer>Version: ${self.version}, Last Modified: ${self.lastModified}</footer>
'';
};
};
}
84 changes: 16 additions & 68 deletions overview/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -239,30 +239,6 @@ let
</article>
'';

# 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
{
Expand Down Expand Up @@ -331,50 +307,6 @@ let
'';
};

# The top-level overview for all projects
index = ''
<section class="page-width">
${heading 1 null "NGIpkgs"}

<p>
NGIpkgs is collection of software applications funded by the <a href="https://www.ngi.eu/ngi-projects/ngi-zero/">Next Generation Internet</a> initiative and packaged for <a href="https://nixos.org">NixOS</a>.
</p>

<p>
This service is still <strong>experimental</strong> and under active development.
Don't expect anything specific to work yet:
</p>

<ul>
<li>The package collection is far incomplete</li>
<li>Many packages lack crucial components</li>
<li>There are no instructions for getting started</li>
<li>How software and the corresponding Nix expressions are exposed is subject to change</li>
</ul>

<p>
More information about the project:
</p>

<ul>
<li>
<a href="https://github.com/ngi-nix/ngipkgs">Source code</a>
</li>
<li>
<a href="https://github.com/ngi-nix/summer-of-nix/issues/41">Issue tracker</a>
</li>
<li>
<a href="https://nixos.org/community/teams/ngi/">Nix@NGI team</a>
</li>
</ul>

${render.projectSnippets projects}

</section>

<footer>Version: ${version}, Last Modified: ${lastModified}</footer>
'';

# HTML project pages
projectPages = mapAttrs' (
name: project:
Expand All @@ -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";
Expand Down
Loading