Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase ghaf release 2403 #44

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RA_TOKEN=$3
SSH_DIR="/root/.ssh/"
RESULT_DIR="result/iso/"
RESULT_NAME="nixos.iso"
RESULT_COPY_DIR="./result_to_upload/"
RESULT_COPY_DIR="./"
SYS_USER_NAME="root"

err_print() {
Expand Down
4 changes: 3 additions & 1 deletion .github/actions/upload-action-harbor/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ err_exit() {
exit "$rc"
}

cd $GITHUB_WORKSPACE

echo "::group::Input validation"

[ ! "$HARBOR_URL" ] && err_exit 1 "HARBOR_URL undefined"
Expand Down Expand Up @@ -41,7 +43,7 @@ for input in $INPUT_PATHS; do

UPLOAD_DIR=$SOURCE_DIR
echo "oras push "$HARBOR_URL/$DEST_DIR:$TAG" $UPLOAD_DIR"
oras push --disable-path-validation "$HARBOR_URL/$DEST_DIR:$TAG" $UPLOAD_DIR
oras push "$HARBOR_URL/$DEST_DIR:$TAG" $UPLOAD_DIR
done

echo "::endgroup::"
2 changes: 2 additions & 0 deletions .github/actions/upload-action-jfrog/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ err_exit() {
exit "$rc"
}

cd $GITHUB_WORKSPACE

echo "::group::Input validation"

[ ! "$JFROG_URL" ] && err_exit 1 "JFROG_URL undefined"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jobs:
JFROG_TOKEN: ${{ secrets.JFROG_TOKEN }}
JFROG_URL: ${{ secrets.JFROG_URL }}
input-paths: |
${{ github.workspace }}/${{ steps.build.outputs.outimg }}:tii-fmo-os/releases/FMO-OS_inst_${{ steps.tag.outputs.TAG_VERSION }}.iso
${{ steps.build.outputs.outimg }}:tii-fmo-os/releases/FMO-OS_inst_${{ steps.tag.outputs.TAG_VERSION }}.iso
- name: Push to Harbor artifactory
uses: ./.github/actions/upload-action-harbor
with:
HARBOR_UNAME: ${{ secrets.HARBOR_UNAME }}
HARBOR_TOKEN: ${{ secrets.HARBOR_TOKEN }}
HARBOR_URL: ${{ secrets.HARBOR_URL }}
input-paths: |
${{ github.workspace }}/${{ steps.build.outputs.outimg }}:fmo/pmc-installer:${{ steps.tag.outputs.TAG_VERSION }}
${{ steps.build.outputs.outimg }}:fmo/pmc-installer:${{ steps.tag.outputs.TAG_VERSION }}

29 changes: 18 additions & 11 deletions config-processor-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
}:
let
updateAttrs = (import ./utils/updateAttrs.nix).updateAttrs;
updateHostConfig = (import ./utils/updateHostConfig.nix).updateHostConfig;

targetconf = if lib.hasAttr "extend" sysconf
then updateAttrs false (import (lib.path.append ./hardware sysconf.extend) ).sysconf sysconf
Expand All @@ -23,7 +24,7 @@ let
system = "x86_64-linux";
vms = targetconf.vms;

importvm = vmconf: (import ./modules/virtualization/microvm/vm.nix {inherit ghafOS vmconf;});
importvm = vmconf: (import ./modules/virtualization/microvm/vm.nix {inherit ghafOS vmconf self;});
enablevm = vm: {
virtualization.microvm.${vm.name} = {
enable = true;
Expand All @@ -41,15 +42,20 @@ let
modules =
[
microvm.nixosModules.host
(import "${ghafOS}/modules/host")
(import "${ghafOS}/modules/virtualization/microvm/microvm-host.nix")
self.nixosModules.fmo-configs
self.nixosModules.ghaf-common
ghafOS.nixosModules.host

(import "${ghafOS}/modules/microvm/networking.nix")
(import "${ghafOS}/modules/microvm/virtualization/microvm/microvm-host.nix")
{
ghaf = lib.mkMerge (
[
{
hardware.x86_64.common.enable = true;

virtualization.microvm-host.enable = true;
virtualization.microvm-host.hostNetworkSupport = true;
host.networking.enable = true;

# Enable all the default UI applications
Expand All @@ -76,9 +82,8 @@ let
];
}
]
++ updateHostConfig {inherit lib; inherit targetconf;}
++ map (vm: importvm vms.${vm}) (builtins.attrNames vms)
++ (import "${ghafOS}/modules/module-list.nix")
++ (import ./modules/fmo-module-list.nix)
++ extraModules
++ (if lib.hasAttr "extraModules" targetconf then targetconf.extraModules else []);
};
Expand All @@ -87,16 +92,18 @@ let
name = "${name}-${variant}";
package = hostConfiguration.config.system.build.${hostConfiguration.config.formatAttr};
};
debugModules = [(import "${ghafOS}/modules/development/usb-serial.nix") {ghaf.development.usb-serial.enable = true;}];
debugModules = [{ghaf.development.usb-serial.enable = true;}];
targets = [
(target "debug" debugModules)
(target "release" [])
];
in {
nixosConfigurations =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.hostConfiguration) targets);
packages = {
x86_64-linux =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.package) targets);
flake = {
nixosConfigurations =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.hostConfiguration) targets);
packages = {
x86_64-linux =
builtins.listToAttrs (map (t: lib.nameValuePair t.name t.package) targets);
};
};
}
40 changes: 31 additions & 9 deletions config-processor-installers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,40 @@ let
specialArgs = {inherit lib; inherit ghafOS;};
modules =
[
(import "${ghafOS}/modules/host")
self.nixosModules.installer
self.nixosModules.ghaf-common

({modulesPath, lib, config, ...}: {
imports = [ (modulesPath + "/profiles/all-hardware.nix") ];

nixpkgs.hostPlatform.system = system;
nixpkgs.config.allowUnfree = true;

hardware.enableAllFirmware = true;

# Installer system profile
# Use less privileged ghaf user
users.users.ghaf = {
isNormalUser = true;
extraGroups = ["wheel" "networkmanager" "video"];
# Allow the graphical user to login without password
initialHashedPassword = "";
};

# Allow the user to log in as root without a password.
users.users.root.initialHashedPassword = "";

ghaf = {
profiles.installer.enable = true;
# Allow passwordless sudo from ghaf user
security.sudo = {
enable = lib.mkDefault true;
wheelNeedsPassword = lib.mkImageMediaOverride false;
};

# Automatically log in at the virtual consoles.
services.getty.autologinUser = lib.mkDefault "ghaf";
})

# Configs for installation
{
installer.includeOSS = {
enable = lib.mkDefault true;
Expand All @@ -66,6 +86,7 @@ let
};
}

# Installer app
{
installer.${installerconf.installer.name} = installerApp installerconf.installer;
}
Expand All @@ -77,8 +98,7 @@ let
isoImage.squashfsCompression = "lz4";
}
]
++ (import ./modules/fmo-module-list.nix)
++ (import "${ghafOS}/modules/module-list.nix")
#++ (import "${ghafOS}/modules/module-list.nix")
++ extraModules
++ (if lib.hasAttr "extraModules" installerconf then installerconf.extraModules else []);
};
Expand All @@ -87,13 +107,15 @@ let
inherit installerImgCfg system;
installerImgDrv = installerImgCfg.config.system.build.${installerImgCfg.config.formatAttr};
};
debugModules = [(import "${ghafOS}/modules/development/usb-serial.nix") {ghaf.development.usb-serial.enable = true;}];
debugModules = [{ghaf.development.usb-serial.enable = true;}];
targets = [
(installer "debug" debugModules)
(installer "release" [])
];
in {
packages = lib.foldr lib.recursiveUpdate {} (map ({name, system, installerImgDrv, ...}: {
${system}.${name} = installerImgDrv;
}) targets);
flake = {
packages = lib.foldr lib.recursiveUpdate {} (map ({name, system, installerImgDrv, ...}: {
${system}.${name} = installerImgDrv;
}) targets);
};
}
Loading
Loading