Skip to content

Commit

Permalink
Create testing profile for non-default features
Browse files Browse the repository at this point in the history
This patch enables features that are needed for testing and validation,
which are not currently enabled by defualt in the standard MVP image.

The corresponding image is intended only for the bi-weekly regression
tests at present.

Signed-off-by: Brian McGillion <[email protected]>
  • Loading branch information
brianmcgillion committed Sep 4, 2024
1 parent 15f2fd6 commit 7bb0c8e
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 10 deletions.
7 changes: 6 additions & 1 deletion modules/microvm/virtualization/microvm/guivm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ let
applications.enable = false;
graphics.enable = true;
};

# To enable screen locking set to true
graphics.labwc.autolock.enable = false;
graphics.labwc = {
autolock.enable = lib.mkDefault config.ghaf.graphics.labwc.autolock.enable;
autologinUser = lib.mkDefault config.ghaf.graphics.labwc.autologinUser;
};

development = {
ssh.daemon.enable = lib.mkDefault config.ghaf.development.ssh.daemon.enable;
debug.tools.enable = lib.mkDefault config.ghaf.development.debug.tools.enable;
Expand Down
1 change: 1 addition & 0 deletions modules/reference/profiles/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
imports = [
./laptop-x86.nix
./mvp-user-trial.nix
./mvp-user-trial-extras.nix
];
}
53 changes: 53 additions & 0 deletions modules/reference/profiles/mvp-user-trial-extras.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{ config, lib, ... }:
let
cfg = config.ghaf.reference.profiles.mvp-user-trial-extras;
in
{
imports = [ ./mvp-user-trial.nix ];

options.ghaf.reference.profiles.mvp-user-trial-extras = {
enable = lib.mkEnableOption "Enable the mvp configuration for apps and services";
};

config = lib.mkIf cfg.enable {
ghaf = {
reference = {
profiles = {
mvp-user-trial.enable = true;
};

programs = {
windows-launcher = {
enable = true;
spice = true;
};
};
};

profiles = {
# Enable below option for host hardening features
# Secure Boot
host-hardening.enable = true;
};

virtualization.microvm = {
# Enable idsvm and the MiTM features
idsvm = {
enable = lib.mkForce true;
mitmproxy.enable = lib.mkForce true;
};
};

# Enable below option for session lock feature
graphics = {
boot.enable = lib.mkForce true;
labwc = {
autolock.enable = lib.mkForce true;
autologinUser = lib.mkForce null;
};
};
};
};
}
9 changes: 2 additions & 7 deletions modules/reference/profiles/mvp-user-trial.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ in

config = lib.mkIf cfg.enable {
ghaf = {
graphics.labwc.autolock.enable = false;

reference = {
appvms = {
enable = true;
Expand All @@ -34,13 +36,6 @@ in
dendrite = true;
};

programs = {
windows-launcher = {
enable = false;
spice = false;
};
};

personalize = {
keys.enable = true;
};
Expand Down
18 changes: 18 additions & 0 deletions targets/laptop/flake-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ let
};
}
])
(laptop-configuration "lenovo-x1-extras" "debug" [
self.nixosModules.disko-ab-partitions-v1
{
ghaf = {
hardware.definition.configFile = "/lenovo-x1/definitions/x1-gen11.nix";
reference.profiles.mvp-user-trial-extras.enable = true;
};
}
])
(laptop-configuration "dell-latitude-7230" "debug" [
self.nixosModules.disko-basic-partition-v1
{
Expand Down Expand Up @@ -71,6 +80,15 @@ let
};
}
])
(laptop-configuration "lenovo-x1-extras" "release" [
self.nixosModules.disko-ab-partitions-v1
{
ghaf = {
hardware.definition.configFile = "/lenovo-x1/definitions/x1-gen11.nix";
reference.profiles.mvp-user-trial-extras.enable = true;
};
}
])
(laptop-configuration "dell-latitude-7230" "release" [
self.nixosModules.disko-basic-partition-v1
{
Expand Down
2 changes: 0 additions & 2 deletions targets/laptop/laptop-configuration-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ let
# variant type, turn on debug or release
debug.enable = variant == "debug";
release.enable = variant == "release";
# Enable below option for host hardening features
host-hardening.enable = false;
};
};
})
Expand Down

0 comments on commit 7bb0c8e

Please sign in to comment.