forked from epics-extensions/EPNix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
165 lines (144 loc) · 4.84 KB
/
flake.nix
File metadata and controls
165 lines (144 loc) · 4.84 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
{
description = "A Nix flake containing EPICS-related modules and packages";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11";
bash-lib = {
url = "github:minijackson/bash-lib";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
sphinxcontrib-nixdomain = {
url = "github:minijackson/sphinxcontrib-nixdomain";
inputs.nixpkgs.follows = "nixpkgs";
};
sphinxcontrib-typstbuilder = {
url = "github:minijackson/sphinxcontrib-typstbuilder";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
flake-utils,
nixpkgs,
nix-github-actions,
...
}@inputs:
let
overlay = import ./pkgs self.lib inputs;
systemDependentOutputs =
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
overlay
inputs.bash-lib.overlay
inputs.sphinxcontrib-nixdomain.overlays.default
inputs.sphinxcontrib-typstbuilder.overlays.default
];
};
in
{
packages = flake-utils.lib.flattenTree (pkgs.epnix // pkgs.epnixOutsideDefaultScopes);
checks = {
# Everything should always build
allPackages = pkgs.releaseTools.aggregate {
name = "allPackages";
constituents = builtins.attrValues self.packages.${system};
};
}
// (import ./pkgs/tests { inherit pkgs self; })
// (import ./ioc/tests {
inherit
nixpkgs
pkgs
self
system
;
})
// (import ./nixos/tests/all-tests.nix {
inherit
nixpkgs
pkgs
self
system
;
});
devShells.default = pkgs.mkShell {
packages = [
pkgs.epnix.epics-base
pkgs.vale
];
inputsFrom = [
pkgs.epnix.docs
];
};
};
in
# Not eachDefaultSystem right now, because `nix flake check` tries to
# build every derivation of every system, which fails.
# Waiting on: https://github.com/NixOS/nix/pull/7759
(flake-utils.lib.eachSystem [ "x86_64-linux" ] systemDependentOutputs)
// {
overlays.default = overlay;
lib =
let
epnixLib = import ./lib {
inherit (nixpkgs) lib;
inherit epnixLib inputs;
};
in
epnixLib;
nixosModules.default = {
imports = [
self.nixosModules.ioc
self.nixosModules.nixos
];
};
nixosModules.ioc = {
imports = import ./ioc/modules/module-list.nix;
_module.args.epnix = self;
};
nixosModules.nixos =
{ lib, ... }:
{
imports = import ./nixos/module-list.nix;
# use mkBefore so that end users can be sure
# that their overlay can override EPNix packages
nixpkgs.overlays = lib.mkBefore [ self.overlays.default ];
_module.args.epnixLib = self.lib;
};
templates.old-top = {
path = ./templates/old-top;
description = "An EPNix TOP project (deprecated)";
welcomeText = ''
You have created a *deprecated* EPNix top,
using "modules development".
**Warning:** this style of development will be removed in EPNix 26.05.
Don't forget to run `makeBaseApp.pl` and `eregen` inside the development shell before compiling it.
Useful links:
- EPNix IOC documentation: <https://epics-extensions.github.io/EPNix/${self.lib.versions.stable}/ioc/>
- EPNix IOC tutorials: <https://epics-extensions.github.io/EPNix/${self.lib.versions.stable}/ioc/tutorials/>
'';
};
templates.top = {
path = ./templates/top;
description = "An EPNix TOP project (next-generation)";
welcomeText = ''
You have created a next-generation EPNix top.
Don't forget to run `makeBaseApp.pl` and `epicsConfigurePhase` inside the development shell before compiling it.
Useful links:
- EPNix IOC documentation: <https://epics-extensions.github.io/EPNix/${self.lib.versions.stable}/ioc/>
- EPNix IOC tutorials: <https://epics-extensions.github.io/EPNix/${self.lib.versions.stable}/ioc/tutorials/>
'';
};
templates.default = self.templates.top;
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.callPackage ./formatter.nix { };
githubActions = nix-github-actions.lib.mkGithubMatrix { inherit (self) checks; };
};
}