1
Fork 0

Started rewriting my nixos config

This commit is contained in:
Matei Adriel 2022-12-28 13:27:18 +01:00
parent f9f3b19299
commit 1b17dc6cf3
186 changed files with 135 additions and 7404 deletions

View file

@ -1,3 +0,0 @@
# Vscode snippets
These are snippets usable both in vscode and neovim, defined in vscode format.

View file

@ -1,49 +0,0 @@
{
"name": "adriels-snippets",
"engines": {
"vscode": "^1.11.0"
},
"contributes": {
"snippets": [
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/other.json"
},
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/imports.json"
},
{
"language": [
"purs",
"purescript"
],
"path": "./snippets/purescript/deriving.json"
},
{
"language": [
"tex"
],
"path": "./snippets/latex/core.json"
},
{
"language": [
"tex"
],
"path": "./snippets/latex/explain.json"
},
{
"language": [
"lua"
],
"path": "./snippets/lua/core.json"
}
]
}
}

View file

@ -1,300 +0,0 @@
{
"Begin": {
"prefix": "begin",
"description": "Begin anything",
"body": ["\\begin{$1}", "\t$0", "\\end{$1}"]
},
"Set": {
"prefix": "set",
"description": "Set I guess",
"body": "\\{$1\\\\}$0"
},
"Absolute value": {
"prefix": "abs",
"description": "Absolute values",
"body": "\\abs{$1}$0"
},
"Lemma": {
"prefix": "lemma",
"description": "Create a lemma",
"body": ["\\begin{lemma}[$1] \\label{lem:$1}", "\t$0", "\\end{lemma}"]
},
"Example*": {
"prefix": "example*",
"description": "Create an example*",
"body": ["\\begin{example*}", "\t$0", "\\end{example*}"]
},
"Example": {
"prefix": "example",
"description": "Create an example",
"body": ["\\begin{example}[$1] \\label{exp:$1}", "\t$0", "\\end{example}"]
},
"Theorem": {
"prefix": "theorem",
"description": "Create a theorem",
"body": ["\\begin{theorem}[$1] \\label{thm:$1}", "\t$0", "\\end{theorem}"]
},
"Exercise": {
"prefix": "exercise",
"description": "Create a exercise",
"body": ["\\begin{exercise}[$1] \\label{exe:$1}", "\t$0", "\\end{exercise}"]
},
"Definition": {
"prefix": "definition",
"description": "Create a definition",
"body": [
"\\begin{definition}[$1] \\label{def:$1}",
"\t$0",
"\\end{definition}"
]
},
"Display math": {
"prefix": "dm",
"description": "Display math section",
"body": ["\\[", "$0", "\\]"]
},
"Subscript": {
"prefix": "ss",
"description": "Subscript",
"body": "_{$1}$0"
},
"Exponent": {
"prefix": "ee",
"description": "Exponent",
"body": "^{$1}$0"
},
"Nth derivative": {
"prefix": "dd",
"description": "Nth derivative",
"body": "^{($1)}$0"
},
"Overline": {
"prefix": "ol",
"description": "Overline",
"body": "\\overline{$1}$0"
},
"Z Mod": {
"prefix": "zmod",
"description": "The set of Z/nZ",
"body": "\\mathbb{Z}/$1\\mathbb{Z}$0"
},
"Section": {
"prefix": "section",
"description": "Add section",
"body": ["\\section{$1}", "$0"]
},
"Subsection": {
"prefix": "subsection",
"description": "Add subsection",
"body": ["\\subsection{$1}", "$0"]
},
"Subsubsection": {
"prefix": "subsubsection",
"description": "Add subsubsection",
"body": ["\\subsubsection{$1}", "$0"]
},
"Chapter": {
"prefix": "chapter",
"description": "Add chapter",
"body": ["\\chapter{$1}", "$0"]
},
"Proof": {
"prefix": "proof",
"description": "Create proof",
"body": ["\\begin{proof}", "\t$0", "\\end{proof}"]
},
"Itemize": {
"prefix": "item",
"body": ["\\\\begin{itemize}", "\t\\item $0", "\\\\end{itemize}"],
"description": "Itemize env"
},
"Enumerate": {
"prefix": "enum",
"body": ["\\\\begin{enumerate}", "\t\\item $0", "\\\\end{enumerate}"],
"description": "Enumerate env"
},
"Reference definition": {
"prefix": "rdef",
"description": "Reference a definition",
"body": "\\ref{def:$1}$0"
},
"Reference lemma": {
"prefix": "rlemma",
"description": "Reference a lemma",
"body": "\\ref{lem:$1}$0"
},
"Reference theorem": {
"prefix": "rtheorem",
"description": "Reference a theorem",
"body": "\\ref{thm:$1}$0"
},
"Sigma sum": {
"prefix": "bsum",
"description": "Create a sum using sigma notation",
"body": "\\sum_{$1 = $2}^{$3}$0"
},
"Pi product": {
"prefix": "bproduct",
"description": "Create a produt using pi notation",
"body": "\\prod_{$1 = $2}^{$3}$0"
},
"Fraction": {
"prefix": "frac",
"description": "Create a fraction",
"body": "\\frac{$1}{$2}$0"
},
"Choose": {
"prefix": "binom",
"description": "Create a (n choose k) thingy",
"body": "\\binom{$1}{$2}$0"
},
"Limit": {
"prefix": "lim",
"description": "Create a limit",
"body": "\\lim _{$1 \\to $2}$0"
},
"Limit to infinity": {
"prefix": "ilim",
"description": "Create a limit as a variable goes to infinity",
"body": "\\lim _{$1 \\to \\infty}$0"
},
"Limit to negative infinity": {
"prefix": "nlim",
"description": "Create a limit as a variable goes to negative infinity",
"body": "\\lim _{$1 \\to -\\infty}$0"
},
"Limit to zero": {
"prefix": "zlim",
"description": "Create a limit as a variable goes to 0",
"body": "\\lim _{$1 \\to 0}$0"
},
"Sqrt": {
"prefix": "sqrt",
"description": "Create a sqrt",
"body": "\\sqrt[$1]{$2}$0"
},
"Sin": {
"prefix": "sin",
"description": "Create a sin call",
"body": "\\sin($1)$0"
},
"Cos": {
"prefix": "cos",
"description": "Create a cos call",
"body": "\\cos($1)$0"
},
"Ln": {
"prefix": "ln",
"description": "Create a ln call",
"body": "\\ln($1)$0"
},
"Aligned": {
"prefix": "aligned",
"description": "Create an aligned environment",
"body": ["\\begin{aligned}", "\t$0", "\\end{aligned}"]
},
"Text explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step using text in math mode",
"body": "&& \\text{($1)}$0"
},
"Explanation in math mode": {
"prefix": "expl",
"description": "Explain a step in math mode",
"body": "&& ($1) $0"
},
"Let": {
"prefix": "let",
"description": "Let something equal something else",
"body": "Let $$1 = $2$. $0"
},
"Force newline": {
"prefix": "cr",
"description": "Force newline in math mode",
"body": "{\\ \\\\\\\\}"
},
"Aligned display math": {
"prefix": "maligned",
"description": "Create an aligned display math environment",
"body": ["\\[", "\t\\begin{aligned}", "\t\t$0", "\t\\end{aligned}", "\\]"]
},
"System of equations": {
"prefix": "eqsystem",
"description": "Create a system of equations",
"body": [
"\\left\\{",
"\t\\begin{array}{rl}",
"\t\t$0",
"\t\\end{array}",
"\\right\\\\\\}"
]
},
"Aligned equation": {
"prefix": "aleq",
"description": "Aligned equation",
"body": ["\\\\\\ $1 &= $2", "$0"]
},
"2x2 matrices": {
"prefix": "mat22",
"description": "Create a 2x2 matrix",
"body": [
"\\begin{bmatrix}",
" ${1:1} & ${2:0}",
"\\\\\\ ${3:0} & ${4:1}",
"\\end{bmatrix}$0"
]
},
"3x3 matrices": {
"prefix": "mat33",
"description": "Create a 3x3 matrix",
"body": [
"\\begin{bmatrix}",
" ${1:1} & ${2:0} & ${3:0}",
"\\\\\\ ${4:0} & ${5:1} & ${6:0}",
"\\\\\\ ${7:0} & ${8:0} & ${9:1}",
"\\end{bmatrix}$0"
]
},
"3x3 determinants": {
"prefix": "det33",
"description": "Create a 3x3 determinant",
"body": [
"\\begin{vmatrix}",
" $1 & $2 & $3",
"\\\\\\ $4 & $5 & $6",
"\\\\\\ $7 & $8 & $9",
"\\end{vmatrix}$0"
]
},
"2x2 determinants": {
"prefix": "det22",
"description": "Create a 2x2 determinant",
"body": [
"\\begin{vmatrix}",
" $1 & $2",
"\\\\\\ $3 & $4",
"\\end{vmatrix}$0"
]
},
"Definite integral": {
"prefix": "dintegral",
"description": "Definite integral",
"body": "\\int_{$1}^{$2} $3 d${4:x}$0"
},
"Indefinite integral": {
"prefix": "integral",
"description": "Integral",
"body": "\\int $1 d${2:x}$0"
},
"Iff cases": {
"prefix": "ciff",
"description": "Prove an equivalence in both directions",
"body": [
"\\begin{enumerate}",
"\t\\item[$\\implies$]$1",
"\t\\item[$\\impliedby$]$2",
"\\end{enumerate}",
"$0"
]
}
}

View file

@ -1,77 +0,0 @@
{
"Text explanation in math mode": {
"prefix": "texpl",
"description": "Explain a step using text in math mode",
"body": "&& \\text{($1)}$0"
},
"Explanation in math mode": {
"prefix": "expl",
"description": "Explain a step in math mode",
"body": "&& ($1) $0"
},
"Explain division": {
"prefix": "exdiv",
"description": "Explain a division inside an equation",
"body": "&& \\left(\\frac{\\square}{$1}\\right)$0"
},
"Explain fraction": {
"prefix": "exfract",
"description": "Explain a step which wraps both sides of an equation by a fraction",
"body": "&& \\left(\\frac{$1}{$2} \\right)$0"
},
"Explain right multiplication": {
"prefix": "exmul",
"description": "Explain a right multiplication inside an equation",
"body": "&& \\left(\\square \\cdot $1 \\right)$0"
},
"Explain left multiplication": {
"prefix": "exlmul",
"description": "Explain a left multiplication inside an equation",
"body": "&& \\left($1 \\cdot \\square\\right)$0"
},
"Explain differentiation": {
"prefix": "exdiff",
"description": "Explain a step which differentiates both sides of an equation",
"body": "&& \\left( \\frac{d \\square} {d $1} \\right)$0"
},
"Explain integration": {
"prefix": "exint",
"description": "Explain a step which integrates both sides of an equation",
"body": "&& \\left(\\int \\square d$1 \\right)$0"
},
"Explain definite integration": {
"prefix": "exdint",
"description": "Explain a step which applies a definite integral to both sides of an equation",
"body": "&& \\left(\\int _{$1} ^{$2} \\square d$3 \\right)$0"
},
"Explain addition": {
"prefix": "exadd",
"description": "Explain a step which adds to both sides of an equation",
"body": "&& \\left( \\square + $1 \\right)$0"
},
"Explain subtraction": {
"prefix": "exsub",
"description": "Explain a step which subtracts from both sides of an equation",
"body": "&& \\left( \\square - $1 \\right)$0"
},
"Explain negation": {
"prefix": "exneg",
"description": "Explain a step which negates both sides of an equation",
"body": "&& (- \\square )$0"
},
"Explain power": {
"prefix": "expow",
"description": "Explain a step which raises both sides of an equation to a given power",
"body": "&& \\left( \\square ^{$1} \\right)$0"
},
"Explain exponentiation": {
"prefix": "exexp",
"description": "Explain a step which raises a given value to both sides of an equation",
"body": "&& \\left( $1 ^{\\square} \\right)$0"
},
"Explain natural logarithm": {
"prefix": "exln",
"description": "Explain a step which applies the ln function to both sides of an equation",
"body": "&& \\left( \\ln $1 \\right)$0"
}
}

View file

@ -1,33 +0,0 @@
{
"Lua setup-module": {
"prefix": "msetup",
"description": "Create lua module with setup function inside",
"body": [
"local M = {}",
"",
"function M.setup()",
" $0",
"end",
"",
"return M"
]
},
"Busted describe": {
"prefix": "describe",
"description": "Create a describe call for a busted test",
"body": [
"describe(\"$1\", function ()",
"\t$0",
"end)"
]
},
"Busted it": {
"prefix": "it",
"description": "Create an it call for a busted test",
"body": [
"it(\"$1\", function ()",
"\t$0",
"end)"
]
}
}

View file

@ -1,77 +0,0 @@
{
"Derive newtype instance": {
"prefix": "gnderive",
"description": "Use newtype deriving on any typeclass",
"body": "derive newtype instance $0 $3 $2"
},
"Generate json instances": {
"prefix": "json",
"description": "Generate the deriving of the EncodeJson and DecodeJson typeclasses",
"body": [
"derive newtype instance EncodeJson $1",
"derive newtype instance DecodeJson $1"
]
},
"Generic": {
"prefix": "dgeneric",
"description": "Generate the generic instance for a type",
"body": "derive instance Generic $1 _"
},
"Generic Show": {
"prefix": "gshow",
"description": "Generate generic show instances",
"body": [
"instance Show $1 where",
" show = genericShow"
]
},
"Generic Debug": {
"prefix": "gdebug",
"description": "Generate generic debug instances",
"body": [
"instance Debug $1 where",
" debug = genericDebug"
]
},
"Generic json": {
"prefix": "gjson",
"description": "Generate generic json instances",
"body": [
"instance EncodeJson $1 where",
" encodeJson = genericEncodeJson",
"instance DecodeJson $1 where",
" decodeJson = genericDecodeJson"
]
},
"Instance": {
"prefix": "instance",
"description": "Declare typeclass instance",
"body": [
"instance $2 $3 where",
" $0"
]
},
"Functor": {
"prefix": "dfunctor",
"description": "Derive a Functor instance",
"body": "derive instance Functor $1$0"
},
"Eq": {
"prefix": "deq",
"description": "Derive an Eq instance",
"body": "derive instance Eq $1$0"
},
"Ord": {
"prefix": "dord",
"description": "Derive an Ord instance",
"body": "derive instance Ord $1$0"
},
"Eq & Ord": {
"prefix": "deqord",
"description": "Derive an Eq and an Ord instance",
"body": [
"derive instance Eq $1",
"derive instance Ord $1$0"
]
}
}

View file

@ -1,62 +0,0 @@
{
"Tuple constructors": {
"prefix": "imptuple",
"description": "Import tuple constructors",
"body": "import Data.Tuple.Nested (type (/\\), (/\\))"
},
"Map": {
"prefix": "impmap",
"description": "Import Map module",
"body": "import Data.Map as Map"
},
"HashMap": {
"prefix": "imphashmap",
"description": "Import HashMap module",
"body": "import Data.HashMap as HashMap"
},
"FRP Event": {
"prefix": "impevent",
"description": "Import FRP.Event module",
"body": "import FRP.Event as E"
},
"List": {
"prefix": "implist",
"description": "Import List module",
"body": "import Data.List as List"
},
"Array": {
"prefix": "imparray",
"description": "import Array module",
"body": "import Data.Array as Array"
},
"AVar": {
"prefix": "impavar",
"description": "import AVar module",
"body": "import Effect.Aff.AVar as AV"
},
"Object": {
"prefix": "impobject",
"description": "import Foreign.Object module",
"body": "import Foreign.Object as Object"
},
"STObject": {
"prefix": "impstobject",
"description": "import STObject module",
"body": "import Foreign.Object.ST as STObject"
},
"Ref": {
"prefix": "impref",
"description": "import Effect.Ref module",
"body": "import Effect.Ref as Ref"
},
"Int": {
"prefix": "impint",
"description": "import Data.Int module",
"body": "import Data.Int as Int"
},
"Number": {
"prefix": "impnumber",
"description": "import Data.Number module",
"body": "import Data.Number as Number"
}
}

View file

@ -1,61 +0,0 @@
{
"Definition": {
"prefix": "definition",
"description": "Basic purescript definition",
"body": ["$1 :: $2", "$1 = $3"]
},
"SProxy": {
"prefix": "sproxy",
"description": "Generate a proxy constant",
"body": ["_$1 :: Proxy \"$1\"", "_$1 = Proxy"]
},
"Proxy": {
"prefix": "proxy",
"description": "Generate a proxy constant",
"body": ["_$1 :: Proxy $1", "_$1 = Proxy"]
},
"Prop": {
"prefix": "prop",
"description": "Prop lens",
"body": ["_$1 :: Lens' $2 $3", "_$1 = prop (Proxy :: _ \"$1\")"]
},
"Variant constructor": {
"prefix": "inj",
"description": "Generate a constructor for a variant an inline sproxy",
"body": [
"$1 :: forall r a. a -> Variant ( $1 :: a | r)",
"$1 = inj (SProxy :: SProxy \"$1\")"
]
},
"Full variant constructor": {
"prefix": "injf",
"description": "Generate a constructor for a variant with an external sproxy definition",
"body": [
"$1 :: forall r a. a -> Variant ( $1 :: a | r)",
"$1 = inj _$1",
"",
"_$1 :: Proxy \"$1\"",
"_$1 = Proxy"
]
},
"Example code": {
"prefix": "ex",
"description": "Provide example usage for some piece of code",
"body": ["-- |", "-- | Ex:", "-- | ```purs", "-- | $0", "-- | ```"]
},
"Section": {
"prefix": "section",
"description": "Delimit a section using 10 dashes",
"body": "---------- $0"
},
"Typeclass instances": {
"prefix": "sinstances",
"description": "Delimit a section which declares typeclass instances",
"body": ["---------- Typeclass instances", "$0"]
},
"If": {
"prefix": "if",
"description": "If then else expression",
"body": ["if $1", "\tthen $2", "\telse $3"]
}
}