-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
73 lines (64 loc) · 2.09 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
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{
description = "FMO-OS - Ghaf based configuration";
nixConfig = {
extra-trusted-substituters = [
"https://prod-cache.vedenemo.dev"
"https://cache.ssrcdevops.tii.ae"
];
extra-trusted-public-keys = [
"prod-cache.vedenemo.dev~1:JcytRNMJJdYJVQCYwLNsrfVhct5dhCK2D3fa6O1WHOI="
"cache.ssrcdevops.tii.ae:oOrzj9iCppf+me5/3sN/BxEkp5SaFkHfKTPPZ97xXQk="
];
};
inputs = rec {
ghafOS.url = "github:tiiuae/ghaf";
};
outputs = inputs @ {
ghafOS,
self,
...
}: let
# Retrieve inputs from Ghaf
nixpkgs = ghafOS.inputs.nixpkgs;
flake-parts = ghafOS.inputs.flake-parts;
lib = nixpkgs.lib.extend (final: _prev: {
ghaf = import "${ghafOS}/lib" {
inherit self;
lib = final;
};
});
hwConfigs = [
(import ./hardware/fmo-os-rugged-devices.nix)
(import ./hardware/fmo-os-rugged-devices-public.nix)
];
instConfigs = [
(import ./installers/fmo-os-installer.nix)
(import ./installers/fmo-os-installer-public.nix)
];
updateAttrs = (import ./utils/updateAttrs.nix).updateAttrs;
inheritConfig = confPath: { sysconf }: if lib.hasAttr "extend" sysconf
then updateAttrs ["oss"] (import (lib.path.append confPath sysconf.extend) ).sysconf sysconf
else sysconf;
generateHwConfig = import ./config-processor-hardware.nix {inherit ghafOS self lib;};
generateInstConfig = import ./config-processor-installers.nix {inherit ghafOS self lib;};
in
flake-parts.lib.mkFlake
{
inherit inputs;
} {
# Toggle this to allow debugging in the repl
# see:https://flake.parts/debug
debug = false;
systems = [
"x86_64-linux"
];
imports = [
./hydrajobs/flake-module.nix
./modules/flake-module.nix
] ++ map generateHwConfig (map (conf: inheritConfig ./hardware conf) hwConfigs)
++ map generateInstConfig (map (conf: inheritConfig ./installers conf) instConfigs);
flake.lib = lib;
};
}