forked from Fediversity/fediversity.eu
Compare commits
3 commits
e0bb83610f
...
bdc7fb0c34
Author | SHA1 | Date | |
---|---|---|---|
bdc7fb0c34 | |||
7800a70df5 | |||
7c464be268 |
|
@ -9,9 +9,6 @@ in
|
|||
|
||||
pages.index = { link, ... }: {
|
||||
title = "Fediversity";
|
||||
locations = [
|
||||
"index.html"
|
||||
];
|
||||
description = "Fediversity web site";
|
||||
summary = ''
|
||||
This web site hosts up-to-date information about the the NGI Zero Fediversity project.
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
summary = ''
|
||||
The Fediversity Project is a comprehensive effort to bring easy-to-use, hosted cloud services that have service portability and personal freedom at their core to everyone.
|
||||
'';
|
||||
locations = [
|
||||
"fediversity.html"
|
||||
];
|
||||
body = ''
|
||||
Fediversity is a comprehensive effort to bring easy-to-use, hosted cloud services with service portability and personal freedom at their core to everyone. It wants to provide everyone with high-quality, secure IT systems for everyday use. Without tracking, without exploitation, in a way that runs everywhere and scales effortlessly. Fediversity is based on NixOS, a disruptive Linux distribution with a unique approach to package and configuration management. Built on top of the Nix package manager, NixOS is completely declarative, makes upgrading systems reliable, and has many other advantages. Because it is reproducible, it is ideally suited for complex deployment scenario’s where consistent behaviour, stability and configurability matter.
|
||||
|
||||
|
|
|
@ -2,9 +2,6 @@
|
|||
{
|
||||
pages.grants = {
|
||||
title = "Grants";
|
||||
locations = [
|
||||
"grants.html"
|
||||
];
|
||||
description = "How to apply for grants as part of the Fediversity Project";
|
||||
summary = ''
|
||||
Fediversity will award 450 000 euro in small to medium-size R&D grants towards solutions that bring the next generation of social networks closer. We are seeking project proposals between 5.000 and 50.000 euro’s — which should get you on your way.
|
||||
|
|
|
@ -18,9 +18,7 @@ in
|
|||
in
|
||||
map
|
||||
(page: {
|
||||
page = lib.recursiveUpdate page {
|
||||
title = "${page.date}: ${page.title}";
|
||||
};
|
||||
page = lib.recursiveUpdate page { title = "${page.date}: ${page.title}"; };
|
||||
})
|
||||
(lib.take 3 sorted);
|
||||
}
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
description = "Report from the NORDUnet Conference 2024";
|
||||
date = "2024-09-17";
|
||||
author = "Laurens Hof";
|
||||
locations = [
|
||||
"nordunet-conference-2024.html"
|
||||
];
|
||||
body = ''
|
||||
Fediversity was represented in Bergen at the Nordunet Conference for 2024, with both the Internet Discourse Foundation and Nordunet themselves being present. This was a great opportunity for the different organisations in the consortium to meet with each other and exchange ideas.
|
||||
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
{ ... }:
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
collections.news.entry = {
|
||||
collections.news.entry = { link, ... }: {
|
||||
title = "Fediversity project publicly announced";
|
||||
description = "The Fediversity project has officially been announced";
|
||||
date = "2024-01-01";
|
||||
author = "Laurens Hof";
|
||||
locations = [
|
||||
"fediversity-announced.html"
|
||||
];
|
||||
body = ''
|
||||
The Consortium behind the Fediversity project announces that the project has officially been started. NLnet, Tweag, NorduNet and the Open Internet Discourse Foundation are working together to build a new service for cloud hosters.
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
description = "Report from the PublicSpaces Conference 2024 - 'Take Back the Internet'";
|
||||
date = "2024-07-30";
|
||||
author = "Laurens Hof";
|
||||
locations = [
|
||||
"publicspaces-conference-2024.html"
|
||||
];
|
||||
body = ''
|
||||
PublicSpaces and Waag Futurelabs recently held their yearly conference in Amsterdam, titled 'Taking Back the Internet'. PublicSpaces is a network of public organisations fighting for an internet based on public values. The Fediversity Project attended, to share ideas, and learn more about how people and organisations think about an ethical internet. If you are interested, you can view all sessions [here](https://conference.publicspaces.net/en/archive/pubconf2024) (hosted on PeerTube!).
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
description = "Fediversity tech session - NixOS and Kubernetes";
|
||||
date = "2024-08-05";
|
||||
author = "Laurens Hof";
|
||||
locations = [
|
||||
"tech-session.html"
|
||||
];
|
||||
body = ''
|
||||
Recently Fediversity hosted a tech session on NixOS and Kubernetes. We invited people within the community to discuss some design considerations of the Fediversity project with us.
|
||||
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
description = "Announcing our new website for the Fediversity project";
|
||||
date = "2024-05-15";
|
||||
author = "Laurens Hof";
|
||||
locations = [
|
||||
"website-launch.html"
|
||||
];
|
||||
body = ''
|
||||
We are pleased to introduce the launch of our new website dedicated to the Fediversity project.
|
||||
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
summary = ''
|
||||
NLnet supports organisations and people who contribute to an open internet for all. They fund projects that help fix the internet through open hardware, open software, open standards, open science and open data.
|
||||
'';
|
||||
locations = [
|
||||
"nlnet.html"
|
||||
];
|
||||
body = ''
|
||||
The NLnet Foundation supports organisations and people who contribute to an open internet for all. NLnet funds projects that help fix the internet through open hardware, open software, open standards, open science and open data. After its historical contribution to the early internet in Europe in the 1980’s, NLnet has been financially supporting the open internet since 1997.
|
||||
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
description = ''
|
||||
NORDUnet is a collaboration of the National Research and Education Networks (NREN) of the Nordic countries.
|
||||
'';
|
||||
locations = [
|
||||
"nordunet.html"
|
||||
];
|
||||
body = ''
|
||||
NORDUnet connects universities and research institutions across Denmark, Finland, Iceland, Norway, and Sweden. It enables collaboration, data sharing, and access to online resources for academic and research purposes.
|
||||
|
||||
|
|
|
@ -7,9 +7,6 @@
|
|||
description = ''
|
||||
The Open Internet Discourse Foundation (OID) is founded on the belief that everyone deserves the freedom to express themselves and use the internet without constraints, and is committed to help build a better internet where individuals can truly be who they are.
|
||||
'';
|
||||
locations = [
|
||||
"oid.html"
|
||||
];
|
||||
body = ''
|
||||
The three pillars that are at the core of the OID Foundation:
|
||||
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
description = ''
|
||||
Tweag is the open source program office (OSPO) of Modus Create, and has extensive experience working with Nix, and many people at the forefront of the Nix community are Tweagers
|
||||
'';
|
||||
locations = [
|
||||
"tweag.html"
|
||||
];
|
||||
body = ''
|
||||
Tweag is the open source program office (OSPO) of Modus Create, a global digital consulting firm that helps enterprises build competitive advantage through digital innovation. Tweagers are leading contributors to several open source projects — from functional programming languages to cross-platform frameworks. Tweag has extensive experience working with Nix, and many people at the forefront of the Nix community are Tweagers.
|
||||
'';
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
---
|
||||
title: "Consortium"
|
||||
# meta title
|
||||
meta_title: "Consortium"
|
||||
# meta description
|
||||
description: "The organisations behind the Fediversity Project"
|
||||
# save as draft
|
||||
draft: false
|
||||
---
|
||||
|
||||
Information about the project. TODO.
|
17
lib.nix
17
lib.nix
|
@ -52,16 +52,17 @@ rec {
|
|||
inherit (lib) lists;
|
||||
|
||||
path1 = subpath.components path1';
|
||||
prefix1 = with lib; take (length path1 - 1) path1;
|
||||
path2 = subpath.components path2';
|
||||
prefix2 = with lib; take (length path1 - 1) path2;
|
||||
|
||||
commonPrefixLength = with lists;
|
||||
findFirstIndex (i: i.fst != i.snd)
|
||||
{ fst = null; snd = null; }
|
||||
(zipLists path1 path2);
|
||||
(length prefix1)
|
||||
(zipLists prefix1 prefix2);
|
||||
|
||||
relativeComponents = with lists;
|
||||
[ "." ] ++ (replicate (length path1 - commonPrefixLength - 1) "..") ++
|
||||
(drop commonPrefixLength path2);
|
||||
[ "." ] ++ (replicate (length prefix1 - commonPrefixLength) "..") ++ (drop commonPrefixLength path2);
|
||||
in
|
||||
join "/" relativeComponents;
|
||||
|
||||
|
@ -98,13 +99,7 @@ rec {
|
|||
merge = loc: defs:
|
||||
map
|
||||
(def:
|
||||
let
|
||||
merged = lib.mergeDefinitions
|
||||
(loc ++ [ "[definition ${toString def.file}]" ])
|
||||
elemType
|
||||
[{ inherit (def) file; value = def.value; }];
|
||||
in
|
||||
if merged ? mergedValue then merged.mergedValue else merged.value
|
||||
elemType.merge (loc ++ [ "[definition ${toString def.file}]" ]) [{ inherit (def) file; value = def.value; }]
|
||||
)
|
||||
defs;
|
||||
check = elemType.check;
|
||||
|
|
|
@ -41,7 +41,7 @@ in
|
|||
<link rel="canonical" href="${page.outPath}" />
|
||||
'';
|
||||
body = ''
|
||||
${templates.nav { menu = { menu = config.menus.main; }; }}
|
||||
${templates.nav { inherit page; menu = { menu = config.menus.main; }; }}
|
||||
${builtins.readFile (commonmark page.name page.body)}
|
||||
'';
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ in
|
|||
}
|
||||
'';
|
||||
body = ''
|
||||
${templates.nav { menu = { menu = config.menus.main; }; }}
|
||||
${templates.nav { inherit page; menu = { menu = config.menus.main; }; }}
|
||||
${builtins.readFile (commonmark page.name page.body)}
|
||||
'';
|
||||
});
|
||||
|
@ -76,20 +76,14 @@ in
|
|||
let
|
||||
pages = lib.attrValues config.pages;
|
||||
collections = with lib; concatMap (collection: collection.entry) (attrValues config.collections);
|
||||
collections' = with lib; map
|
||||
(
|
||||
entry: recursiveUpdate entry {
|
||||
locations = map (l: "${entry.collection.name}/${l}") entry.locations;
|
||||
}
|
||||
)
|
||||
collections;
|
||||
in
|
||||
with lib; foldl
|
||||
(acc: elem: acc // {
|
||||
"${head elem.locations}" = builtins.toFile "${elem.name}.html" elem.outputs.html;
|
||||
# TODO: we may or may not want to enforce the mapping of file types to output file name suffixes
|
||||
"${head elem.locations}.html" = builtins.toFile "${elem.name}.html" elem.outputs.html;
|
||||
})
|
||||
{ }
|
||||
(pages ++ collections');
|
||||
(pages ++ collections);
|
||||
|
||||
options.build = mkOption {
|
||||
description = ''
|
||||
|
|
|
@ -14,16 +14,16 @@ rec {
|
|||
<body>
|
||||
</html>
|
||||
'';
|
||||
nav = { menu }:
|
||||
nav = { page, menu }:
|
||||
let
|
||||
render-item = item:
|
||||
if item ? menu then
|
||||
''
|
||||
<li>${item.menu.label}
|
||||
${lib.indent " " (nav { menu = item; })}
|
||||
${lib.indent " " (nav { inherit page; menu = item; })}
|
||||
''
|
||||
else
|
||||
if item ? page then ''<li><a href="${item.page}">${item.page.title}</a></li>''
|
||||
if item ? page then ''<li><a href="${page.link item.page}">${item.page.title}</a></li>''
|
||||
else ''<li><a href="${item.link.url}">${item.link.label}</a></li>''
|
||||
;
|
||||
in
|
||||
|
|
|
@ -27,9 +27,6 @@ in
|
|||
};
|
||||
};
|
||||
config.name = lib.slug config.title;
|
||||
# TODO: this should be covered by the TBD `link` function instead,
|
||||
# taking a historical list of collection names into account
|
||||
config.outPath = "${collection.name}/${lib.head config.locations}";
|
||||
config.outputs.html = lib.mkForce (cfg.templates.html.article cfg config);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -52,11 +52,27 @@ in
|
|||
type = types.str;
|
||||
default = name;
|
||||
};
|
||||
entry = mkOption {
|
||||
prefixes = mkOption {
|
||||
description = ''
|
||||
List of historic output locations for files in the collection
|
||||
|
||||
The first element is the canonical location.
|
||||
All other elements are used to create redirects to the canonical location.
|
||||
|
||||
The default entry is the symbolic name of the collection.
|
||||
When changing the symbolic name, append the old one to your custom list and use `lib.mkForce` to make sure the default element will be overridden.
|
||||
'';
|
||||
type = with types; nonEmptyListOf str;
|
||||
example = [ "." ];
|
||||
default = [ config.name ];
|
||||
};
|
||||
entry = mkOption
|
||||
{
|
||||
description = "An entry in the collection";
|
||||
type = types.collection (types.submodule ({
|
||||
_module.args.collection = config;
|
||||
imports = [ config.type ];
|
||||
_module.args.collection = config;
|
||||
process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls;
|
||||
}));
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@ let
|
|||
;
|
||||
in
|
||||
{
|
||||
content-types.document = { name, config, link, ... }: {
|
||||
content-types.document = { name, config, options, link, ... }: {
|
||||
config._module.args.link = config.link;
|
||||
options = {
|
||||
name = mkOption {
|
||||
|
@ -17,20 +17,36 @@ in
|
|||
# TODO: reconsider using `page.outPath` and what to put into `locations`.
|
||||
# maybe we can avoid having ".html" suffixes there.
|
||||
# since templates can output multiple files, `html` is merely one of many things we *could* produce.
|
||||
# TODO: make `apply` configurable so one can programmatically modify locations
|
||||
locations = mkOption {
|
||||
description = ''
|
||||
List of historic output locations for the resulting file
|
||||
|
||||
Elements are relative paths to output files, without suffix.
|
||||
The suffix will be added depending on output file type.
|
||||
|
||||
The first element is the canonical location.
|
||||
All other elements are used to create redirects to the canonical location.
|
||||
|
||||
The default entry is the symbolic name of the document.
|
||||
When changing the symbolic name, append the old one to your custom list and use `lib.mkForce` to make sure the default element will be overridden.
|
||||
'';
|
||||
type = with types; nonEmptyListOf str;
|
||||
apply = config.process-locations;
|
||||
example = [ "about/overview" "index" ];
|
||||
default = [ config.name ];
|
||||
};
|
||||
process-locations = mkOption {
|
||||
description = "Function to post-process the output locations of contained document";
|
||||
type = types.functionTo options.locations.type;
|
||||
default = lib.id;
|
||||
};
|
||||
link = mkOption {
|
||||
description = "Helper function for transparent linking to other pages";
|
||||
type = with types; functionTo str;
|
||||
default = target: with lib; relativePath (head config.locations) (head target.locations);
|
||||
# TODO: we may want links to other representations,
|
||||
# and currently the mapping of output types to output file
|
||||
# names is soft.
|
||||
default = target: with lib; "${relativePath config.outPath target.outPath}.html";
|
||||
};
|
||||
# TODO: may not need it when using `link`; could repurpose it to render the default template
|
||||
outPath = mkOption {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, ... }:
|
||||
{ config, options, lib, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
|
@ -7,7 +7,12 @@ let
|
|||
cfg = config;
|
||||
subtype = baseModule: types.submodule [
|
||||
baseModule
|
||||
{ _module.freeformType = types.attrs; }
|
||||
{
|
||||
_module.freeformType = types.attrs;
|
||||
# XXX: this is supposed to be used with a finished value,
|
||||
# and we don't want to process locations again.
|
||||
process-locations = lib.mkForce lib.id;
|
||||
}
|
||||
];
|
||||
in
|
||||
{
|
||||
|
|
Reference in a new issue