File tree Expand file tree Collapse file tree 13 files changed +74
-20
lines changed
reference/hardware/jetpack/nvidia-jetson-orin
targets/nvidia-jetson-orin Expand file tree Collapse file tree 13 files changed +74
-20
lines changed Original file line number Diff line number Diff line change 105105
106106 # Ghaf Inter VM communication and control library
107107 givc = {
108- url = "github:tiiuae /ghaf-givc" ;
108+ url = "github:vadika /ghaf-givc/vadika/cross-givc-packages " ;
109109 inputs = {
110110 nixpkgs . follows = "nixpkgs" ;
111111 flake-parts . follows = "flake-parts" ;
Original file line number Diff line number Diff line change @@ -108,17 +108,15 @@ let
108108 # 1. ghaf.profiles.{debug,release}.enable for host-side module activation
109109 # 2. ghaf.global-config to the corresponding profile for VM-side config propagation
110110 #
111- # Note: global-config uses mkDefault so that platform-specific profiles (like orin.nix)
112- # can override specific values. For example, orin.nix sets ghaf.givc.enable = false
113- # and this should propagate to VMs via ghaf.global-config.givc.enable.
111+ # Note: global-config uses mkDefault so target modules can still override specific
112+ # values when needed.
113+
114114 variantModule = {
115115 ghaf . profiles = {
116116 debug . enable = variant == "debug" ;
117117 release . enable = variant == "release" ;
118118 } ;
119119 # Set global-config to match the variant's profile using mkDefault
120- # This allows profile modules to override specific global-config values
121- # Example: orin.nix can set ghaf.global-config.givc.enable = false
122120 ghaf . global-config = lib . mapAttrsRecursive ( _ : v : lib . mkDefault v ) (
123121 lib . ghaf . profiles . ${ variant } or lib . ghaf . profiles . minimal
124122 ) ;
Original file line number Diff line number Diff line change 5252 description = "Logging listener address" ;
5353 } ;
5454
55+ serverName = mkOption {
56+ type = types . nullOr types . str ;
57+ default = null ;
58+ description = "Optional TLS server name for validating the admin-vm logging listener certificate" ;
59+ } ;
60+
5561 port = mkOption {
5662 type = types . port ;
5763 default = 9999 ;
Original file line number Diff line number Diff line change 4747 logging . listener . address = lib . mkIf (
4848 config . ghaf . global-config . logging . enable && config . ghaf . common . adminHost != null
4949 ) ( lib . mkDefault config . ghaf . networking . hosts . admin-vm . ipv4 ) ;
50+ # Auto-populate logging TLS server_name for producer-side certificate validation.
51+ logging . listener . serverName = lib . mkIf (
52+ config . ghaf . global-config . logging . enable && config . ghaf . common . adminHost != null
53+ ) ( lib . mkDefault "admin-vm" ) ;
5054 } ;
5155 } ;
5256}
Original file line number Diff line number Diff line change 1111 mkEnableOption
1212 mkOption
1313 types
14+ hasPrefix
1415 optionalString
1516 ;
1617 cfg = config . ghaf . logging . client ;
5859 default = "TLS12" ;
5960 description = "Minimum TLS version for the outbound connection." ;
6061 } ;
62+ serverName = mkOption {
63+ type = types . nullOr types . str ;
64+ default = if listener . serverName != null then listener . serverName else "admin-vm" ;
65+ description = "Expected TLS server_name (SNI) for validating the admin-vm listener certificate." ;
66+ } ;
6167 } ;
6268 } ;
6369
121127 cert_file = sys.env("CREDENTIALS_DIRECTORY") + "/client_cert"
122128 key_file = sys.env("CREDENTIALS_DIRECTORY") + "/client_key"
123129 min_version = "${ cfg . tls . minVersion } "
130+ ${ optionalString ( cfg . tls . serverName != null ) ''server_name = "${ cfg . tls . serverName } "'' }
124131 }
125132 }
126133 }
131138
132139 services . alloy . enable = true ;
133140
141+ systemd . services . alloy . unitConfig . RequiresMountsFor = lib . unique (
142+ lib . optionals ( cfg . tls . certFile != null && hasPrefix "/etc/givc/" ( toString cfg . tls . certFile ) ) [
143+ ( dirOf ( toString cfg . tls . certFile ) )
144+ ]
145+ ++ lib . optionals ( cfg . tls . keyFile != null && hasPrefix "/etc/givc/" ( toString cfg . tls . keyFile ) ) [
146+ ( dirOf ( toString cfg . tls . keyFile ) )
147+ ]
148+ ++ lib . optionals ( cfg . tls . caFile != null && hasPrefix "/etc/givc/" ( toString cfg . tls . caFile ) ) [
149+ ( dirOf ( toString cfg . tls . caFile ) )
150+ ]
151+ ) ;
152+
134153 systemd . services . alloy . serviceConfig = {
135154 after = [
136155 "systemd-journald.service"
Original file line number Diff line number Diff line change 102102 default = 9999 ;
103103 } ;
104104
105+ listener . serverName = mkOption {
106+ description = ''
107+ Optional TLS server name used by log producers when
108+ verifying the admin-vm listener certificate.
109+ '' ;
110+ type = types . nullOr types . str ;
111+ default = null ;
112+ } ;
113+
105114 journalRetention = {
106115 enable = mkOption {
107116 description = ''
Original file line number Diff line number Diff line change 453453 after = [ "systemd-journald.service" ] ;
454454 wants = [ "systemd-journald.service" ] ;
455455
456+ unitConfig = {
457+ RequiresMountsFor = [
458+ cfg . keyPath
459+ "/var/log/journal"
460+ "/run/log/journal"
461+ ] ;
462+ } ;
463+
456464 serviceConfig = {
457465 Type = "oneshot" ;
458466 RemainAfterExit = true ;
477485 unitConfig = {
478486 # Only run if FSS setup has completed successfully
479487 ConditionPathExists = "${ cfg . keyPath } /initialized" ;
488+ RequiresMountsFor = [
489+ cfg . keyPath
490+ "/var/log/journal"
491+ "/run/log/journal"
492+ ] ;
480493 } ;
481494
482495 serviceConfig = {
Original file line number Diff line number Diff line change 114114
115115 # Let systemd use default ordering for audit-rules instead of early-boot
116116 unitConfig . DefaultDependencies = lib . mkForce true ;
117+ unitConfig . RequiresMountsFor = [
118+ "/etc/givc"
119+ "/etc/common/journal-fss"
120+ "/var/log/journal"
121+ ] ;
117122 before = lib . mkForce [ ] ;
118123 } ;
119124
Original file line number Diff line number Diff line change 1515 optionalString
1616 optionals
1717 ;
18+ tlsStoragePath = "/persist/storagevm/givc" ;
1819in
1920{
2021 _file = ./host.nix ;
8081 addr = v . ipv4 ;
8182 } ) config . ghaf . networking . hosts ;
8283 generatorHostName = config . networking . hostName ;
83- storagePath = "/persist/storagevm/givc" ;
84+ storagePath = tlsStoragePath ;
8485 } ;
8586
8687 ghaf . security . audit . extraRules = [
You can’t perform that action at this time.
0 commit comments