extended flake, now also package available. fixed slides path. updated versions in code

This commit is contained in:
2025-10-20 18:49:25 +02:00
parent 67c50b4d97
commit 73a087e303
3 changed files with 63 additions and 4 deletions

1
.gitignore vendored
View File

@@ -2,3 +2,4 @@
dist dist
/docs /docs
res/test/docs/slides/revealjs res/test/docs/slides/revealjs
res/test/result

View File

@@ -4,17 +4,42 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
naersk.url = "github:nix-community/naersk";
}; };
outputs = outputs =
{ nixpkgs, systems, ... }: {
nixpkgs,
systems,
naersk,
...
}:
let let
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system}); eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
build_asciidoctor_revealjs = pkgs: pkgs.buildRubyGem {
gemName = "asciidoctor-revealjs";
version = "5.2.0";
source = {
type = "git";
url = "https://rubygems.org/downloads/asciidoctor-revealjs-5.2.0.gem";
sha256 = "sha256-NQSl5+ryyR3jf5YYkxT/sea/lNrZ1kbVyaJMZpG/auI=";
};
};
build_asciidoctor = pkgs: pkgs.buildRubyGem {
gemName = "asciidoctor";
version = "2.0.25";
source = {
type = "git";
url = "https://rubygems.org/downloads/asciidoctor-2.0.25.gem";
sha256 = "sha256-sG/oIrCRDU4l6g9WL+z8eUjpRuIi79lJSEnSfaQmfRk=";
};
};
in in
{ {
devShells = eachSystem (pkgs: { devShells = eachSystem (pkgs: {
default = pkgs.mkShell { default = pkgs.mkShell {
name = "asist"; name = "docki";
buildInputs = with pkgs; [ buildInputs = with pkgs; [
gcc gcc
openssl.dev openssl.dev
@@ -24,12 +49,45 @@
cargo cargo
(ruby.withPackages ( (ruby.withPackages (
p: with p; [ p: with p; [
asciidoctor (build_asciidoctor_revealjs pkgs)
(build_asciidoctor pkgs)
bundler bundler
] ]
)) ))
]; ];
}; };
}); });
packages = eachSystem (
pkgs:
let
naerskLib = pkgs.callPackage naersk { };
runtimeDeps = with pkgs; [
(ruby.withPackages (
p: with p; [
(build_asciidoctor_revealjs pkgs)
(build_asciidoctor pkgs)
bundler
]
))
];
in
{
default = naerskLib.buildPackage {
src = ./.;
buildInputs =[
];
nativeBuildInputs = with pkgs; [
pkg-config
openssl.dev
libiconv
makeWrapper
];
postInstall = ''
wrapProgram $out/bin/docki --prefix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
'';
};
}
);
}; };
} }

View File

@@ -32,7 +32,7 @@ fn asciidoctor_docs(in_path: &str, out_path: &str) -> process::Command {
fn asciidoctor_slides(in_path: &str, out_path: &str) -> process::Command { fn asciidoctor_slides(in_path: &str, out_path: &str) -> process::Command {
let mut command = process::Command::new(format!("asciidoctor-revealjs")); let mut command = process::Command::new(format!("asciidoctor-revealjs"));
let out_dir = parent_path(out_path); let out_dir = parent_path(out_path);
let revealjs_path = path_between(out_dir.to_string(), "./dist/slides/revealjs".to_string()); let revealjs_path = "/slides/revealjs";
command command
.arg(format!("{in_path}")) .arg(format!("{in_path}"))