added some flake templates.

This commit is contained in:
Gabe Venberg 2024-05-22 15:07:45 -05:00
parent 9068858ee4
commit fac5efd7b2
17 changed files with 448 additions and 0 deletions

View file

@ -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;};
};
}

18
templates/default.nix Normal file
View file

@ -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";
};
}

1
templates/default/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

1
templates/default/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.direnv

View file

@ -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
];
};
});
}

View file

@ -0,0 +1,2 @@
default:
just --list

1
templates/hugo/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

16
templates/hugo/.gitignore vendored Normal file
View file

@ -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

26
templates/hugo/flake.nix Normal file
View file

@ -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
];
};
});
}

21
templates/hugo/hugo.toml Normal file
View file

@ -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

10
templates/hugo/justfile Normal file
View file

@ -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

1
templates/latex/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

279
templates/latex/.gitignore vendored Normal file
View file

@ -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_*

View file

@ -0,0 +1,2 @@
$pdf_previewer = 'zathura';
# @default_files=('main.tex');

25
templates/latex/flake.nix Normal file
View file

@ -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
];
};
});
}

5
templates/latex/justfile Normal file
View file

@ -0,0 +1,5 @@
preview:
latexmk -pdf -pvc
clean:
latexmk -c

14
templates/latex/main.tex Normal file
View file

@ -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}