initial commit

This commit is contained in:
Tim Schubert 2022-11-01 13:50:29 +01:00
commit f1b9082f4e
Signed by: dadada
GPG key ID: EEB8D1CE62C4DFEA
15 changed files with 498 additions and 0 deletions

2
template/.envrc Normal file
View file

@ -0,0 +1,2 @@
watch_file devshell.toml
use flake

22
template/.gitignore vendored Normal file
View file

@ -0,0 +1,22 @@
*.swp
.direnv/
*.aux
*.fdb_latexmk
*.fls
*.log
*.bbl
*.bcf
*.blg
*.out
*.run.xml
*.dvi
*.ps
*.glsdefs
*.lof
*.toc
*.bak
*.nav
*.snm
*.vrb
*.pyg
thesis.pdf

15
template/Makefile Normal file
View file

@ -0,0 +1,15 @@
.PHONY: thesis.pdf all watch clean
all: thesis.pdf
clean:
latexmk -C thesis.tex
thesis.pdf: thesis.tex
latexmk -interaction=batchmode -pdf thesis.tex
watch:
while true; do \
inotifywait -qr -e modify -e create -e delete -e move *tex; \
$(MAKE); \
done

View file

@ -0,0 +1,8 @@
@article{lisa,
author = {Lisa Mueller},
title = {Example: Why this article does not exist},
journal = {Super popular journal},
volume = {3},
number = {1},
year = {2020}
}

46
template/devshell.toml Normal file
View file

@ -0,0 +1,46 @@
imports = [ "git/hooks" ]
packages = [ "texliveWithTubslatex", "inotify-tools" ]
[devshell]
name = "thesis"
[[commands]]
name = "format"
command = "nix fmt"
help = "Formats the nix files"
category = "development"
[[commands]]
name = "update"
command = "nix flake update --commit-lock-file"
help = "Updates the dependencies"
category = "development"
[[commands]]
name = "check"
command = "nix flake check"
help = "Checks if this flake is valid"
category = "development"
[[commands]]
name = "build-thesis"
command = "make thesis.pdf"
category = "outputs"
help = "Builds the thesis"
[[commands]]
name = "clean"
command = "make clean"
category = "outputs"
help = "Cleans the build directory"
[git.hooks]
enable = true
[git.hooks.pre-commit]
text = """
FILES=$(git diff --cached --name-only --diff-filter=ACMR -- *.nix| sed -e 's| |\\ |g')
[ -z "$FILES" ] && exit 0
echo $FILES | xargs nix fmt
echo $FILES | xargs git add
exit 0"""

156
template/flake.lock generated Normal file
View file

@ -0,0 +1,156 @@
{
"nodes": {
"devshell": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1678957337,
"narHash": "sha256-Gw4nVbuKRdTwPngeOZQOzH/IFowmz4LryMPDiJN/ah4=",
"owner": "numtide",
"repo": "devshell",
"rev": "3e0e60ab37cd0bf7ab59888f5c32499d851edb47",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_3": {
"locked": {
"lastModified": 1667077288,
"narHash": "sha256-bdC8sFNDpT0HK74u9fUkpbf1MEzVYJ+ka7NXCdgBoaA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "6ee9ebb6b1ee695d2cacc4faa053a7b9baa76817",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677383253,
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1681269223,
"narHash": "sha256-i6OeI2f7qGvmLfD07l1Az5iBL+bFeP0RHixisWtpUGo=",
"path": "/nix/store/dnj69agbi6dz7985gvcbmv40wk1skvmy-source",
"rev": "87edbd74246ccdfa64503f334ed86fa04010bab9",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 0,
"narHash": "sha256-3nD7iQXd/J6KjkT8IjozTuA5p8qjiLKTxvOUmH+AzNM=",
"path": "/nix/store/ig0dn500x8lm7mjq8sp3s2k1hpji0xxj-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2",
"tubslatex": "tubslatex"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tubslatex": {
"inputs": {
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1667307103,
"narHash": "sha256-lwS0/ON7yc8I+orxt7w+zO0Dmo1peQ65z4ObKaJhAdk=",
"ref": "refs/heads/main",
"rev": "cae35e5ff56a43f446f175a3931c5b468354bb00",
"revCount": 1,
"type": "git",
"url": "ssh://github.com/dadada/tubslatex-nix?branch=main"
},
"original": {
"type": "git",
"url": "ssh://github.com/dadada/tubslatex-nix?branch=main"
}
}
},
"root": "root",
"version": 7
}

58
template/flake.nix Normal file
View file

@ -0,0 +1,58 @@
{
description = "Thesis";
inputs.flake-utils.url = github:numtide/flake-utils;
inputs.devshell.url = github:numtide/devshell;
inputs.tubslatex.url = "git+ssh://github.com/dadada/tubslatex-nix?branch=main";
outputs = { self, flake-utils, nixpkgs, devshell, tubslatex }@inputs:
flake-utils.lib.eachDefaultSystem
(system:
let
tubslatexOverlay = tubslatex.overlays.default;
pkgs = import nixpkgs {
inherit system;
overlays = [ tubslatexOverlay ];
};
in
{
devShells.default =
let
pkgs = import nixpkgs {
inherit system;
overlays = [
devshell.overlay
tubslatexOverlay
];
};
in
pkgs.devshell.mkShell {
imports = [ (pkgs.devshell.importTOML ./devshell.toml) ];
};
checks = {
format = pkgs.runCommand "format" { buildInputs = [ pkgs.nixpkgs-fmt ]; } "nixpkgs-fmt --check ${./.} && touch $out";
};
formatter = pkgs.nixpkgs-fmt;
packages.default = pkgs.callPackage
({ lib, texliveWithTubslatex, stdenvNoCC, ... }: stdenvNoCC.mkDerivation {
pname = "thesis";
version = "0.1";
src = ./.;
nativeBuildInputs = [ texliveWithTubslatex ];
dontConfigure = true;
installPhase = ''
mkdir -p $out
cp thesis.pdf $out
'';
meta = with lib; {
description = "Master thesis proposal";
maintainers = [ "dadada" ];
platforms = platforms.all;
license = licenses.proprietary;
};
})
{ };
});
}

28
template/thesis.tex Normal file
View file

@ -0,0 +1,28 @@
\documentclass[german=false,thesistype=bachelor,nolistoftables,noabstract]{tubsthesis}
\usepackage{lipsum}
\input{thesisconfig.tex}
\addbibresource{bibliography.bib}
\thesisinstitute{Institute of Perfect Writing in IT}
\begin{document}
\thesisabstract{%
% Since `noabstract` is set, this abstract won't be printed
This is an english text.\\
\lipsum[1-2]
}
\begin{thesis}
\chapter{Introduction}
\lipsum[1-3]
\end{thesis}
\chapter{Storage Device}
Put a table of the contents of your attached Storage Device (SD card/USB flash drive) here.
Add explanations where needed!
\end{document}

11
template/thesisconfig.tex Normal file
View file

@ -0,0 +1,11 @@
\thesisname{Johanna Doe}
\thesismatrikel{1234567}
\thesisemail{j.doe@tu-braunschweig.de}
\thesismajor{Informatik}
\thesisduration{3}
\thesissupervisors{Super Visor, M. Sc.}{Dr. Dipper Visor}{}
\thesisprofessor[Prof.\,Dr.-Ing.\,Jane Smith]{Prof.\,Dr.-Ing.\,Lars Eisbär}
\thesistitle{Titel der Thesis}{Title of the thesis}
\thesisbegindate{2020-01-01}
%\thesisenddate{2020-01-02}
\thesispresentationpoints{5.7}