-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix.jinja
More file actions
96 lines (85 loc) · 2.54 KB
/
flake.nix.jinja
File metadata and controls
96 lines (85 loc) · 2.54 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
{
description = "repository-template";
nixConfig = {
extra-trusted-substituters = [
# Nix community's cache server
"https://nix-community.cachix.org"
"https://devenv.cachix.org"
];
extra-trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
];
};
# We use flake-parts to assemble all flake outputs.
# This gives nicer modularity. All `.parts` files are
# `flake-parts` module files.
outputs =
inputs:
let
lib = inputs.nixpkgs.lib;
in
inputs.flake-parts.lib.mkFlake
{
inherit inputs;
}
(
lib.pipe inputs.import-tree [
# NOTE: Uncomment the below to inspect what modules are loaded.
# (i: i.map (x: lib.info "Importing :${x}" x))
(i: i.filter (lib.hasInfix ".parts."))
(i: i ./.)
]
);
inputs = {
# Importing flake-parts modules recursively.
import-tree = {
url = "github:vic/import-tree";
};
systems = {
# Using `nix-systems` flake specification.
url = "path:./flake/systems.nix";
flake = false;
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
};
# Nixpkgs (latest ones).
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# Nixpkgs (stable NixOS branch)
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
# Format the repo with nix-treefmt.
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# The devenv module to create good development shells.
# The `nixpkgs-devenv` must aligned with the pinned version.
devenv = {
url = "github:cachix/devenv?ref=v1.11.1";
inputs.nixpkgs.follows = "nixpkgs-devenv";
};
# This is the rolling nixpkgs with what devenv was tested.
nixpkgs-devenv = {
url = "github:cachix/devenv-nixpkgs?ref=rolling";
};
# To build a base image with Nix.
nix = {
url = "github:nixos/nix";
inputs.nixpkgs.follows = "nixpkgs";
};
{% if project_language == "rust" %}
# The Rust overlay to include the latest toolchain.
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
{% elif project_language == "python" -%}
# The Python packages for all versions.
nixpkgs-python = {
url = "github:cachix/nixpkgs-python";
inputs.nixpkgs.follows = "nixpkgs";
};
{%- endif %}
};
}