shell.nix -> flake.nix
This commit is contained in:
parent
a7ce1604ee
commit
33efbaa3cf
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1729880355,
|
||||
"narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "18536bf04cd71abd345f9579158841376fdd0c5a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
description = "Sinara datasheets";
|
||||
|
||||
inputs.nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable;
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
pkgs = import nixpkgs { system = "x86_64-linux";};
|
||||
|
||||
latex-pkgs = pkgs.texlive.combine {
|
||||
inherit (pkgs.texlive)
|
||||
scheme-small collection-latexextra collection-fontsextra
|
||||
collection-fontsrecommended cbfonts-fd cbfonts palatino textgreek helvetic
|
||||
greek-inputenc maths-symbols mathpazo babel isodate tcolorbox etoolbox
|
||||
pgfplots visualtikz quantikz tikz-feynman circuitikz
|
||||
minted pst-graphicx;
|
||||
};
|
||||
|
||||
python-pkgs = with pkgs.python3Packages; [ pygments ];
|
||||
|
||||
in rec {
|
||||
|
||||
all-pdfs = pkgs.stdenvNoCC.mkDerivation rec {
|
||||
name = "datasheets-pdfs";
|
||||
src = self;
|
||||
buildInputs = [ latex-pkgs ] ++ python-pkgs;
|
||||
# is there a better way to get .aux/.out files correct than to just run latexpdf twice?
|
||||
buildPhase = ''
|
||||
make all
|
||||
make all
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir $out
|
||||
cp build/*.pdf $out
|
||||
'';
|
||||
};
|
||||
|
||||
devShells.x86_64-linux.default = pkgs.mkShell {
|
||||
name = "datasheet-dev-shell";
|
||||
buildInputs = [ latex-pkgs ] ++ python-pkgs;
|
||||
};
|
||||
};
|
||||
}
|
44
shell.nix
44
shell.nix
|
@ -1,44 +0,0 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
|
||||
#pkgs.texlive.combined.scheme-small
|
||||
|
||||
(pkgs.texlive.combine {
|
||||
inherit (pkgs.texlive)
|
||||
scheme-small
|
||||
collection-latexextra
|
||||
collection-fontsextra
|
||||
collection-fontsrecommended
|
||||
palatino
|
||||
textgreek
|
||||
minted
|
||||
tcolorbox
|
||||
etoolbox
|
||||
maths-symbols
|
||||
greek-inputenc
|
||||
babel
|
||||
isodate
|
||||
pst-graphicx
|
||||
visualtikz
|
||||
quantikz
|
||||
tikz-feynman
|
||||
pgfplots
|
||||
cbfonts-fd
|
||||
cbfonts
|
||||
mathpazo
|
||||
helvetic
|
||||
circuitikz ;
|
||||
|
||||
# To compile, call:
|
||||
# $ pdflatex -shell-escape xxx.tex
|
||||
# if missing packages, you can search if the required tex packages is in nixpkgs or not from here
|
||||
# https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/tools/typesetting/tex/texlive/pkgs.nix
|
||||
# if available, just add it to the above list
|
||||
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue