[docs] setup flake and dir

This commit is contained in:
2023-10-30 22:54:26 +01:00
parent b2e20c5d75
commit 6c750a947f
10 changed files with 150 additions and 75 deletions

View File

@@ -1,7 +1,4 @@
# Summary
- [Introduction](./gokill.md)
- [Triggers](triggers/triggers.md)
- [Timeout](triggers/timeout.md)
- [EthernetDisconnect](triggers/ethernetdisconnect.md)
- [Actions](actions/actions.md)
@GOKILL_OPTIONS@

1
docs/actions/README.md Normal file
View File

@@ -0,0 +1 @@
# Actions

View File

@@ -1,34 +0,0 @@
# Available Actions:
# Print
Description: When triggered prints the configured message to stdout
Values:
- **message**
- Type: string
- Descr: Message that should be printed
- Default: ""
### Timeout
Description: When triggered waits given duration before continuing with next stage
Values:
- **duration**
- Type: int
- Descr: duration in seconds
- Default: 0
# Command
Description: When triggered executes given command
Values:
- **command**
- Type: string
- Descr: command to execute
- Default:
- **args**
- Type: string[]
- Descr: args
- Default:
### Shutdown
Description: When triggered shuts down the machine
Values:

32
docs/default.nix Normal file
View File

@@ -0,0 +1,32 @@
{ pkgs, lib, self, ... }:
with lib;
let
docbuilder = self.packages.x86_64-linux.gokill-docbuilder;
prepareMD = ''
# Copy inputs into the build directory
cp -r --no-preserve=all $inputs/* ./
${docbuilder}/bin/docbuilder --output ./
substituteInPlace ./SUMMARY.md \
--replace "@GOKILL_OPTIONS@" "$(${docbuilder}/bin/docbuilder)"
cat ./SUMMARY.md
'';
in
pkgs.stdenv.mkDerivation {
name = "gokill-docs";
phases = [ "buildPhase" ];
buildInputs = [ pkgs.mdbook ];
inputs = sourceFilesBySuffices ./. [ ".md" ".toml" ];
buildPhase = ''
dest=$out/share/doc
mkdir -p $dest
${prepareMD}
mdbook build
cp -r ./book/* $dest
'';
}

1
docs/triggers/README.md Normal file
View File

@@ -0,0 +1 @@
# Triggers

View File

@@ -1,12 +0,0 @@
# EthernetDisconnect
Description: Triggers if Ethernetcable is disconnected.
Values:
- **waitTillConnected**
- Type: bool
- Descr: Only trigger when device was connected before
- Default: true
- **interfaceName**
- Type: string
- Descr: Name of ethernet adapter
- Default: ""

View File

@@ -1,9 +0,0 @@
# Timeout
Description: Triggers after given duration.
Values:
- **duration**
- Type: int
- Descr: duration in seconds
- Default: 0

View File

@@ -1,16 +0,0 @@
# Available Triggers:
### UsbDisconnect
Description: Triggers when given usb drive is disconnected
Values:
- **waitTillConnected**
- Type: bool
- Descr: Only trigger when device was connected before
- Default: true
- **deviceId**
- Type: string
- Descr: Name of device under /dev/disk/by-id/
- Default: ""