ClanModules: Add docs and api to retrieve metadata

This commit is contained in:
Johannes Kirschbauer
2024-06-25 21:17:01 +02:00
parent e83d428fd6
commit cbb78ca1ae
36 changed files with 342 additions and 161 deletions

View File

@@ -1,10 +1,11 @@
Statically configure borgbackup with sane defaults.
---
This module implements the `borgbackup` backend and implements sane defaults
description = "Statically configure borgbackup with sane defaults."
---
This module implements the `borgbackup` backend and implements sane defaults
for backup management through `borgbackup` for members of the clan.
Configure target machines where the backups should be sent to through `targets`.
Configure machines that should be backuped either through `includeMachines`
which will exclusively add the included machines to be backuped, or through
which will exclusively add the included machines to be backuped, or through
`excludeMachines`, which will add every machine except the excluded machine to the backup.

View File

@@ -1,2 +1,7 @@
Efficient, deduplicating backup program with optional compression and secure encryption.
---
---
description = "Efficient, deduplicating backup program with optional compression and secure encryption."
categories = ["backup"]
---
Long explanations1
Long explanations2
Long explanations3

View File

@@ -27,54 +27,51 @@ let
exit 1
fi
'';
# Each .nix file in the roles directory is a role
# TODO: Helper function to set available roles within module meta.
roles =
if builtins.pathExists ./roles then
lib.pipe ./roles [
builtins.readDir
(lib.filterAttrs (_n: v: v == "regular"))
lib.attrNames
(map (fileName: lib.removeSuffix ".nix" fileName))
]
else
null;
# TODO: make this an interface of every module
# Maybe load from readme.md
metaInfoOption = lib.mkOption {
readOnly = true;
description = ''
Meta is used to retrieve information about this module.
- `availableRoles` is a list of roles that can be assigned via the inventory.
- `category` is used to group services in the clan marketplace.
- `description` is a short description of the service for the clan marketplace.
'';
default = {
description = "Borgbackup is a backup program. Optionally, it supports compression and authenticated encryption.";
availableRoles = roles;
category = "backup";
};
type = lib.types.submodule {
options = {
description = lib.mkOption { type = lib.types.str; };
availableRoles = lib.mkOption { type = lib.types.nullOr (lib.types.listOf lib.types.str); };
category = lib.mkOption {
description = "A category for the service. This is used to group services in the clan ui";
type = lib.types.enum [
"backup"
"network"
];
};
};
};
};
in
# Each .nix file in the roles directory is a role
# TODO: Helper function to set available roles within module meta.
# roles =
# if builtins.pathExists ./roles then
# lib.pipe ./roles [
# builtins.readDir
# (lib.filterAttrs (_n: v: v == "regular"))
# lib.attrNames
# (map (fileName: lib.removeSuffix ".nix" fileName))
# ]
# else
# null;
# TODO: make this an interface of every module
# Maybe load from readme.md
# metaInfoOption = lib.mkOption {
# readOnly = true;
# description = ''
# Meta is used to retrieve information about this module.
# - `availableRoles` is a list of roles that can be assigned via the inventory.
# - `category` is used to group services in the clan marketplace.
# - `description` is a short description of the service for the clan marketplace.
# '';
# default = {
# description = "Borgbackup is a backup program. Optionally, it supports compression and authenticated encryption.";
# availableRoles = roles;
# category = "backup";
# };
# type = lib.types.submodule {
# options = {
# description = lib.mkOption { type = lib.types.str; };
# availableRoles = lib.mkOption { type = lib.types.nullOr (lib.types.listOf lib.types.str); };
# category = lib.mkOption {
# description = "A category for the service. This is used to group services in the clan ui";
# type = lib.types.enum [
# "backup"
# "network"
# ];
# };
# };
# };
# };
{
options.clan.borgbackup.meta = metaInfoOption;
# options.clan.borgbackup.meta = metaInfoOption;
options.clan.borgbackup.destinations = lib.mkOption {
type = lib.types.attrsOf (

View File

@@ -1,4 +1,5 @@
Email-based instant messaging for Desktop.
---
description = "Email-based instant messaging for Desktop."
---
!!! warning "Under construction"

View File

@@ -1,2 +0,0 @@
Automatically format a disk drive on clan installation
---

View File

@@ -1,48 +0,0 @@
{ config, lib, ... }:
{
options.clan.disk-layouts.singleDiskExt4 = {
device = lib.mkOption {
type = lib.types.str;
example = "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNXAGB12345";
};
};
config = {
boot.loader.grub.efiSupport = lib.mkDefault true;
boot.loader.grub.efiInstallAsRemovable = lib.mkDefault true;
disko.devices = {
disk = {
main = {
type = "disk";
device = config.clan.disk-layouts.singleDiskExt4.device;
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
priority = 1;
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
};
}

View File

@@ -1,2 +1,3 @@
A modern IRC server
---
description = "A modern IRC server"
---

View File

@@ -1,9 +1,6 @@
{ ... }:
{
flake.clanModules = {
disk-layouts = {
imports = [ ./disk-layouts ];
};
borgbackup = ./borgbackup;
borgbackup-static = ./borgbackup-static;
deltachat = ./deltachat;

View File

@@ -1,2 +1,3 @@
Automatically backups current machine to local directory.
---
description = "Automatically backups current machine to local directory."
---

View File

@@ -1,2 +1,3 @@
Securely sharing files and messages over a local network without internet connectivity.
---
description = "Securely sharing files and messages over a local network without internet connectivity."
---

View File

@@ -1,2 +1,3 @@
A federated messaging server with end-to-end encryption.
---
description = "A federated messaging server with end-to-end encryption."
---

View File

@@ -1,2 +1,3 @@
A desktop streaming client optimized for remote gaming and synchronized movie viewing.
---
description = "A desktop streaming client optimized for remote gaming and synchronized movie viewing."
---

View File

@@ -1,2 +1,3 @@
A free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance.
---
description = "A free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance."
---

View File

@@ -1,4 +1,5 @@
Automatically generates and configures a password for the root user.
---
description = "Automatically generates and configures a password for the root user."
---
After the system was installed/deployed the following command can be used to display the root-password:

View File

@@ -1,2 +1,3 @@
Enables secure remote access to the machine over ssh
---
description = "Enables secure remote access to the machine over ssh"
---

View File

@@ -1,2 +1,3 @@
Statically configure the host names of machines based on their respective zerotier-ip.
---
description = "Statically configure the host names of machines based on their respective zerotier-ip."
---

View File

@@ -1,2 +1,3 @@
A desktop streaming server optimized for remote gaming and synchronized movie viewing.
---
description = "A desktop streaming server optimized for remote gaming and synchronized movie viewing."
---

View File

@@ -1,2 +1,3 @@
Statically configure syncthing peers through clan
---
description = "Statically configure syncthing peers through clan"
---

View File

@@ -1,4 +1,5 @@
A secure, file synchronization app for devices over networks, offering a private alternative to cloud services.
---
description = "A secure, file synchronization app for devices over networks, offering a private alternative to cloud services."
---
## Usage

View File

@@ -1,2 +1,3 @@
Modern web IRC client
---
description = "Modern web IRC client"
---

View File

@@ -1,2 +1,3 @@
This module sets the `clan.lol` and `nix-community` cache up as a trusted cache.
---
description = "This module sets the `clan.lol` and `nix-community` cache up as a trusted cache."
----

View File

@@ -1,4 +1,5 @@
Automatically generates and configures a password for the specified user account.
---
description = "Automatically generates and configures a password for the specified user account."
---
If setting the option prompt to true, the user will be prompted to type in their desired password.

View File

@@ -1,2 +1,3 @@
A lightweight desktop manager
---
description = "A lightweight desktop manager"
---

View File

@@ -1,4 +1,5 @@
Statically configure the `zerotier` peers of a clan network.
---
description = "Statically configure the `zerotier` peers of a clan network."
---
Statically configure the `zerotier` peers of a clan network.

View File

@@ -1,2 +1,3 @@
Enable ZeroTier VPN over TCP for networks where UDP is blocked.
---
description = "Enable ZeroTier VPN over TCP for networks where UDP is blocked."
---