diff --git a/crude/.gitignore b/crude/.gitignore index 726d2d6..c0e0d42 100644 --- a/crude/.gitignore +++ b/crude/.gitignore @@ -1,2 +1,3 @@ result .direnv +.pdf diff --git a/crude/flake.nix b/crude/flake.nix index ee317bd..d8777f0 100644 --- a/crude/flake.nix +++ b/crude/flake.nix @@ -16,13 +16,41 @@ pkgs = import nixpkgs { inherit system; }; in { + packages = { - default = throw "put derivation information here"; + default = pkgs.stdenvNoCC.mkDerivation { + pname = "test"; + version = "0.1"; + src = ./src; + nativeBuildInputs = with pkgs; [ + tinymist + typst + fira + orbitron + ]; + + buildPhase = '' + typst compile main.typ \ + --font-path="${pkgs.orbitron}/share/fonts:${pkgs.fira}/share/fonts" \ + --input nixPath=$out \ + --input author=Bob \ + --input title=fiets \ + "''${pname}.pdf" + ''; + + installPhase = '' + mkdir -p $out + cp *.pdf $out/ + ''; + }; }; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ - (throw "put packages here") + tinymist + typst + fira + orbitron ]; }; diff --git a/crude/src/main.typ b/crude/src/main.typ new file mode 100644 index 0000000..5c2f93b --- /dev/null +++ b/crude/src/main.typ @@ -0,0 +1,3 @@ +#import "template.typ": crude + +#show: crude diff --git a/crude/template.typ b/crude/src/template.typ similarity index 97% rename from crude/template.typ rename to crude/src/template.typ index 20ee568..b422fe8 100644 --- a/crude/template.typ +++ b/crude/src/template.typ @@ -11,8 +11,6 @@ }, sigil: if sys.inputs.keys().contains("sigil") { sys.inputs.sigil - } else { - "sigil.svg" }, font: ( text: { @@ -140,9 +138,11 @@ ) - figure( - image(sigil, width: 100%), - ) + if sigil != none { + figure( + image(sigil, width: 100%), + ) + } align(center)[ #set text(font: font.decoration, 36pt, weight: "black")