-
Notifications
You must be signed in to change notification settings - Fork 63
/
Copy pathflake.nix
99 lines (90 loc) · 2.55 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
# 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 = {
extra-trusted-substituters = [
"https://cache.vedenemo.dev"
"https://cache.ssrcdevops.tii.ae"
];
extra-trusted-public-keys = [
"cache.vedenemo.dev:RGHheQnb6rXGK5v9gexJZ8iWTPX6OcSeS56YeXYzOcg="
"cache.ssrcdevops.tii.ae:oOrzj9iCppf+me5/3sN/BxEkp5SaFkHfKTPPZ97xXQk="
];
};
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
flake-utils.url = "github:numtide/flake-utils";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
microvm = {
url = "github:astro/microvm.nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
jetpack-nixos = {
url = "github:anduril/jetpack-nixos";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
flake-utils,
nixos-generators,
nixos-hardware,
microvm,
jetpack-nixos,
}: let
systems = with flake-utils.lib.system; [
x86_64-linux
aarch64-linux
riscv64-linux
];
lib = nixpkgs.lib.extend (final: _prev: {
ghaf = import ./lib {
inherit self;
lib = final;
};
});
in
# Combine list of attribute sets together
lib.foldr lib.recursiveUpdate {} [
# Documentation
(flake-utils.lib.eachSystem systems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
packages.doc = pkgs.callPackage ./docs {
revision = lib.version;
options = let
cfg = nixpkgs.lib.nixosSystem {
inherit system;
modules =
lib.ghaf.modules
++ [
jetpack-nixos.nixosModules.default
microvm.nixosModules.host
];
};
in
cfg.options;
};
formatter = pkgs.alejandra;
}))
# ghaf lib
{
lib = lib.ghaf;
}
# Target configurations
(import ./targets {inherit self lib nixpkgs nixos-generators nixos-hardware microvm jetpack-nixos;})
# User apps
(import ./user-apps {inherit lib nixpkgs flake-utils;})
# Hydra jobs
(import ./hydrajobs.nix {inherit self lib;})
#templates
(import ./templates)
];
}