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:
parent
b1bfec14a9
commit
421d930c9a
22
flake.nix
22
flake.nix
|
@ -18,8 +18,14 @@
|
||||||
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";
|
||||||
|
src = sourceFilesBySuffices self [".tex"];
|
||||||
|
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
texlive.combined.scheme-context
|
||||||
|
];
|
||||||
|
|
||||||
OSFONTDIR =
|
OSFONTDIR =
|
||||||
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
|
concatMapStringsSep ";" (pkg: "${pkg}/share/fonts/truetype/")
|
||||||
(with pkgs; [
|
(with pkgs; [
|
||||||
|
@ -27,17 +33,17 @@
|
||||||
roboto-slab
|
roboto-slab
|
||||||
roboto-mono
|
roboto-mono
|
||||||
]);
|
]);
|
||||||
buildInputs = with pkgs; [
|
|
||||||
texlive.combined.scheme-context
|
buildPhase = ''
|
||||||
];
|
|
||||||
input = sourceFilesBySuffices self [".tex"];
|
|
||||||
} ''
|
|
||||||
cp ${self}/*.tex .
|
|
||||||
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
|
||||||
defaultPackage = self.packages.${system}.default;
|
defaultPackage = self.packages.${system}.default;
|
||||||
|
|
Loading…
Reference in a new issue