diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..2cfcd4d --- /dev/null +++ b/build.sh @@ -0,0 +1,14 @@ +source $stdenv/setup + +# Compile Sass sources and get resume file +mkdir build && cd build +mkdir css && sassc $src/scss/style.scss css/style.css +cp $src/resume.html resume.html + +mkdir $out + +# Save generated files +cp resume.html $out +mkdir $out/css && cp ./css/style.css $out/css + +chromium --disable-gpu --headless --print-to-pdf="$out/Resume-Danila-Fedorin.pdf" file://$(pwd)/resume.html diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ace8121 --- /dev/null +++ b/flake.nix @@ -0,0 +1,15 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + { + defaultPackage = import ./package.nix { + pkgs = import nixpkgs { inherit system; }; + }; + } + ); +} diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..80b0961 --- /dev/null +++ b/package.nix @@ -0,0 +1,10 @@ +{ pkgs, sass ? pkgs.sassc, chromium ? pkgs.ungoogled-chromium }: +pkgs.stdenv.mkDerivation { + name = "daniel-resume"; + version = "0.1"; + builder = ./build.sh; + buildInputs = [ sass chromium ]; + src = ./.; + + FONTCONFIG_FILE = pkgs.makeFontsConf { fontDirectories = []; }; +}