Merge pull request 'Weekly update' (#65) from joerg-ci into main
All checks were successful
check / test (push) Successful in 14s
deploy / test (push) Successful in 14s

Reviewed-on: #65
This commit is contained in:
Mic92 2024-04-16 13:12:55 +00:00
commit fdf258c60f
7 changed files with 73 additions and 207 deletions

View File

@ -0,0 +1,11 @@
+++
title = "Lassulus"
description = "Contributor to cLAN."
date = 2021-04-01T08:50:45+00:00
updated = 2021-04-01T08:50:45+00:00
draft = false
+++
Contributor to **clan**.
[@lassulus](https://http://lassul.us/)

View File

@ -0,0 +1,15 @@
+++
title = "Weekly clan status update"
date = 2024-04-16T14:36:16+02:00
draft = false
template = "blog/page.html"
[taxonomies]
authors = ["Lassulus", "Mic92"]
+++
Last week, we added a new documentation hub for clan at [docs.clan.lol](https://docs.clan.lol).
We are still working on improving the installation procedures, so stay tuned.
We now have weekly office hours where people are invited to hangout and ask questions.
They are every Wednesday 15:30 UTC (17:30 CEST) in our [jitsi](https://jitsi.lassul.us/clan.lol).
Otherwise drop by in our [matrix channel](https://matrix.to/#/#clan:lassul.us).

View File

@ -5,7 +5,7 @@
self',
...
}: let
deployScript = pkgs.writeScript "deploy.sh" ''
deployScript = pkgs.writeShellScript "deploy.sh" ''
export PATH="${lib.makeBinPath [
pkgs.coreutils
pkgs.openssh

View File

@ -11,9 +11,6 @@
pkgs.bashInteractive
pkgs.zola
];
inputsFrom = [
inputs'.clan-core.devShells.default
];
};
};
}

View File

@ -1,75 +1,53 @@
{ self, ... }:
{
self,
inputs,
...
}: {
perSystem = {
lib,
pkgs,
self',
inputs',
...
}: let
build = baseUrl: pkgs.runCommand "website" {
buildInputs = [ pkgs.zola ];
} ''
mkdir -p $out
cp -r ${self}/* .
chmod -R u+w .
perSystem =
{
lib,
pkgs,
self',
inputs',
...
}:
let
build =
baseUrl:
pkgs.runCommand "website" { buildInputs = [ pkgs.zola ]; } ''
mkdir -p $out
cp -r ${self}/* .
chmod -R u+w .
substituteInPlace config.toml --replace \
'base_url = "https://clan.lol"' \
'base_url = "${baseUrl}"' \
substituteInPlace config.toml --replace \
'base_url = "https://clan.lol"' \
'base_url = "${baseUrl}"' \
# generates a zola compatible .md from a clan-core/docs/**/*.md
generatePage() {
local sourceFile="$1"
local targetFile="$2"
# generates a zola compatible .md from a clan-core/docs/**/*.md
generatePage() {
local sourceFile="$1"
local targetFile="$2"
# generate title by reading first non-empty line of $file and stripping all '#' symbols
title=$(sed -n '/./{p;q}' "$sourceFile" | sed 's/#*//g')
echo "generating page from clan-core: $title"
# generate title by reading first non-empty line of $file and stripping all '#' symbols
title=$(sed -n '/./{p;q}' "$sourceFile" | sed 's/#*//g')
echo "generating page from clan-core: $title"
# generate header with title, template, weight to make zola happy
echo -e "+++\ntitle = \"$title\"\ntemplate = \"docs/page.html\"\nweight = 0\n+++" > "$targetFile"
# generate header with title, template, weight to make zola happy
echo -e "+++\ntitle = \"$title\"\ntemplate = \"docs/page.html\"\nweight = 0\n+++" > "$targetFile"
# append everything from the file but remove header line starting with '#' and all preceding non-empty lines
tail -n +2 "$sourceFile" >> "$targetFile"
}
# append everything from the file but remove header line starting with '#' and all preceding non-empty lines
tail -n +2 "$sourceFile" >> "$targetFile"
}
# inject pages from clan-core
for dir in ${inputs.clan-core}/docs/*; do
subdir=$(basename $dir)
targetDir="content/docs/$subdir"
mkdir -p "$targetDir"
for file in ${inputs.clan-core}/docs/$subdir/*.md; do
target="content/docs/$subdir/$(basename $file)"
# only generate page if file doesn't start with _
if [[ $(basename $file) == _* ]]; then
cat "$file" > "$target"
continue
fi
generatePage "$file" "$target"
done
done
# inject nixos options docs for clanCore
cp -r ${inputs'.clan-core.packages.docs-zola-pages-core} content/docs/core-options
# inject nixos options docs for clanModules
cp -r ${inputs'.clan-core.packages.docs-zola-pages-modules} content/docs/modules-options
zola build
cp -r public/* public/.* $out
'';
in {
packages.default = self'.packages.website;
packages.website = build "https://clan.lol";
packages.website-localhost = build "http://localhost:1111";
packages.serve = pkgs.writeShellScriptBin "serve-local" ''
echo "serving: ${self'.packages.website-localhost}"
${pkgs.python3}/bin/python -m http.server 1111 \
-d ${self'.packages.website-localhost}
'';
};
zola build
cp -r public/* public/.* $out
'';
in
{
packages.default = self'.packages.website;
packages.website = build "https://clan.lol";
packages.website-localhost = build "http://localhost:1111";
packages.serve = pkgs.writeShellScriptBin "serve-local" ''
echo "serving: ${self'.packages.website-localhost}"
${pkgs.python3}/bin/python -m http.server 1111 \
-d ${self'.packages.website-localhost}
'';
};
}

View File

@ -1,53 +1,5 @@
{
"nodes": {
"clan-core": {
"inputs": {
"disko": "disko",
"flake-parts": [
"flake-parts"
],
"nixos-generators": "nixos-generators",
"nixpkgs": [
"nixpkgs"
],
"sops-nix": "sops-nix",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1712767807,
"narHash": "sha256-u909XpPk4gUvSnwv0KVzKKIduUg9lHeW2s7qMC/rdtI=",
"ref": "refs/heads/main",
"rev": "7dcadd30251ca972c7c290fd200db9e6b72ad567",
"revCount": 2470,
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
},
"original": {
"type": "git",
"url": "https://git.clan.lol/clan/clan-core"
}
},
"disko": {
"inputs": {
"nixpkgs": [
"clan-core",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712356478,
"narHash": "sha256-kTcEtrQIRnexu5lAbLsmUcfR2CrmsACF1s3ZFw1NEVA=",
"owner": "nix-community",
"repo": "disko",
"rev": "0a17298c0d96190ef3be729d594ba202b9c53beb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "disko",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
@ -66,43 +18,6 @@
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1711846064,
"narHash": "sha256-cqfX0QJNEnge3a77VnytM0Q6QZZ0DziFXt6tSCV8ZSc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "90b1a963ff84dc532db92f678296ff2499a60a87",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"clan-core",
"nixpkgs"
]
},
"locked": {
"lastModified": 1712191720,
"narHash": "sha256-xXtSSnVHURHsxLQO30dzCKW5NJVGV/umdQPmFjPFMVA=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "0c15e76bed5432d7775a22e8d22059511f59d23a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1712439257,
@ -139,55 +54,9 @@
},
"root": {
"inputs": {
"clan-core": "clan-core",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"clan-core",
"nixpkgs"
],
"nixpkgs-stable": [
"clan-core"
]
},
"locked": {
"lastModified": 1712458908,
"narHash": "sha256-DMgBS+jNHDg8z3g9GkwqL8xTKXCRQ/0FGsAyrniVonc=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "39191e8e6265b106c9a2ba0cfd3a4dafe98a31c6",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"clan-core",
"nixpkgs"
]
},
"locked": {
"lastModified": 1711963903,
"narHash": "sha256-N3QDhoaX+paWXHbEXZapqd1r95mdshxToGowtjtYkGI=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49dc4a92b02b8e68798abd99184f228243b6e3ac",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
}
},
"root": "root",

View File

@ -4,13 +4,9 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
clan-core.url = "git+https://git.clan.lol/clan/clan-core";
clan-core.inputs.flake-parts.follows = "flake-parts";
clan-core.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs@{ self, flake-parts, clan-core, ... }:
outputs = inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = [ "x86_64-linux" ];
imports = [