Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package pdfpc-extractor for NixOS users #114

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions book/src/external/pdfpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,28 @@ assemble the correct `.pdfpc` file yourself.
However, this tedious task is better solved by the `polylux2pdfpc` tool.

### Installation
#### From Source
If you have [Rust](https://www.rust-lang.org/tools/install) installed, you can
simply run
```sh
cargo install --git https://github.com/andreasKroepelin/polylux/ --branch release
```

#### Arch Linux
If you use Arch Linux btw, you can also install `polylux2pdfpc` from the AUR
package [polylux2pdfpc-git](https://aur.archlinux.org/packages/polylux2pdfpc-git)
(thank you to Julius Freudenberger!)


#### NixOS
1. Add the flake to your own `flake.nix` as input:
`polylux.url = "github:andreasKroepelin/polylux";`
2. Use the package `inputs.polylux.defaultPackage.${pkgs.system}`, which will build `pdfpc-extractor`

For development purposes, run
- `nix build` to build the package into the `result` directory
- `nix develop` to enter a development shell to run `cargo` commands

### Usage
You invoke `polylux2pdfpc` with the same arguments you would also give to `typst
compile` when you wanted to build your slides.
Expand Down
94 changes: 94 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
description = "A package for creating slides in Typst";

inputs = {
flake-utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};

outputs = {
self,
nixpkgs,
flake-utils,
naersk,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = (import nixpkgs) {
inherit system;
};

naersk' = pkgs.callPackage naersk {};
in rec {
# For `nix build` & `nix run`:
defaultPackage = naersk'.buildPackage {
src = ./pdfpc-extractor;
buildInputs = with pkgs; [];
};

# For `nix develop` (optional, can be skipped):
devShell = pkgs.mkShell rec {
buildInputs = with pkgs; [
cargo
rustc
];
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath buildInputs;
};
}
);
}