From d2beeba6ff035b044ba98e41c3d8fca647c23319 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Fri, 26 Apr 2024 12:04:08 +0200 Subject: [PATCH] clan: init manpage --- pkgs/clan-cli/default.nix | 4 +++ pkgs/clan-cli/flake-module.nix | 1 + pkgs/clan-cli/man/README.md | 7 +++++ pkgs/clan-cli/man/clan.md | 49 ++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 pkgs/clan-cli/man/README.md create mode 100644 pkgs/clan-cli/man/clan.md diff --git a/pkgs/clan-cli/default.nix b/pkgs/clan-cli/default.nix index c24521602..82bfdef6d 100644 --- a/pkgs/clan-cli/default.nix +++ b/pkgs/clan-cli/default.nix @@ -27,6 +27,7 @@ qemu, gnupg, e2fsprogs, + mandown, mypy, clan-core-path, }: @@ -120,6 +121,7 @@ python3.pkgs.buildPythonApplication { nativeBuildInputs = [ setuptools installShellFiles + mandown ]; propagatedBuildInputs = pythonDependencies; @@ -178,6 +180,8 @@ python3.pkgs.buildPythonApplication { <(${argcomplete}/bin/register-python-argcomplete --shell bash clan) installShellCompletion --fish --name clan.fish \ <(${argcomplete}/bin/register-python-argcomplete --shell fish clan) + mandown $src/man/clan.md > ./clan.1 + installManPage ./clan.1 ''; # Clean up after the package to avoid leaking python packages into a devshell diff --git a/pkgs/clan-cli/flake-module.nix b/pkgs/clan-cli/flake-module.nix index ba8cb7f09..256ddee04 100644 --- a/pkgs/clan-cli/flake-module.nix +++ b/pkgs/clan-cli/flake-module.nix @@ -42,6 +42,7 @@ packages = { clan-cli = pkgs.python3.pkgs.callPackage ./default.nix { inherit (inputs) nixpkgs; + mandown = pkgs.mandown; clan-core-path = clanCoreWithVendoredDeps; }; default = self'.packages.clan-cli; diff --git a/pkgs/clan-cli/man/README.md b/pkgs/clan-cli/man/README.md new file mode 100644 index 000000000..c9145df78 --- /dev/null +++ b/pkgs/clan-cli/man/README.md @@ -0,0 +1,7 @@ +# Manpages for the clan cli + +Run: +``` +nix run nixpkgs#manpage [.md] > [manpage.1] +``` +to convert a markdown page into a man page. diff --git a/pkgs/clan-cli/man/clan.md b/pkgs/clan-cli/man/clan.md new file mode 100644 index 000000000..df46c25b0 --- /dev/null +++ b/pkgs/clan-cli/man/clan.md @@ -0,0 +1,49 @@ +## NAME +clan - the clan cli tool + +## SYNOPSIS + +clan [OPTION...] [SUBCOMMAND] + +## DESCRIPTION + +**clan** supports managing and deploying various nixos configurations in a unified coherent way. Through the secrets subcommand secrets for machines can be set and retrieved. + +For more overview please refer to the reference material at docs.clan.lol. + +## OPTIONS + +### -h, --help +Output a help message and exit. + +### --debug +Enable debug logging. + +### --option name value +Nix option to set. + +### --flake=FLAKE +Path to the flake where the clan resides in, can be a remote flake, or local. + +## SUBCOMMANDS + +### clan-backups(1) +Manage backups of clan machines +### clan-flakes(1) +Create a clan flake inside the current directory +### clan-config(1) +Set nixos-configuration +### clan-ssh(1) +SSH to a remote machine +### clan-secrets(1) +Manage secrets +### clan-facts(1) +Manage facts +### clan-machines(1) +Manage machines and their configuration +### clan-vms(1) +Manage virtual machines +### clan-history(1) +Manage history +### clan-flash(1) +Flash machines to usb sticks or into isos