-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
48 lines (46 loc) · 1.74 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
description = "A collection of project templates";
inputs = {
dotfiles.url = "gitlab:bertof/nix-dotfiles";
nixpkgs.follows = "dotfiles/nixpkgs-u";
flake-parts.url = "github:hercules-ci/flake-parts";
jupyenv.url = "github:tweag/jupyenv";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
systems.url = "github:nix-systems/default";
};
outputs = inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = import inputs.systems;
imports = [ inputs.pre-commit-hooks-nix.flakeModule ];
perSystem = { config, pkgs, ... }: {
devShells.default = pkgs.mkShell {
shellHook = ''
${config.pre-commit.installationScript}
'';
};
pre-commit = {
inherit pkgs;
settings = {
hooks = {
deadnix.enable = true;
nixpkgs-fmt.enable = true;
statix.enable = true;
};
};
};
formatter = pkgs.nixpkgs-fmt;
};
flake = {
templates = rec {
default = basic;
paper = { path = ./paper; description = "Latex paper with pre-commit checks"; };
presentation = { path = ./presentation; description = "Latex presentation with pre-commit checks"; };
latex = { path = ./latex; description = "Latex with pre-commit checks"; };
thesis = { path = ./thesis; description = "Latex thesis with pre-commit checks"; };
basic = { path = ./basic; description = "Basic flake environment with pre-commit checks"; };
python = { path = ./python; description = "Python with pre-commit checks"; };
rust = { path = ./rust; description = "Rust library with pre-commit checks"; };
jupyenv = inputs.jupyenv.templates.default;
};
};
};
}