-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Got the new cheat sheet to build. * Fix inkscape/Fontconfig warnings. * Use filesets to restrict the files in the cheat sheet derivation. * Clean up main tex file. * Extracted paper and color styling from the main tex file. * add .gitignore * Renamed files for consistency. * Cheat sheets now available as the product of a4/letter and color/bw. * Remove unnecessary attributes from callPackage. * Fixed the dollar to pound sign bug. * Patched out pygment formatting on comments and strings. Didn't like the way the fonts looked. * The grayscale/bw name from bw to print. * Change variables named 'set' to 's' so as to not confuse the reader. They might think 'set' is a keyword.
- Loading branch information
Showing
12 changed files
with
1,080 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
### Nix ### | ||
result* |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\usepackage{minted} | ||
\usemintedstyle{default} | ||
|
||
% Define colors | ||
\usepackage{xcolor} | ||
\definecolor{nixdarkblue}{HTML}{5277C3} | ||
\definecolor{codelight}{HTML}{f8f8f8} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
\usepackage{minted} | ||
\usemintedstyle{bw} | ||
|
||
% Define colors | ||
\usepackage{xcolor} | ||
\definecolor{nixdarkblue}{HTML}{747474} | ||
\definecolor{codelight}{HTML}{ffffff} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ pkgs }: | ||
let | ||
tex = pkgs.texlive.combine { | ||
inherit (pkgs.texlive) | ||
scheme-basic | ||
environ | ||
etoolbox | ||
fancyvrb | ||
koma-script | ||
latexmk | ||
listings | ||
listingsutf8 | ||
metafont | ||
hyperref | ||
minted | ||
pdfcol | ||
pgf | ||
svg | ||
tcolorbox | ||
texlive-scripts | ||
tikzfill | ||
transparent | ||
upquote | ||
xcolor | ||
; | ||
}; | ||
|
||
pygments = pkgs.python3Packages.pygments.overridePythonAttrs (old: { | ||
patches = (old.patches or [ ]) ++ [ | ||
# removed bold and italics formatting for comments and strings | ||
./unformatted-comments-strings.patch | ||
]; | ||
}); | ||
|
||
inherit (pkgs) lib; | ||
|
||
combinations = lib.cartesianProduct { | ||
paper = [ | ||
"a4" | ||
"letter" | ||
]; | ||
color = [ | ||
"default" | ||
"print" | ||
]; | ||
}; | ||
in | ||
lib.listToAttrs ( | ||
builtins.map (elem: { | ||
name = "cheat-sheet-${elem.paper}-${elem.color}"; | ||
|
||
value = pkgs.stdenvNoCC.mkDerivation { | ||
name = "nixos-cheat-sheet"; | ||
|
||
src = lib.fileset.toSource { | ||
root = ./.; | ||
fileset = lib.fileset.unions [ | ||
./main.tex | ||
./paper-${elem.paper}.tex | ||
./color-${elem.color}.tex | ||
./nixos.svg | ||
./background.svg | ||
]; | ||
}; | ||
|
||
buildInputs = [ | ||
tex | ||
pkgs.inkscape # for svg images | ||
pygments # for minted code blocks | ||
]; | ||
|
||
# HOME needs to be set to keep inkscape/Fontconfig from complaining | ||
buildPhase = '' | ||
mv paper-${elem.paper}.tex paper.tex | ||
mv color-${elem.color}.tex color.tex | ||
DIR=$(mktemp -d) | ||
env TEXMFHOME="$DIR/.cache" \ | ||
TEXMFVAR="$DIR/.cache/texmf-var" \ | ||
HOME="$DIR/home" \ | ||
latexmk \ | ||
-interaction=nonstopmode \ | ||
-pdf -pdflatex \ | ||
-output-directory="." \ | ||
-shell-escape \ | ||
main.tex | ||
''; | ||
|
||
installPhase = '' | ||
mkdir $out | ||
cp main.pdf $out/cheat-sheet-${elem.paper}-${elem.color}.pdf | ||
''; | ||
}; | ||
}) combinations | ||
) |
Oops, something went wrong.