diff --git a/flake.nix b/flake.nix index 0abd8f7..180c1a6 100644 --- a/flake.nix +++ b/flake.nix @@ -64,5 +64,7 @@ "gabe@gv-workstation" = import ./hosts/home-workstation.nix {inherit inputs outputs;}; "gabe@gv-ubuntu" = import ./hosts/home-workstation.nix {inherit inputs outputs;}; }; + + templates=import ./templates {inherit inputs outputs;}; }; } diff --git a/templates/default.nix b/templates/default.nix new file mode 100644 index 0000000..312379a --- /dev/null +++ b/templates/default.nix @@ -0,0 +1,18 @@ +{ + inputs, + outputs, + ... +}: { + default={ + path=./default; + description="a basic blank devshell flake"; + }; + hugo = { + path = ./hugo; + description = "a flake for getting a hugo website up and running"; + }; + latex = { + path = ./latex; + description = "A flake containing a basic latex environment"; + }; +} diff --git a/templates/default/.envrc b/templates/default/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/default/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/default/.gitignore b/templates/default/.gitignore new file mode 100644 index 0000000..92b2793 --- /dev/null +++ b/templates/default/.gitignore @@ -0,0 +1 @@ +.direnv diff --git a/templates/default/flake.nix b/templates/default/flake.nix new file mode 100644 index 0000000..848288d --- /dev/null +++ b/templates/default/flake.nix @@ -0,0 +1,24 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in + with pkgs; { + devShells.default = mkShell { + buildInputs = [ + just + ]; + }; + }); +} diff --git a/templates/default/justfile b/templates/default/justfile new file mode 100644 index 0000000..0e0d4a8 --- /dev/null +++ b/templates/default/justfile @@ -0,0 +1,2 @@ +default: + just --list diff --git a/templates/hugo/.envrc b/templates/hugo/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/hugo/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/hugo/.gitignore b/templates/hugo/.gitignore new file mode 100644 index 0000000..6df0c54 --- /dev/null +++ b/templates/hugo/.gitignore @@ -0,0 +1,16 @@ +# Generated files by hugo +/public/ +/resources/_gen/ +/assets/jsconfig.json +hugo_stats.json + +# Executable may be added to repository +hugo.exe +hugo.darwin +hugo.linux + +# Temporary lock file while building +/.hugo_build.lock + +# for direnv +.direnv diff --git a/templates/hugo/flake.nix b/templates/hugo/flake.nix new file mode 100644 index 0000000..1eb8c7f --- /dev/null +++ b/templates/hugo/flake.nix @@ -0,0 +1,26 @@ +{ + description = "hugo development environment"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in + with pkgs; { + devShells.default = mkShell { + buildInputs = [ + hugo + just + rsync + ]; + }; + }); +} diff --git a/templates/hugo/hugo.toml b/templates/hugo/hugo.toml new file mode 100644 index 0000000..dc3dda4 --- /dev/null +++ b/templates/hugo/hugo.toml @@ -0,0 +1,21 @@ +baseURL = "https://example.com" +title = "Title" +enableRobotsTXT = true + +[markup.goldmark.extensions] +definitionList = true +footnote = true +strikethrough = true +table = true +taskList = true +[markup.goldmark.extensions.extras.insert] +enable = true +[markup.goldmark.extensions.extras.mark] +enable = true +[markup.goldmark.extensions.extras.subscript] +enable = true +[markup.goldmark.extensions.extras.superscript] +enable = true + +[security] +enableInlineShortcodes = true diff --git a/templates/hugo/justfile b/templates/hugo/justfile new file mode 100644 index 0000000..023c17e --- /dev/null +++ b/templates/hugo/justfile @@ -0,0 +1,10 @@ +preview: + hugo serve --buildDrafts --buildExpired --buildFuture --navigateToChanged + +USER:='root' +HOST:='1.1.1.1' +DIR:='/srv/folder' + +deploy: + hugo --minify + rsync -rvz --delete public/ {{USER}}@{{HOST}}:{{DIR}} # this will delete everything on the server that's not in the local public folder diff --git a/templates/latex/.envrc b/templates/latex/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/templates/latex/.envrc @@ -0,0 +1 @@ +use flake diff --git a/templates/latex/.gitignore b/templates/latex/.gitignore new file mode 100644 index 0000000..14491df --- /dev/null +++ b/templates/latex/.gitignore @@ -0,0 +1,279 @@ +# Created by https://www.gitignore.io/api/latex +# Edit at https://www.gitignore.io/?templates=latex + +# direnv +.direnv + +*.pdf + +### LaTeX ### +## Core latex/pdflatex auxiliary files: +*.aux +*.lof +*.log +*.lot +*.fls +*.out +*.toc +*.fmt +*.fot +*.cb +*.cb2 +.*.lb +.*tmp + +## Intermediate documents: +*.dvi +*.xdv +*-converted-to.* +# these rules might exclude image files for figures etc. +# *.ps +# *.eps +# *.pdf + +## Generated if empty string is given at "Please type another file name for output:" +.pdf + +## Bibliography auxiliary files (bibtex/biblatex/biber): +*.bbl +*.bcf +*.blg +*-blx.aux +*-blx.bib +*.run.xml + +## Build tool auxiliary files: +*.fdb_latexmk +*.synctex +*.synctex(busy) +*.synctex.gz +*.synctex.gz(busy) +*.pdfsync + +## Build tool directories for auxiliary files +# latexrun +latex.out/ + +## Auxiliary and intermediate files from other packages: +# algorithms +*.alg +*.loa + +# achemso +acs-*.bib + +# amsthm +*.thm + +# beamer +*.nav +*.pre +*.snm +*.vrb + +# changes +*.soc + +# comment +*.cut + +# cprotect +*.cpt + +# elsarticle (documentclass of Elsevier journals) +*.spl + +# endnotes +*.ent + +# fixme +*.lox + +# feynmf/feynmp +*.mf +*.mp +*.t[1-9] +*.t[1-9][0-9] +*.tfm + +#(r)(e)ledmac/(r)(e)ledpar +*.end +*.?end +*.[1-9] +*.[1-9][0-9] +*.[1-9][0-9][0-9] +*.[1-9]R +*.[1-9][0-9]R +*.[1-9][0-9][0-9]R +*.eledsec[1-9] +*.eledsec[1-9]R +*.eledsec[1-9][0-9] +*.eledsec[1-9][0-9]R +*.eledsec[1-9][0-9][0-9] +*.eledsec[1-9][0-9][0-9]R + +# glossaries +*.acn +*.acr +*.glg +*.glo +*.gls +*.glsdefs + +# gnuplottex +*-gnuplottex-* + +# gregoriotex +*.gaux +*.gtex + +# htlatex +*.4ct +*.4tc +*.idv +*.lg +*.trc +*.xref + +# hyperref +*.brf + +# knitr +*-concordance.tex +# TODO Comment the next line if you want to keep your tikz graphics files +*.tikz +*-tikzDictionary + +# listings +*.lol + +# luatexja-ruby +*.ltjruby + +# makeidx +*.idx +*.ilg +*.ind +*.ist + +# minitoc +*.maf +*.mlf +*.mlt +*.mtc[0-9]* +*.slf[0-9]* +*.slt[0-9]* +*.stc[0-9]* + +# minted +_minted* +*.pyg + +# morewrites +*.mw + +# nomencl +*.nlg +*.nlo +*.nls + +# pax +*.pax + +# pdfpcnotes +*.pdfpc + +# sagetex +*.sagetex.sage +*.sagetex.py +*.sagetex.scmd + +# scrwfile +*.wrt + +# sympy +*.sout +*.sympy +sympy-plots-for-*.tex/ + +# pdfcomment +*.upa +*.upb + +# pythontex +*.pytxcode +pythontex-files-*/ + +# tcolorbox +*.listing + +# thmtools +*.loe + +# TikZ & PGF +*.dpth +*.md5 +*.auxlock + +# todonotes +*.tdo + +# vhistory +*.hst +*.ver + +# easy-todo +*.lod + +# xcolor +*.xcp + +# xmpincl +*.xmpi + +# xindy +*.xdy + +# xypic precompiled matrices +*.xyc + +# endfloat +*.ttt +*.fff + +# Latexian +TSWLatexianTemp* + +## Editors: +# WinEdt +*.bak +*.sav + +# Texpad +.texpadtmp + +# LyX +*.lyx~ + +# Kile +*.backup + +# KBibTeX +*~[0-9]* + +# auto folder when using emacs and auctex +./auto/* +*.el + +# expex forward references with \gathertags +*-tags.tex + +# standalone packages +*.sta + +### LaTeX Patch ### +# glossaries +*.glstex + +# End of https://www.gitignore.io/api/latex +._sync_* diff --git a/templates/latex/.latexmkrc b/templates/latex/.latexmkrc new file mode 100644 index 0000000..6819271 --- /dev/null +++ b/templates/latex/.latexmkrc @@ -0,0 +1,2 @@ +$pdf_previewer = 'zathura'; +# @default_files=('main.tex'); diff --git a/templates/latex/flake.nix b/templates/latex/flake.nix new file mode 100644 index 0000000..3029b62 --- /dev/null +++ b/templates/latex/flake.nix @@ -0,0 +1,25 @@ +{ + description = "A very basic flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = import nixpkgs {inherit system;}; + in + with pkgs; { + devShells.default = mkShell { + buildInputs = [ + texliveFull + just + ]; + }; + }); +} diff --git a/templates/latex/justfile b/templates/latex/justfile new file mode 100644 index 0000000..e16895a --- /dev/null +++ b/templates/latex/justfile @@ -0,0 +1,5 @@ +preview: + latexmk -pdf -pvc + +clean: + latexmk -c diff --git a/templates/latex/main.tex b/templates/latex/main.tex new file mode 100644 index 0000000..e112422 --- /dev/null +++ b/templates/latex/main.tex @@ -0,0 +1,14 @@ +\documentclass[letterpaper,10pt]{article} +\usepackage[margin=2cm]{geometry} +\usepackage{tasks} +\usepackage{xcolor} +\usepackage{hyperref} +\usepackage{tabularx} +\usepackage{array} +% adds newline after paragraph, removes indent +\usepackage[skip=10pt plus1pt]{parskip} +\definecolor{linkcolor}{rgb}{0,0.2,0.6} +\hypersetup{colorlinks,breaklinks,urlcolor=linkcolor} + +\begin{document} +\end{document}