-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Clean up config inputs - Refactor nixosModules to their correct functionality, apply in hardware and vm config - Create x86 profile for general host config - Bring config methods into utils/default.nix - Clean up redundant/unncessary configs (debugModules,..) because they are included in ghaf Signed-off-by: Anh Huy Bui <buianhhuy96@gmail.com>
- Loading branch information
1 parent
fe06ad9
commit 4f7f8e0
Showing
8 changed files
with
121 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
config, | ||
lib, | ||
pkgs, | ||
... | ||
}: | ||
let | ||
cfg = config.ghaf.profiles.x86; | ||
in | ||
{ | ||
options.ghaf.profiles.x86 = { | ||
enable = lib.mkEnableOption "Enable the basic x86 laptop config"; | ||
vms = lib.mkOption { | ||
type = lib.types.attrs; | ||
default = {}; | ||
description = '' | ||
Set of VM's configuration. | ||
''; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
ghaf = { | ||
hardware.x86_64.common.enable = true; | ||
host.networking.enable = true; | ||
|
||
profiles.applications.enable = true; | ||
|
||
virtualization= { | ||
microvm-host.enable = true; | ||
microvm-host.networkSupport = true; | ||
} | ||
// builtins.foldl' lib.recursiveUpdate {} | ||
(map (vm: { | ||
microvm.${cfg.vms."${vm}".name} = { | ||
enable = true; | ||
extraModules = | ||
cfg.vms."${vm}".extraModules; | ||
}; | ||
}) (builtins.attrNames cfg.vms)); | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{lib, self, ghafOS}: { | ||
updateAttrs = (import ./updateAttrs.nix).updateAttrs; | ||
|
||
updateHostConfig = (import ./updateHostConfig.nix {inherit lib;}); | ||
|
||
addSystemPackages = (packages: [({pkgs, ...}:{environment.systemPackages = map (app: pkgs.${app}) packages;})]); | ||
|
||
addCustomLaunchers = (launchers: [{ghaf.graphics.app-launchers.enabled-launchers = launchers;}]); | ||
|
||
importvm = (vms: (map (vm: (import ../modules/virtualization/microvm/vm.nix {inherit ghafOS self; vmconf=vms.${vm};}) ) (builtins.attrNames vms))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters