Verified Commit ed2b0e73 authored by eon's avatar eon
Browse files

doc: add nextcloud and apps versions

parent 25e0223e
.envrc
.direnv.d
result
nixos.qcow2
docs/build
......@@ -52,9 +52,8 @@ let
markasOverlay = self: super: {
markas-documentation = pkgs.callPackage ./docs {
nixpkgsBranch = nixpkgs.branch;
nixpkgsUrl = "https://github.com/NixOS/nixpkgs/tree/${nixpkgs.rev}";
nixpkgsRev = nixpkgs.rev;
inherit sources;
inherit (self) markas-configuration;
};
markas-vm = (makeSystem vmConfiguration).vm;
markas-configuration = config;
......
......@@ -64,21 +64,27 @@ html_context = {
'source_url_prefix': "https://framagit.org/markas/infrastructure/-/blob/master/docs/",
}
with open('documentation-infra.json', 'r') as f:
data=f.read()
# parse file
obj = json.loads(data)
rst_epilog = """
.. |nixpkgs-revision| replace:: {nixpkgsRev}
.. _nixpkgs-revision: {nixpkgsUrl}
.. |markas-revision| replace:: {markasRev}
.. _markas-revision: https://framagit.org/markas/infrastructure/-/tree/{markasRev}
.. |repository| replace:: https://framagit.org/markas/infrastructure
.. |repository-tree| replace:: https://framagit.org/markas/infrastructure/-/blob/{markasRev}
.. |nixpkgs-branch| replace:: {nixpkgsBranch}
""".format(**obj)
with open('infra.json', 'r') as f:
data = f.read()
infra = json.loads(data)
with open('sources.json', 'r') as f:
data = f.read()
sources = json.loads(data)
_epilog = []
for source, infos in {**sources, **infra}.items():
if "url" in infos:
_epilog.append(".. |%s-url| replace:: %s" % (source, infos['url']))
_epilog.append(".. _%s-url: %s" % (source, infos['url']))
if "rev" in infos:
_epilog.append(".. |%s-revision| replace:: %s" % (source, infos['rev']))
if "rev_url" in infos:
_epilog.append(".. _%s-revision: %s" % (source, infos['rev_url']))
if "branch" in infos:
_epilog.append(".. |%s-branch| replace:: %s" % (source, infos['branch']))
if "version" in infos:
_epilog.append(".. |%s-version| replace:: %s" % (source, infos['version']))
rst_epilog = "\n".join(_epilog)
print(rst_epilog)
{ pkgs, nixpkgsUrl, nixpkgsBranch, nixpkgsRev }:
{ pkgs, sources, markas-configuration }:
let
markasRev = pkgs.lib.commitIdFromGitRepo ./../.git;
json = pkgs.writeTextFile {
name = "documentation-infra.json";
infra = pkgs.writeTextFile {
name = "infra.json";
text = builtins.toJSON {
inherit nixpkgsUrl nixpkgsBranch nixpkgsRev markasRev;
repository = {
url = "https://framagit.org/markas/infrastructure";
rev = markasRev;
rev_url = "https://framagit.org/markas/infrastructure/-/tree/${markasRev}";
};
nextcloud = {
version = markas-configuration.services.nextcloud.package.version;
};
};
};
in
pkgs.stdenv.mkDerivation {
sources = pkgs.writeTextFile {
name = "sources.json";
text = builtins.readFile ../nix/sources.json;
};
in pkgs.stdenv.mkDerivation {
name = "markas-documentation";
src = pkgs.lib.sourceByRegex ./. ["conf.py" "Makefile" ".*rst$" ".*md$"];
buildInputs = [(
pkgs.python3.withPackages(p: [
p.sphinx
p.recommonmark p.sphinx_rtd_theme]))
];
p.recommonmark
p.sphinx_rtd_theme
])
)];
buildPhase = ''
cp ${json} documentation-infra.json
cp ${infra} infra.json
cp ${sources} sources.json
# Workaround for https://github.com/sphinx-doc/sphinx/issues/3451
export SOURCE_DATE_EPOCH=$(${pkgs.coreutils}/bin/date +%s)
SPHINXOPTS=-W make html
......
......@@ -26,16 +26,17 @@ Système d'exploitation
~~~~~~~~~~~~~~~~~~~~~~
Nous utilisons la distribution NixOS en version |nixpkgs-branch|. La révision
NixOS actuellement déployé est |nixpkgs-revision|_. Nous configurons
ensuite cette distribution pour l'adapter à nos besoins. La révision
de la configuration Markas actuellement déployée est
|markas-revision|_.
NixOS actuellement déployé est |nixpkgs-url|_. Nous configurons ensuite cette
distribution pour l'adapter à nos besoins. La révision de la configuration
Markas actuellement déployée est |repository-revision|_.
Version des logiciels
~~~~~~~~~~~~~~~~~~~~~
TODO: donner la version de quelque logiciels clés (kernel, nginx,
nextcloud,...).
* nextcloud: |nextcloud-version|
* nextcloud-registration: |nextcloud-registration-version|
* nextcloud-calendar: |nextcloud-calendar-version|
* nextcloud-contacts: |nextcloud-contacts-version|
Liste des membres ayant des droits d'administreurs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -90,7 +91,7 @@ Mode de déploiement
~~~~~~~~~~~~~~~~~~~
La configuration du serveur est décrite dans le dépôt
|repository|. Toutes les minutes, un service systemd récupère le
|repository-url|_. Toutes les minutes, un service systemd récupère le
contenu de ce dépôt sur le serveur et applique les potentiels
changements.
......
{"nixpkgsBranch":"the-current-branch",
"nixpkgsUrl":"https://github.com/NixOS/nixpkgs/tree/the-current-commit",
"nixpkgsRev": "the-current-revision",
"markasRev": "the-current-revision"
}
{
"repository": {
"url": "https://framagit.org/markas/infrastructure",
"rev": "the-current-revision",
"rev_url": "https://framagit.org/markas/infrastructure"
},
"nextcloud": {
"version": "the-current-version"
}
}
../nix/sources.json
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment