diff --git a/flake.nix b/flake.nix index 230e7fc..04911b5 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ pdf = pkgs.stdenv.mkDerivation { name = "F-klubbens sangbog continuous"; src = ./.; + nativeBuildInputs = deps; installPhase = '' ${pkgs.gnumake}/bin/make pdf mv main_book.pdf $out @@ -32,11 +33,20 @@ devShells.${system}.default = pkgs.mkShell { packages = deps; }; + packages.${system} = { default = booklet; pdf = pdf; #for ubuntu wsl - defaultPackage.${system} = booklet; + build = pkgs.writeScriptBin "build-sangbog" '' + if [[ "$1" == "" ]]; then + target="booklet" + else + target="$1" + fi + ${pkgs.gnumake}/bin/make $target + + ''; }; }; diff --git a/wsl.sh b/wsl.sh deleted file mode 100644 index 3c8bf0e..0000000 --- a/wsl.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# if nix on wsl, undo some symlinking -nix build $@ - -cp -L result main.pdf - -echo "The PDF has been built using nix on wsl, to be accessible from windows the pdf has been moved here as well as `main.pdf`"