Skip to content

Commit 5e5a57e

Browse files
committed
feat(network+givc):
Updates: - update flake inputs: givc, ctrl-panel Changes to networking: - auto-generate IP and MAC addresses - remove 'debug' network from ghaf. We can simply remove the host from network in release and facilitate communication over mem share Changes to givc: - enable tls - enable multiple admin service interfaces - centralize givc-cli arguments across ghaf Signed-off-by: Manuel Bluhm <manuel@ssrc.tii.ae>
1 parent 489db31 commit 5e5a57e

File tree

44 files changed

+427
-417
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+427
-417
lines changed

flake.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
};
145145

146146
givc = {
147-
url = "github:tiiuae/ghaf-givc/63e19e1b61a669a21c1bdd0ae5a8e169b2f2d2f6";
147+
url = "github:tiiuae/ghaf-givc/be9c368d935bd1b2bc61b89df8dbf62c3b5d8395";
148148
inputs = {
149149
nixpkgs.follows = "nixpkgs";
150150
flake-parts.follows = "flake-parts";
@@ -156,7 +156,7 @@
156156
};
157157

158158
ctrl-panel = {
159-
url = "github:tiiuae/ghaf-ctrl-panel/5ca381ba51c05cf370299056f6e377cd6003283f";
159+
url = "github:tiiuae/ghaf-ctrl-panel/ef4b843c975030a8156390e3aa6f5536da0ad5c9";
160160
inputs = {
161161
nixpkgs.follows = "nixpkgs";
162162
flake-utils.follows = "flake-utils";
@@ -170,31 +170,38 @@
170170
let
171171
lib = import ./lib.nix { inherit inputs; };
172172
in
173-
flake-parts.lib.mkFlake { inherit inputs; } {
174-
# Toggle this to allow debugging in the repl
175-
# see:https://flake.parts/debug
176-
debug = false;
177-
178-
systems = [
179-
"x86_64-linux"
180-
"aarch64-linux"
181-
# RISC-V is a target built from cross compilation and is not
182-
# included as a host build possibility at this point
183-
# Future HW permitting this can be re-evaluated
184-
#"riscv64-linux"
185-
];
186-
187-
imports = [
188-
./overlays/flake-module.nix
189-
./modules/flake-module.nix
190-
./nix/flake-module.nix
191-
./packages/flake-module.nix
192-
./targets/flake-module.nix
193-
./hydrajobs/flake-module.nix
194-
./templates/flake-module.nix
195-
./tests/flake-module.nix
196-
];
197-
198-
flake.lib = lib;
199-
};
173+
flake-parts.lib.mkFlake
174+
{
175+
inherit inputs;
176+
specialArgs = {
177+
inherit lib;
178+
};
179+
}
180+
{
181+
# Toggle this to allow debugging in the repl
182+
# see:https://flake.parts/debug
183+
debug = false;
184+
185+
systems = [
186+
"x86_64-linux"
187+
"aarch64-linux"
188+
# RISC-V is a target built from cross compilation and is not
189+
# included as a host build possibility at this point
190+
# Future HW permitting this can be re-evaluated
191+
#"riscv64-linux"
192+
];
193+
194+
imports = [
195+
./overlays/flake-module.nix
196+
./modules/flake-module.nix
197+
./nix/flake-module.nix
198+
./packages/flake-module.nix
199+
./targets/flake-module.nix
200+
./hydrajobs/flake-module.nix
201+
./templates/flake-module.nix
202+
./tests/flake-module.nix
203+
];
204+
205+
flake.lib = lib;
206+
};
200207
}

modules/common/common.nix

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,20 @@
33
#
44
# TODO: Refactor even more.
55
# This is the old "host/default.nix" file.
6-
{ lib, ... }:
6+
#
7+
# ghaf.common: Interface to share ghaf configs from host to VMs
8+
#
9+
{ config, lib, ... }:
10+
let
11+
inherit (builtins) attrNames hasAttr;
12+
inherit (lib)
13+
mkOption
14+
types
15+
optionalAttrs
16+
optionalString
17+
attrsets
18+
;
19+
in
720
{
821
imports = [
922
# TODO remove this when the minimal config is defined
@@ -14,7 +27,49 @@
1427
#(modulesPath + "/profiles/minimal.nix")
1528
];
1629

30+
options.ghaf = {
31+
common = {
32+
vms = mkOption {
33+
type = types.listOf types.str;
34+
default = [ ];
35+
description = "List of VMs currently enabled.";
36+
};
37+
systemHosts = mkOption {
38+
type = types.listOf types.str;
39+
default = [ ];
40+
description = "List of system hosts currently enabled.";
41+
};
42+
appHosts = mkOption {
43+
type = types.listOf types.str;
44+
default = [ ];
45+
description = "List of app hosts currently enabled.";
46+
};
47+
};
48+
type = mkOption {
49+
description = "Type of the ghaf component. One of 'host', 'system-vm', or 'app-vm'.";
50+
type = types.str;
51+
};
52+
};
53+
1754
config = {
55+
56+
# Populate the shared namespace
57+
ghaf = optionalAttrs (hasAttr "microvm" config) {
58+
common = optionalAttrs (hasAttr "vms" config.microvm) {
59+
vms = attrNames config.microvm.vms;
60+
systemHosts = lib.lists.remove "" (
61+
lib.attrsets.mapAttrsToList (
62+
n: v: lib.optionalString (v.config.config.ghaf.type == "system-vm") n
63+
) config.microvm.vms
64+
);
65+
appHosts = lib.lists.remove "" (
66+
lib.attrsets.mapAttrsToList (
67+
n: v: lib.optionalString (v.config.config.ghaf.type == "app-vm") n
68+
) config.microvm.vms
69+
);
70+
};
71+
};
72+
1873
system.stateVersion = lib.trivial.release;
1974

2075
####
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
22
# SPDX-License-Identifier: Apache-2.0
3-
{ imports = [ ./hosts.nix ]; }
3+
{
4+
imports = [
5+
./hosts.nix
6+
];
7+
}

0 commit comments

Comments
 (0)