Use stdenv.mkDerivation instead of runCommand

I'm silly sometimes:
https://discourse.nixos.org/t/using-the-src-attribute-in-runcommand/19329
main
Tristan Daniël Maat 2022-05-26 04:07:05 +01:00
parent b1bfec14a9
commit 421d930c9a
Signed by: tlater
GPG Key ID: 49670FD774E43268
1 changed files with 21 additions and 15 deletions

View File

@ -18,25 +18,31 @@
inherit (pkgs.lib.sources) sourceFilesBySuffices; inherit (pkgs.lib.sources) sourceFilesBySuffices;
in { in {
packages = { packages = {
default = default = pkgs.stdenvNoCC.mkDerivation {
pkgs.runCommand "build-cv" { name = "cv";
OSFONTDIR = src = sourceFilesBySuffices self [".tex"];
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
(with pkgs; [ buildInputs = with pkgs; [
roboto texlive.combined.scheme-context
roboto-slab ];
roboto-mono
]); OSFONTDIR =
buildInputs = with pkgs; [ concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
texlive.combined.scheme-context (with pkgs; [
]; roboto
input = sourceFilesBySuffices self [".tex"]; roboto-slab
} '' roboto-mono
cp ${self}/*.tex . ]);
buildPhase = ''
context cv context cv
'';
installPhase = ''
mkdir -p $out mkdir -p $out
cp cv.pdf $out/cv.pdf cp cv.pdf $out/cv.pdf
''; '';
};
}; };
# Legacy nix command support # Legacy nix command support
# TODO(tlater): Remove once 22.05 is adopted # TODO(tlater): Remove once 22.05 is adopted