Use stdenv.mkDerivation instead of runCommand

I'm silly sometimes:
https://discourse.nixos.org/t/using-the-src-attribute-in-runcommand/19329
This commit is contained in:
Tristan Daniël Maat 2022-05-26 04:07:05 +01:00
parent b1bfec14a9
commit 421d930c9a
Signed by: tlater
GPG key ID: 49670FD774E43268

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