-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (92 loc) · 2.68 KB
/
flake.nix
File metadata and controls
106 lines (92 loc) · 2.68 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
97
98
99
100
101
102
103
104
105
106
{
description = "Development flake support";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
# When using flake-parts you don't really use nixpkgs in the dependencies of modules.
# Instead everything should be resolved in the final consuming flake.
nixpkgs.follows = "flake-parts/nixpkgs-lib";
};
outputs =
inputs:
let
flakeModule = {
imports = [
inputs.devshell.flakeModule
inputs.git-hooks.flakeModule
inputs.treefmt.flakeModule
./flake-module
];
};
in
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ ];
flake = {
inherit flakeModule;
templates = rec {
default = subflake;
subflake = {
path = ./template/subflake;
description = ''
A flake using dev-flake as subflake. To be placed in a sub-folder of a project, e.g. dev.
'';
};
subflake-nixpkgs = {
path = ./template/subflake-nixpkgs;
description = ''
A flake using dev-flake as subflake with nixpkgs. To be placed in a sub-folder of a project, e.g. dev.
'';
};
subflake-project = {
path = ./template/subflake-project;
description = ''
A project using dev-flake in a subflake.
'';
};
subflake-nixpkgs-project = {
path = ./template/subflake-nixpkgs-project;
description = ''
A project using dev-flake in a subflake with nixpkgs, e.g. no nixpkgs/systems within the main flake.
'';
};
root = {
path = ./template/root;
description = ''
A flake using dev-flake.
'';
};
root-project = {
path = ./template/root-project;
description = ''
A project using dev-flake in root flake.
'';
};
};
};
# Dogfood
imports = [
inputs.flake-parts.flakeModules.partitions
flakeModule
];
partitionedAttrs = {
devShells = "dev";
formatter = "dev";
checks = "dev";
};
partitions.dev = {
extraInputsFlake = ./dev;
module.imports = [ ./dev/flake-module.nix ];
};
};
}