[docs] setup flake and dir
This commit is contained in:
@@ -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
1
docs/actions/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# Actions
|
||||
@@ -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
32
docs/default.nix
Normal 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
1
docs/triggers/README.md
Normal file
@@ -0,0 +1 @@
|
||||
# Triggers
|
||||
@@ -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: ""
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# Timeout
|
||||
|
||||
Description: Triggers after given duration.
|
||||
Values:
|
||||
- **duration**
|
||||
- Type: int
|
||||
- Descr: duration in seconds
|
||||
- Default: 0
|
||||
|
||||
@@ -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: ""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user