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