forked from tiiuae/ghaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
180 lines (159 loc) · 4.66 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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# Copyright 2022-2023 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{
description = "Ghaf - Documentation and implementation for TII SSRC Secure Technologies Ghaf Framework";
nixConfig = {
substituters = [
"https://cache.vedenemo.dev"
"https://cache.ssrcdevops.tii.ae"
"https://ghaf-dev.cachix.org"
"https://cache.nixos.org/"
];
extra-trusted-substituters = [
"https://cache.vedenemo.dev"
"https://cache.ssrcdevops.tii.ae"
"https://ghaf-dev.cachix.org"
"https://cache.nixos.org/"
];
extra-trusted-public-keys = [
"cache.vedenemo.dev:8NhplARANhClUSWJyLVk4WMyy1Wb4rhmWW2u8AejH9E="
"cache.ssrcdevops.tii.ae:oOrzj9iCppf+me5/3sN/BxEkp5SaFkHfKTPPZ97xXQk="
"ghaf-dev.cachix.org-1:S3M8x3no8LFQPBfHw1jl6nmP8A7cVWKntoMKN3IsEQY="
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
#
# Flake and repo structuring configurations
#
# Allows us to structure the flake with the NixOS module system
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
flake-root.url = "github:srid/flake-root";
lib-extras = {
url = "github:aldoborrero/lib-extras";
inputs = {
devshell.follows = "devshell";
flake-parts.follows = "flake-parts";
flake-root.follows = "flake-root";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
# Format all the things
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# To ensure that checks are run locally to enforce cleanliness
pre-commit-hooks-nix = {
url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-compat.follows = "flake-compat";
};
};
# For preserving compatibility with non-Flake users
flake-compat = {
url = "github:nix-community/flake-compat";
flake = false;
};
nix-fast-build = {
url = "github:Mic92/nix-fast-build";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixpkgs";
treefmt-nix.follows = "treefmt-nix";
};
};
# Dependencies used by other inputs
systems.url = "github:nix-systems/default";
devshell = {
url = "github:numtide/devshell";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
};
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
# Used to evaluate a flake outputs all at once
devour-flake = {
url = "github:srid/devour-flake";
flake = false;
};
#
# Target Building and services
#
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
microvm = {
url = "github:astro/microvm.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
jetpack-nixos = {
url = "github:anduril/jetpack-nixos";
inputs.nixpkgs.follows = "nixpkgs";
};
#
# Security
#
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
flake-parts.follows = "flake-parts";
pre-commit-hooks-nix.follows = "pre-commit-hooks-nix";
flake-compat.follows = "flake-compat";
};
};
};
outputs = inputs @ {flake-parts, ...}: let
lib = import ./lib.nix {inherit inputs;};
in
flake-parts.lib.mkFlake
{
inherit inputs;
specialArgs = {
inherit lib;
};
} {
# Toggle this to allow debugging in the repl
# see:https://flake.parts/debug
debug = false;
systems = [
"x86_64-linux"
"aarch64-linux"
# RISC-V is a target built from cross compilation and is not
# included as a host build possibility at this point
# Future HW permitting this can be re-evaluated
#"riscv64-linux"
];
imports = [
./nix
./packages
./targets
./hydrajobs.nix
./templates
];
#TODO Fix this
#flake.nixosModules = with lib;
# mapAttrs (_: import)
# (flattenTree (rakeLeaves ./modules));
flake.lib = lib;
};
}