Skip to content

Commit

Permalink
FMO-81: Merge fmo-os images into fmo-os-x86_64
Browse files Browse the repository at this point in the history
- Create x86_64-devices containing pci device map and rugged-devices.nix for pci info of rugged devices
- Create systemd service to write pci device paths into config file for microvm
- Map touch device in sway via a script
- Clean up tablet and laptop config file
- Build targets are:
  + fmo-os-x86_64-rugged-devices-debug / fmo-os-x86_64-rugged-devices-release
  + fmo-os-x86_64-public-rugged-devices-debug / fmo-os-x86_64-public-rugged-devices-release
  + fmo-os-installer-debug / fmo-os-installer-release
  + fmo-os-installer-public-debug / fmo-os-installer-public-release

Signed-off-by: Anh Huy Bui <[email protected]>
  • Loading branch information
buianhhuy96 committed Dec 11, 2024
1 parent 85aa13e commit 70723ba
Show file tree
Hide file tree
Showing 15 changed files with 159 additions and 431 deletions.
15 changes: 8 additions & 7 deletions config-processor-hardware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
self,
lib,
ghafOS,
devices,
}: sysconf:
let
inherit (import ./utils {inherit lib self ghafOS;})
updateAttrs updateHostConfig addCustomLaunchers addSystemPackages importvm generateFMOToolConfig;
updateAttrs updateHostConfig addHardwareInfo addCustomLaunchers addSystemPackages importvm generateFMOToolConfig;

targetconf = sysconf;
name = targetconf.name;
system = "x86_64-linux";

target = variant: let
target = device: variant: let
hostConfiguration = lib.nixosSystem {
inherit system;
specialArgs = {inherit lib; inherit ghafOS;};
Expand Down Expand Up @@ -43,6 +44,7 @@ let
];
}
]
++ (addHardwareInfo devices.${device})
++ (addCustomLaunchers targetconf.launchers)
++ (addSystemPackages targetconf.systemPackages)
++ (importvm targetconf.vms)
Expand All @@ -52,13 +54,12 @@ let
};
in {
inherit hostConfiguration;
name = "${name}-${variant}";
name = "${name}-${device}-${variant}";
package = hostConfiguration.config.system.build.${hostConfiguration.config.formatAttr};
};
targets = [
(target "debug")
(target "release")
];

targets = (map (device: target device "debug") (builtins.attrNames devices))
++ (map (device: target device "release") (builtins.attrNames devices));
in {
flake = {
nixosConfigurations =
Expand Down
11 changes: 6 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@
};
});

devices = {
rugged-devices = (import ./hardware/x86_64-devices/rugged-devices.nix);
};
hwConfigs = [
(import ./hardware/fmo-os-rugged-laptop-7330.nix)
(import ./hardware/fmo-os-rugged-laptop-7330-public.nix)
(import ./hardware/fmo-os-rugged-tablet-7230.nix)
(import ./hardware/fmo-os-rugged-tablet-7230-public.nix)
(import ./hardware/fmo-os-x86_64.nix)
(import ./hardware/fmo-os-x86_64-public.nix)
];
instConfigs = [
(import ./installers/fmo-os-installer.nix)
Expand All @@ -48,7 +49,7 @@
inheritConfig = confPath: { sysconf }: if lib.hasAttr "extend" sysconf
then updateAttrs ["oss"] (import (lib.path.append confPath sysconf.extend) ).sysconf sysconf
else sysconf;
generateHwConfig = import ./config-processor-hardware.nix {inherit ghafOS self lib;};
generateHwConfig = import ./config-processor-hardware.nix {inherit ghafOS self lib devices;};
generateInstConfig = import ./config-processor-installers.nix {inherit ghafOS self lib;};

in
Expand Down
30 changes: 0 additions & 30 deletions hardware/fmo-os-rugged-laptop-7330-public.nix

This file was deleted.

Loading

0 comments on commit 70723ba

Please sign in to comment.