forked from Fediversity/Fediversity
Compare commits
10 commits
7c88d47fb8
...
729b4bb7c3
Author | SHA1 | Date | |
---|---|---|---|
Valentin Gagarin | 729b4bb7c3 | ||
Valentin Gagarin | 87601272ea | ||
Valentin Gagarin | 8fa6c2f6f4 | ||
Valentin Gagarin | 4dfcec607b | ||
Nicolas Jeannerod | 2357bfe6ad | ||
Valentin Gagarin | f67c012dfe | ||
Nicolas Jeannerod | 0e7eef5ea2 | ||
Nicolas Jeannerod | 89d25fa7a5 | ||
Nicolas Jeannerod | 5134bab2d2 | ||
Nicolas Jeannerod | 51c3ec754f |
|
@ -14,3 +14,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: nix build .#checks.x86_64-linux.pre-commit -L
|
- run: nix build .#checks.x86_64-linux.pre-commit -L
|
||||||
|
|
||||||
|
check-website:
|
||||||
|
runs-on: native
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: cd website && nix-build -A tests
|
||||||
|
- run: cd website && nix-build -A build
|
||||||
|
|
|
@ -16,15 +16,19 @@ in
|
||||||
HTTP_ADDR = "127.0.0.1";
|
HTTP_ADDR = "127.0.0.1";
|
||||||
LANDING_PAGE = "explore";
|
LANDING_PAGE = "explore";
|
||||||
};
|
};
|
||||||
mailer = {
|
|
||||||
ENABLED = true;
|
|
||||||
SMTP_ADDR = "mail.protagio.nl";
|
|
||||||
SMTP_PORT = "587";
|
|
||||||
FROM = "git@fediversity.eu";
|
|
||||||
USER = "git@fediversity.eu";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
mailerPasswordFile = "/var/lib/forgejo/data/keys/forgejo-mailpw";
|
|
||||||
|
settings.service.ENABLE_NOTIFY_MAIL = true;
|
||||||
|
settings.mailer = {
|
||||||
|
ENABLED = true;
|
||||||
|
PROTOCOL = "smtp+starttls";
|
||||||
|
SMTP_ADDR = "mail.protagio.nl";
|
||||||
|
SMTP_PORT = "587";
|
||||||
|
FROM = "git@fediversity.eu";
|
||||||
|
USER = "git@fediversity.eu";
|
||||||
|
};
|
||||||
|
secrets.mailer.PASSWD = "/var/lib/forgejo/data/keys/forgejo-mailpw";
|
||||||
|
|
||||||
database = {
|
database = {
|
||||||
type = "mysql";
|
type = "mysql";
|
||||||
socket = "/run/mysqld/mysqld.sock";
|
socket = "/run/mysqld/mysqld.sock";
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
checks = {
|
checks = {
|
||||||
mastodon-garage = import ./tests/mastodon-garage.nix { inherit self pkgs; };
|
mastodon = import ./tests/mastodon.nix { inherit self pkgs; };
|
||||||
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit self pkgs; };
|
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit self pkgs; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
23
website/content/events/2024-11-zurich-zhf.nix
Normal file
23
website/content/events/2024-11-zurich-zhf.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
collections.events.entry = { link, ... }: {
|
||||||
|
title = "NixOS 24.11 ZHF hackathon";
|
||||||
|
name = "zhf-24-11";
|
||||||
|
description = "NixOS 24.11 ZHF hackathon in Zürich";
|
||||||
|
start-date = "2024-11-23";
|
||||||
|
end-date = "2024-11-24";
|
||||||
|
start-time = "10:00";
|
||||||
|
end-time = "17:00";
|
||||||
|
location = "OST Campus Rapperswil";
|
||||||
|
body = ''
|
||||||
|
The biannual [Zürich NixOS ZHF hackathon](https://zurich.nix.ug/) has become somewhat of an institution for maintaining the tradition of preparing the upcoming NixOS release.
|
||||||
|
|
||||||
|
The main goal of the two-day gathering is to bring down the number of build failures on the [continuous integration system Hydra](https://status.nixos.org/) before the release: ZHF stands for *Zero Hydra Failures*.
|
||||||
|
It also presents a great opportunity to learn Nix, squash bugs together, get to know each other, discuss current events, and make plans for the future.
|
||||||
|
|
||||||
|
This is the greatest event in the series so far, with more than 40 participants from all over Europe, including many high-profile contributors and maintainers in the Nix ecosystem.
|
||||||
|
|
||||||
|
[Fediversity engineers attended](${link config.collections.news.by-name.zhf-24-11}) to present prototypes and exchange ideas with other developers.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
22
website/content/news/2024-11-zurich-zhf.nix
Normal file
22
website/content/news/2024-11-zurich-zhf.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
collections.news.entry = { link, ... }: rec {
|
||||||
|
name = "zhf-24-11";
|
||||||
|
title = "NixOS 24.11 release hackathon and workshop";
|
||||||
|
description = "Fediversity engineers met in Zürich at a NixOS 24.11 ZHF hackathon";
|
||||||
|
date = "2024-11-28";
|
||||||
|
author = "Valentin Gagarin";
|
||||||
|
summary = ''
|
||||||
|
Fediversity engineers met in Zürich at a [NixOS 24.11 ZHF hackathon](${link config.collections.events.by-name.zhf-24-11}) to present prototypes and exchange ideas with the Nix community.
|
||||||
|
'';
|
||||||
|
body = ''
|
||||||
|
${summary}
|
||||||
|
|
||||||
|
Robert held a lightning talk on the design of [NixOps4](https://github.com/nixops4/nixops4), which is currently in the prototype stage of development.
|
||||||
|
Before that, Nicolas had already shown an internal demonstration that NixOps4 is capable of deploying multiple NixOS services in the Fediversity test environment.
|
||||||
|
|
||||||
|
In the afternoon, Robert, Valentin, and Koen got together with Eli from [Thymis](https://thymis.io) and Johannes from [Clan](https://clan.lol/) to walk each other through the architecture of their respective systems.
|
||||||
|
This was an extraordinarily fruitful encounter that helped us to identify overlaps and potential for future collaboration!
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
|
@ -61,8 +61,32 @@ rec {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
tests = with pkgs; with lib; runCommand "run-tests" { } ''
|
inherit sources pkgs;
|
||||||
touch $out
|
tests = with pkgs; with lib;
|
||||||
${getExe nix-unit} ${./tests.nix} "$@"
|
let
|
||||||
'';
|
source = fileset.toSource {
|
||||||
|
root = ./.;
|
||||||
|
fileset = fileset.unions [
|
||||||
|
./default.nix
|
||||||
|
./tests.nix
|
||||||
|
./lib.nix
|
||||||
|
./npins
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
runCommand "run-tests"
|
||||||
|
{
|
||||||
|
buildInputs = [ pkgs.nix ];
|
||||||
|
}
|
||||||
|
''
|
||||||
|
export HOME="$(realpath .)"
|
||||||
|
# HACK: nix-unit initialises its own entire Nix, so it needs a store to operate on,
|
||||||
|
# but since we're in a derivation, we can't fetch sources, so copy Nixpkgs manually here.
|
||||||
|
# `''${sources.nixpkgs}` resolves to `<hash>-source`,
|
||||||
|
# adding it verbatim will result in <hash'>-<hash>-source, so rename it first
|
||||||
|
cp -r ${sources.nixpkgs} source
|
||||||
|
nix-store --add --store "$HOME" source
|
||||||
|
${getExe nix-unit} --gc-roots-dir "$HOME" --store "$HOME" ${source}/tests.nix "$@"
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,20 +99,22 @@ rec {
|
||||||
relativePath = path1': path2':
|
relativePath = path1': path2':
|
||||||
let
|
let
|
||||||
inherit (lib.path) subpath;
|
inherit (lib.path) subpath;
|
||||||
inherit (lib) lists;
|
inherit (lib) lists length take drop min max;
|
||||||
|
|
||||||
path1 = subpath.components path1';
|
path1 = subpath.components path1';
|
||||||
prefix1 = with lib; take (length path1 - 1) path1;
|
prefix1 = take (length path1 - 1) path1;
|
||||||
path2 = subpath.components path2';
|
path2 = subpath.components path2';
|
||||||
prefix2 = with lib; take (length path2 - 1) path2;
|
prefix2 = take (length path2 - 1) path2;
|
||||||
|
|
||||||
commonPrefixLength = with lists;
|
commonPrefixLength = with lists;
|
||||||
findFirstIndex (i: i.fst != i.snd)
|
findFirstIndex (i: i.fst != i.snd)
|
||||||
(length prefix1)
|
(min (length prefix1) (length prefix2))
|
||||||
(zipLists prefix1 prefix2);
|
(zipLists prefix1 prefix2);
|
||||||
|
|
||||||
|
depth = max 0 (length prefix1 - commonPrefixLength);
|
||||||
|
|
||||||
relativeComponents = with lists;
|
relativeComponents = with lists;
|
||||||
[ "." ] ++ (replicate (length prefix1 - commonPrefixLength) "..") ++ (drop commonPrefixLength path2);
|
[ "." ] ++ (replicate depth "..") ++ (drop commonPrefixLength path2);
|
||||||
in
|
in
|
||||||
join "/" relativeComponents;
|
join "/" relativeComponents;
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
'')
|
'')
|
||||||
(
|
(
|
||||||
(crossLists (name: file: weight: { inherit name file weight; })
|
(crossLists (name: file: weight: { inherit name file weight; })
|
||||||
[ [ "Signika " ] [ "signika-extended.woff2" "signika.woff2" ] [ 500 700 ] ]
|
[ [ "Signika" ] [ "signika-extended.woff2" "signika.woff2" ] [ 500 700 ] ]
|
||||||
)
|
)
|
||||||
++
|
++
|
||||||
(crossLists (name: file: weight: { inherit name file weight; })
|
(crossLists (name: file: weight: { inherit name file weight; })
|
||||||
[ [ "Heebo " ] [ "heebo-extended.woff2" "heebo.woff2" ] [ 400 600 ] ]
|
[ [ "Heebo" ] [ "heebo-extended.woff2" "heebo.woff2" ] [ 400 600 ] ]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
|
@ -25,7 +25,7 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.name = lib.slug config.title;
|
config.name = with lib; mkDefault (slug config.title);
|
||||||
config.outputs.html = lib.mkForce
|
config.outputs.html = lib.mkForce
|
||||||
((cfg.templates.html.page config).override (final: prev: {
|
((cfg.templates.html.page config).override (final: prev: {
|
||||||
html = {
|
html = {
|
||||||
|
|
|
@ -52,12 +52,17 @@ in
|
||||||
};
|
};
|
||||||
entry = mkOption {
|
entry = mkOption {
|
||||||
description = "An entry in the collection";
|
description = "An entry in the collection";
|
||||||
type = types.collection (types.submodule ({
|
type = with types; collection (submodule ({
|
||||||
imports = [ config.type ];
|
imports = [ config.type ];
|
||||||
_module.args.collection = config;
|
_module.args.collection = config;
|
||||||
process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls;
|
process-locations = ls: with lib; concatMap (l: map (p: "${p}/${l}") config.prefixes) ls;
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
by-name = mkOption {
|
||||||
|
description = "Entries accessible by symbolic name";
|
||||||
|
type = with types; attrsOf attrs;
|
||||||
|
default = with lib; listToAttrs (map (e: { name = e.name; value = e; }) config.entry);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ in
|
||||||
type = with types; str;
|
type = with types; str;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.name = lib.slug config.title;
|
config.name = with lib; mkDefault (slug config.title);
|
||||||
config.summary = lib.mkDefault config.description;
|
config.summary = lib.mkDefault config.description;
|
||||||
config.outputs.html = lib.mkForce
|
config.outputs.html = lib.mkForce
|
||||||
((cfg.templates.html.page config).override (final: prev: {
|
((cfg.templates.html.page config).override (final: prev: {
|
||||||
|
|
|
@ -4,8 +4,18 @@ let
|
||||||
inherit (import ./. { }) lib;
|
inherit (import ./. { }) lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
test-relativePath = {
|
test-relativePath = with lib;
|
||||||
expr = with lib; relativePath "bar" "baz";
|
let
|
||||||
expected = "./baz";
|
testData = [
|
||||||
};
|
{ from = "bar"; to = "baz"; expected = "./baz"; }
|
||||||
|
{ from = "foo/bar"; to = "foo/baz"; expected = "./baz"; }
|
||||||
|
{ from = "foo"; to = "bar/baz"; expected = "./bar/baz"; }
|
||||||
|
{ from = "foo/bar"; to = "baz"; expected = "./../baz"; }
|
||||||
|
{ from = "foo/bar/baz"; to = "foo"; expected = "./../../foo"; }
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
expr = map (case: relativePath case.from case.to) testData;
|
||||||
|
expected = map (case: case.expected) testData;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue