Vision: SDSC Excellence | Always be encouraging
Get in contact
- Slack Channel :
#best-practice-ambassadors
Authors:
Table of Content (click to expand)
This is a repository template giving you a top-level structure with the following features.
- Git & Git Large File System (LFS) properly setup.
- Nix development shell enabled with
direnv
and.envrc
. - Formatting with
treefmt-nix
. - Githooks (optional) which runs
pre-commit
checks:- Git LFS checks.
- Format with
treefmt-nix
.
- Language specific best-practice setup for
rust
,go
andpython
. - Devcontainer: not-yet-provided (future, based on Nix dev shell)
Clone this repository to some place of your choice.
Apply the templates with copier
using the following:
cd repo && git pull
just create <language> <destination> [args...]
where
-
<destination>
is the destination folder where you want to place this new repository. -
<language>
is one of the following templates: -
[args...]
are optional arguments passed tocopier
. If you want to overwrite by default use-w
.
TODO: Add this.
The following describes the content of the top-level directories:
docs
: The top-level folder to any related documentation. The README.md should link into this folder.examples
: The top-level folder which should contain some examples how to use this software component.external
: If you really want to use sub-modules (which you generally should avoid for a multitude of reasons), your external stuff should be either placed in here or insrc/external
if its more related to your source.src
: The folder where your source code lives.tools
: The folder for all specific needs:
-
Git & Git LFS properly setup:
.gitignore
,.gitattributes
-
Nix development shell based on
devenv
auto-enabled withdirenv
and.envrc
. -
Formatting with
treefmt-nix
andtreefmt.nix
config. -
Githooks (optional) which runs
pre-commit
checks:- Git LFS checks
- Format with
treefmt-nix
.
[!NOTE] You need to install the Githooks tool yourself if you want to use it and it will work out-of-the-box.
- Command-Runner:
just
- Nix Shell:
devenv
provided Nix shell using toolchain-generic.nix. - Formatter: Tree format with
treefmt-nix
and enabled languages
- Toolchain: Rust toolchain on
nightly
- Build-Tool:
cargo
- LSP:
rust-analyzer
- Formatter:
rustfmt
- Compiler:
go
at1.23.X
- Build-Tool:
go
- LSP:
gopls
- Formatter:
gofmt
,goimports
,golines
-
Interpreter:
python
at3.12
-
Build-Tool:
uv
-
LSP:
pyright
-
Formatter:
ruff
The following workflows are defined:
-
format.yaml
: A format workflow which formats the whole repository withtreefmt
which is configured over Nix. For it to work withcachix
(a Nix CI caching mechanism) you need to define two secrets in Settings -> Secrets & variables -> Actions -> Repositories secrets:-
CACHIX_CACHE_NAME
: The cache name you created on cachix.org. This is free for public caches, which is acceptable for OSS repositories. -
CACHIX_AUTH_TOKEN
: The access token created on cachix.org for this cacheCACHIX_CACHE_NAME
.
-
Read first the Contribution Guidelines.
For technical documentation on setup and development, see the Development Guide
Copyright © 2025-2028 Swiss Data Science Center (SDSC), www.datascience.ch. All rights reserved. The SDSC is jointly established and legally represented by the École Polytechnique Fédérale de Lausanne (EPFL) and the Eidgenössische Technische Hochschule Zürich (ETH Zürich). This copyright encompasses all materials, software, documentation, and other content created and developed by the SDSC.