-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
135 lines (114 loc) · 3.95 KB
/
flake.nix
File metadata and controls
135 lines (114 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
pnpm2nix = {
url = "github:nzbr/pnpm2nix-nzbr";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
nixConfig = {
substituters = [ "https://nzbr-nix-cache.s3.eu-central-1.wasabisys.com" ];
trusted-public-keys = [ "nzbr-nix-cache.s3.eu-central-1.wasabisys.com:3BzCCe4Frvvwamd5wibtMAcEKwbVs4y2xKUR2vQ8gIo=" ];
};
outputs = { self, nixpkgs, flake-utils, pnpm2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
pnpm2nix.overlays.default
];
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
gnumake
inkscape
nodePackages.pnpm
nodejs
pandoc
powershell
roboto-slab
stack
tectonic
self.packages.${system}.pandoc-filter-copperflame-latex
self.packages.${system}.texlive-copperflame
];
};
checks = {
nixpkgs-fmt = pkgs.runCommand "check-nixpkgs-fmt" { nativeBuildInputs = [ pkgs.nixpkgs-fmt ]; } ''
nixpkgs-fmt --check ${./.}
touch $out
'';
examples = self.packages.${system}.examples;
};
packages = {
copperflame =
pkgs.callPackage
(
{ mkPnpmPackage, inkscape, roboto-slab, jetbrains-mono, perfect-dos-vga, vips, ... }: mkPnpmPackage {
src = ./.;
copyPnpmStore = true;
installInPlace = true;
buildInputs = [
vips
roboto-slab
];
extraBuildInputs = [
inkscape
];
robotoSlab = roboto-slab;
jetbrainsMono = jetbrains-mono;
perfectDosVga = perfect-dos-vga;
postBuild = ''
sed -E '/%NONIX$/d;s/^(\s*)%NIX /\1/' -i pandoc/partials/copperflame-common.tex
substituteAll pandoc/partials/copperflame-common.tex pandoc/partials/copperflame-common.tex
'';
installPhase = ''
mkdir -p $out
cp -r . $out
'';
}
)
self.packages.${system};
mkCopperflamePandoc = pkgs.callPackage
(
{ stdenv, pandoc, copperflame, pandoc-filter-copperflame-latex, texlive-copperflame, ... }:
attrs: stdenv.mkDerivation (attrs // {
nativeBuildInputs = (attrs.nativeBuildInputs or [ ]) ++ [
pandoc
pandoc-filter-copperflame-latex
(attrs.texlive or texlive-copperflame)
];
inherit copperflame;
})
)
self.packages.${system};
perfect-dos-vga = pkgs.callPackage ./assets/perfect-dos-vga { };
pandoc-filter-copperflame-latex = pkgs.callPackage ./pandoc/pandoc-filter-copperflame-latex { };
texlive-scheme-copperflame = {
inherit (pkgs.texlive)
scheme-small
biber
biblatex
csquotes
datetime2
datetime2-english
datetime2-german
environ
framed
latexmk
polyglossia
tcolorbox
tikzfill
;
};
texlive-copperflame = pkgs.texlive.combine self.packages.${system}.texlive-scheme-copperflame;
copperflame-mono = pkgs.callPackage ./font/default.nix { };
examples = pkgs.callPackage ./examples self.packages.${system};
};
}
);
}