forked from Fediversity/Fediversity
Compare commits
No commits in common. "729b4bb7c3803e8a2a405b70a640d4b5828f7cc4" and "7c88d47fb8e6c167f4deacdd3cd48c227640bd53" have entirely different histories.
729b4bb7c3
...
7c88d47fb8
|
@ -14,10 +14,3 @@ 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,19 +16,15 @@ in
|
||||||
HTTP_ADDR = "127.0.0.1";
|
HTTP_ADDR = "127.0.0.1";
|
||||||
LANDING_PAGE = "explore";
|
LANDING_PAGE = "explore";
|
||||||
};
|
};
|
||||||
};
|
mailer = {
|
||||||
|
|
||||||
settings.service.ENABLE_NOTIFY_MAIL = true;
|
|
||||||
settings.mailer = {
|
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
PROTOCOL = "smtp+starttls";
|
|
||||||
SMTP_ADDR = "mail.protagio.nl";
|
SMTP_ADDR = "mail.protagio.nl";
|
||||||
SMTP_PORT = "587";
|
SMTP_PORT = "587";
|
||||||
FROM = "git@fediversity.eu";
|
FROM = "git@fediversity.eu";
|
||||||
USER = "git@fediversity.eu";
|
USER = "git@fediversity.eu";
|
||||||
};
|
};
|
||||||
secrets.mailer.PASSWD = "/var/lib/forgejo/data/keys/forgejo-mailpw";
|
};
|
||||||
|
mailerPasswordFile = "/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 = import ./tests/mastodon.nix { inherit self pkgs; };
|
mastodon-garage = import ./tests/mastodon-garage.nix { inherit self pkgs; };
|
||||||
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit self pkgs; };
|
pixelfed-garage = import ./tests/pixelfed-garage.nix { inherit self pkgs; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
{ 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.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,22 +0,0 @@
|
||||||
{ 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,32 +61,8 @@ rec {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
inherit sources pkgs;
|
tests = with pkgs; with lib; runCommand "run-tests" { } ''
|
||||||
tests = with pkgs; with lib;
|
|
||||||
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
|
touch $out
|
||||||
|
${getExe nix-unit} ${./tests.nix} "$@"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,22 +99,20 @@ rec {
|
||||||
relativePath = path1': path2':
|
relativePath = path1': path2':
|
||||||
let
|
let
|
||||||
inherit (lib.path) subpath;
|
inherit (lib.path) subpath;
|
||||||
inherit (lib) lists length take drop min max;
|
inherit (lib) lists;
|
||||||
|
|
||||||
path1 = subpath.components path1';
|
path1 = subpath.components path1';
|
||||||
prefix1 = take (length path1 - 1) path1;
|
prefix1 = with lib; take (length path1 - 1) path1;
|
||||||
path2 = subpath.components path2';
|
path2 = subpath.components path2';
|
||||||
prefix2 = take (length path2 - 1) path2;
|
prefix2 = with lib; take (length path2 - 1) path2;
|
||||||
|
|
||||||
commonPrefixLength = with lists;
|
commonPrefixLength = with lists;
|
||||||
findFirstIndex (i: i.fst != i.snd)
|
findFirstIndex (i: i.fst != i.snd)
|
||||||
(min (length prefix1) (length prefix2))
|
(length prefix1)
|
||||||
(zipLists prefix1 prefix2);
|
(zipLists prefix1 prefix2);
|
||||||
|
|
||||||
depth = max 0 (length prefix1 - commonPrefixLength);
|
|
||||||
|
|
||||||
relativeComponents = with lists;
|
relativeComponents = with lists;
|
||||||
[ "." ] ++ (replicate depth "..") ++ (drop commonPrefixLength path2);
|
[ "." ] ++ (replicate (length prefix1 - commonPrefixLength) "..") ++ (drop commonPrefixLength path2);
|
||||||
in
|
in
|
||||||
join "/" relativeComponents;
|
join "/" relativeComponents;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
config.name = with lib; mkDefault (slug config.title);
|
config.name = lib.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,17 +52,12 @@ in
|
||||||
};
|
};
|
||||||
entry = mkOption {
|
entry = mkOption {
|
||||||
description = "An entry in the collection";
|
description = "An entry in the collection";
|
||||||
type = with types; collection (submodule ({
|
type = types.collection (types.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 = with lib; mkDefault (slug config.title);
|
config.name = lib.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,18 +4,8 @@ let
|
||||||
inherit (import ./. { }) lib;
|
inherit (import ./. { }) lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
test-relativePath = with lib;
|
test-relativePath = {
|
||||||
let
|
expr = with lib; relativePath "bar" "baz";
|
||||||
testData = [
|
expected = "./baz";
|
||||||
{ 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