forked from tiiuae/ghaf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes: - introduce givc for laptop-x86: rust admin service and client, go agent - add and configure givc modules for Ghaf - replace ssh commands for application and power start Notes: - TLS is turned off, will be added later Signed-off-by: Manuel Bluhm <[email protected]>
- Loading branch information
1 parent
1fb154f
commit b7fe4a3
Showing
31 changed files
with
550 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,10 @@ in | |
# to build ghaf on target | ||
|
||
git | ||
|
||
# Grpc testing | ||
|
||
grpcurl | ||
; | ||
} | ||
++ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ config, lib, ... }: | ||
let | ||
cfg = config.ghaf.givc.adminvm; | ||
inherit (lib) mkEnableOption mkIf; | ||
in | ||
{ | ||
options.ghaf.givc.adminvm = { | ||
enable = mkEnableOption "Enable adminvm givc module."; | ||
}; | ||
|
||
config = mkIf (cfg.enable && config.ghaf.givc.enable) { | ||
# Configure admin service | ||
givc.admin = { | ||
enable = true; | ||
inherit (config.ghaf.givc.adminConfig) name; | ||
inherit (config.ghaf.givc.adminConfig) addr; | ||
inherit (config.ghaf.givc.adminConfig) port; | ||
inherit (config.ghaf.givc.adminConfig) protocol; | ||
services = [ | ||
"givc-ghaf-host-debug.service" | ||
"givc-net-vm.service" | ||
"givc-gui-vm.service" | ||
"givc-audio-vm.service" | ||
]; | ||
tls.enable = config.ghaf.givc.enableTls; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
config, | ||
lib, | ||
givc, | ||
... | ||
}: | ||
let | ||
cfg = config.ghaf.givc.appvm; | ||
inherit (lib) | ||
mkOption | ||
mkEnableOption | ||
mkIf | ||
types | ||
; | ||
vmEntry = vm: builtins.filter (x: x.name == vm) config.ghaf.networking.hosts.entries; | ||
address = vm: lib.head (builtins.map (x: x.ip) (vmEntry vm)); | ||
in | ||
{ | ||
options.ghaf.givc.appvm = { | ||
enable = mkEnableOption "Enable appvm givc module."; | ||
name = mkOption { | ||
type = types.str; | ||
default = "appvm"; | ||
description = "Name of the appvm."; | ||
}; | ||
applications = mkOption { | ||
type = types.str; | ||
default = "{}"; | ||
description = "Applications to run in the appvm."; | ||
}; | ||
}; | ||
|
||
config = mkIf (cfg.enable && config.ghaf.givc.enable) { | ||
# Configure appvm service | ||
givc.appvm = { | ||
enable = true; | ||
inherit (cfg) name; | ||
inherit (cfg) applications; | ||
addr = address cfg.name; | ||
port = "9000"; | ||
tls.enable = config.ghaf.givc.enableTls; | ||
admin = config.ghaf.givc.adminConfig; | ||
}; | ||
|
||
# Quick fix to allow linger (linger option in user def. currently doesn't work, e.g., bc mutable) | ||
systemd.tmpfiles.rules = [ "f /var/lib/systemd/linger/${config.ghaf.users.accounts.user}" ]; | ||
}; | ||
} |
Oops, something went wrong.