Skip to content

Leixb/flake-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Opinionated Flake templates

Highly opinionated flake templates using:

Currently this is a work in progress and things my change a lot as I experiment with what works best for me.

I plan on adding:

Usage

To use, specify the template with the language and project name (destination folder) when creating the project as follows:

nix flake new -t github:Leixb/flake-templates#<language> <ProjectName>

Blank

This is the default template, it gives a simple devShell, some sane default values for .editorconfig and direnv configuration.

Python

This is an example of how to use mach-nix with flakes properly, so that pypi-deps-db is managed through flake inputs and there is no need to use PypiDataRev or PypiData.

To use the template run:

nix flake new -t github:Leixb/flake-templates#python <ProjectName>

You can manage the Pypi database using nix flake lock. For example, to update the version to latest, use: nix flake lock --update-input pypi-deps-db

Go

Provides a shell with go and several go development tools with GOPATH inside .direnv. It also has a recipe to build a go module.

nix flake new -t github:Leixb/flake-templates#go <ProjectName>

Java

Gives a shell with the latest JDK and sets up JDTLS with direnv. You may need to tweak your IDE configuration to work with the given JDTLS_HOME environment variable. For ease of use, the configuration files for JDTLS are put outside the nix store so they can be freely modified if needed.

nix flake new -t github:Leixb/flake-templates#java <ProjectName>

It also provides a two step maven build which needs changing the values on the sha256 checksums manually.

Rust

Shell with cargo, rust-analyzer and other rust tooling.

nix flake new -t github:Leixb/flake-templates#rust <ProjectName>

R

R with tidyverse and languageserver

nix flake new -t github:Leixb/flake-templates#R <ProjectName>

LaTeX

LaTeX template using Leixb/latex-template. Already includes latex files to get going quickly.

nix flake new -t github:Leixb/flake-templates#latex <ProjectName>

Lua

Lua with sumneko-lua-language-server.

nix flake new -t github:Leixb/flake-templates#lua <ProjectName>