From 0b451f07a9628b3fa1900279c7b71ef38c48a4af Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Wed, 8 Feb 2023 12:55:05 +0100 Subject: [PATCH] Allow to use TYPO3 documentation rendering on both systems I use docker on hikari2 and podman on hikari. I now change the bash script based on that. --- home.nix | 2 +- home/packages.nix | 6 ++++-- .../typo3-documentation-rendering/default.nix | 17 +++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/home.nix b/home.nix index 5542481..bb3e5b5 100644 --- a/home.nix +++ b/home.nix @@ -32,7 +32,7 @@ in { stateVersion = "22.05"; packages = import ./home/packages.nix { - inherit pkgs; + inherit pkgs ownLib; }; file = import ./home/files.nix { }; diff --git a/home/packages.nix b/home/packages.nix index 56f120a..4e1905a 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{ pkgs, ownLib }: with pkgs; [ nix @@ -20,7 +20,9 @@ with pkgs; [ (callPackage ./packages/custom/backup { }) (callPackage ./packages/custom/nextcloud-sync/from-local.nix { }) (callPackage ./packages/custom/nextcloud-sync/from-remote.nix { }) - (callPackage ./packages/custom/typo3-documentation-rendering { }) + (callPackage ./packages/custom/typo3-documentation-rendering { + inherit ownLib; + }) (callPackage ./packages/custom/build-phpactor { }) i3blocks st diff --git a/home/packages/custom/typo3-documentation-rendering/default.nix b/home/packages/custom/typo3-documentation-rendering/default.nix index 160b108..599a4b6 100644 --- a/home/packages/custom/typo3-documentation-rendering/default.nix +++ b/home/packages/custom/typo3-documentation-rendering/default.nix @@ -1,22 +1,27 @@ { writeShellApplication, + ownLib, podman }: -writeShellApplication { +let + usePodman = ownLib.onHikari {}; + runner = if usePodman then "podman" else "docker"; + image = (if usePodman then "podman" else "") + "t3docs/render-documentation:latest"; + runtimeInputs = if usePodman then [ podman ] else [ ]; + +in writeShellApplication { name = "custom-typo3-render-documentation"; - runtimeInputs = [ - podman - ]; + inherit runtimeInputs; # See: https://t3docs.github.io/DRC-The-Docker-Rendering-Container/07-To-be-sorted/quickstart.html#build-html-with-plain-docker-commands text = '' - podman \ + ${runner} \ run --rm \ -v "$(pwd)":/PROJECT:ro \ -v "$(pwd)/Documentation-GENERATED-temp":/RESULT \ - docker.io/t3docs/render-documentation:latest \ + ${image} \ makehtml ''; }