diff --git a/modules/common/logging/hw-mac-retrieve.nix b/modules/common/logging/hw-mac-retrieve.nix index df0f9acf0..0f674edbc 100644 --- a/modules/common/logging/hw-mac-retrieve.nix +++ b/modules/common/logging/hw-mac-retrieve.nix @@ -1,6 +1,6 @@ # Copyright 2022-2024 TII (SSRC) and the Ghaf contributors # SPDX-License-Identifier: Apache-2.0 -{ hostConfig }: +{ hostConfig }: { config, lib, @@ -13,7 +13,7 @@ let macCommand = "${pkgs.hwinfo}/bin/hwinfo --network --only /class/net/wlp0s5f0 | ${pkgs.gawk}/bin/awk '/Permanent HW Address/ {print $4}'"; macAddressPath = config.ghaf.logging.identifierFilePath; in - { +{ options.ghaf.logging.identifierFilePath = lib.mkOption { description = '' This configuration option used to specify the identifier file path. @@ -29,7 +29,11 @@ in # TODO: Remove hw-mac.service and replace with givc rpc later systemd.services."hw-mac" = { description = "Retrieve MAC address from net-vm"; - wantedBy = if hostConfig.ghaf.virtualization.microvm.guivm.enable then [ "ewwbar.service" ] else [ "alloy.service" ]; + wantedBy = + if hostConfig.ghaf.virtualization.microvm.guivm.enable then + [ "ewwbar.service" ] + else + [ "alloy.service" ]; requires = [ "network-online.target" ]; serviceConfig = { Type = "oneshot"; diff --git a/modules/microvm/virtualization/microvm/adminvm.nix b/modules/microvm/virtualization/microvm/adminvm.nix index 8a79a8cbb..4088a17df 100644 --- a/modules/microvm/virtualization/microvm/adminvm.nix +++ b/modules/microvm/virtualization/microvm/adminvm.nix @@ -22,7 +22,7 @@ let internalIP = 10; }) # We need to retrieve mac address and start log aggregator - (import ../../../common/logging/hw-mac-retrieve.nix { hostConfig=config; }) + (import ../../../common/logging/hw-mac-retrieve.nix { hostConfig = config; }) ../../../common/logging/logs-aggregator.nix ./common/storagevm.nix ( diff --git a/modules/microvm/virtualization/microvm/guivm.nix b/modules/microvm/virtualization/microvm/guivm.nix index aa941ba15..721c0d3c5 100644 --- a/modules/microvm/virtualization/microvm/guivm.nix +++ b/modules/microvm/virtualization/microvm/guivm.nix @@ -30,8 +30,8 @@ let # To push logs to central location ../../../common/logging/client.nix - - (import ../../../common/logging/hw-mac-retrieve.nix { hostConfig=config; }) + + (import ../../../common/logging/hw-mac-retrieve.nix { hostConfig = config; }) ( { lib, pkgs, ... }: @@ -180,7 +180,20 @@ let pkgs.eww pkgs.wlr-randr ] - ++ [ pkgs.ctrl-panel ] + ++ [ + pkgs.ctrl-panel + (pkgs.writeShellApplication { + name = "github-config"; + text = '' + mkdir -p "$HOME"/.config/ctrl-panel + cat > "$HOME"/.config/ctrl-panel/config.toml << EOF + token = "${cfg.githubToken}" + owner = "${cfg.githubOwner}" + repo = "${cfg.githubRepo}" + EOF + ''; + }) + ] ++ (lib.optional ( config.ghaf.profiles.debug.enable && config.ghaf.virtualization.microvm.idsvm.mitmproxy.enable ) pkgs.mitmweb-ui) @@ -193,6 +206,7 @@ let sessionVariables = { XDG_PICTURES_DIR = "$HOME/Pictures"; XDG_VIDEOS_DIR = "$HOME/Videos"; + GITHUB_CONFIG = "$HOME/.config/ctrl-panel/config.toml"; }; }; @@ -308,6 +322,25 @@ in Context Identifier (CID) of the GUIVM VSOCK ''; }; + + githubOwner = lib.mkOption { + type = lib.types.str; + description = '' + Github owner account of the bug reporter issue + ''; + }; + githubRepo = lib.mkOption { + type = lib.types.str; + description = '' + Github repo of the bug reporter issue + ''; + }; + githubToken = lib.mkOption { + type = lib.types.str; + description = '' + Personal token of the bug reporter Github account + ''; + }; }; config = lib.mkIf cfg.enable { diff --git a/modules/reference/profiles/laptop-x86.nix b/modules/reference/profiles/laptop-x86.nix index 93b7c6d85..dda2d01a7 100644 --- a/modules/reference/profiles/laptop-x86.nix +++ b/modules/reference/profiles/laptop-x86.nix @@ -94,6 +94,9 @@ in guivm = { enable = true; extraModules = cfg.guivmExtraModules; + githubToken = "xxxxxxxxxxxxxxxxxxxx"; + githubOwner = "yyyyy"; + githubRepo = "zzzzzz"; }; audiovm = {