-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor module structure into groups of modules
Refactor module structure into specific groups of modules, which integrate features from other flakes into the ghaf flake: * common * desktop * disko * host * jetpack * jetpack-microvm * lanzaboote * polarfire Also fix targets to use these new module groups, and export them from flake. Signed-off-by: Mika Tammi <[email protected]>
- Loading branch information
1 parent
a4db661
commit cc0d2d7
Showing
125 changed files
with
339 additions
and
215 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,6 +168,7 @@ | |
|
||
imports = [ | ||
./overlays | ||
./modules | ||
./nix | ||
./packages | ||
./targets | ||
|
File renamed without changes.
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,48 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# TODO: Refactor even more. | ||
# This is the old "host/default.nix" file. | ||
{ | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
imports = [ | ||
# TODO remove this when the minimal config is defined | ||
# Replace with the baseModules definition | ||
# UPDATE 26.07.2023: | ||
# This line breaks build of GUIVM. No investigations of a | ||
# root cause are done so far. | ||
#(modulesPath + "/profiles/minimal.nix") | ||
]; | ||
|
||
config = { | ||
system.stateVersion = lib.trivial.release; | ||
|
||
#### | ||
# temp means to reduce the image size | ||
# TODO remove this when the minimal config is defined | ||
appstream.enable = false; | ||
|
||
systemd.package = pkgs.systemd.override ({ | ||
withCryptsetup = false; | ||
withDocumentation = false; | ||
withFido2 = false; | ||
withHomed = false; | ||
withHwdb = false; | ||
withLibBPF = true; | ||
withLocaled = false; | ||
withPCRE2 = false; | ||
withPortabled = false; | ||
withTpm2Tss = false; | ||
withUserDb = false; | ||
} | ||
// lib.optionalAttrs (lib.hasAttr "withRepart" (lib.functionArgs pkgs.systemd.override)) { | ||
withRepart = false; | ||
}); | ||
|
||
boot.enableContainers = false; | ||
##### Remove to here | ||
}; | ||
} |
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,19 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Common ghaf modules | ||
# | ||
{ | ||
imports = [ | ||
./boot/systemd-boot-dtb.nix | ||
./common.nix | ||
./development | ||
./firewall | ||
./hardware | ||
./profiles | ||
./tpm2 | ||
./users/accounts.nix | ||
./version | ||
./virtualization/docker.nix | ||
]; | ||
} |
File renamed without changes.
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,10 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./debug-tools.nix | ||
./usb-serial.nix | ||
./nix.nix | ||
./ssh.nix | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,9 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./x86_64-linux.nix | ||
./x86_64-generic | ||
./definition.nix | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,10 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./kernel/guest | ||
./kernel/hardening.nix | ||
./kernel/host | ||
./kernel/host/pkvm | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./debug.nix | ||
./release.nix | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,17 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Modules to be exported from Flake | ||
# | ||
_: { | ||
flake.nixosModules = { | ||
common = import ./common; | ||
desktop = import ./desktop; | ||
host = import ./host; | ||
jetpack = import ./jetpack; | ||
jetpack-microvm = import ./jetpack-microvm; | ||
lanzaboote = import ./lanzaboote; | ||
microvm = import ./microvm; | ||
polarfire = import ./polarfire; | ||
}; | ||
} |
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,12 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# Ghaf Desktop Experience | ||
# | ||
{ | ||
imports = [ | ||
./graphics | ||
./profiles | ||
./windows-launcher | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./applications.nix | ||
./graphics.nix | ||
]; | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,53 +1,15 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
lib, | ||
pkgs, | ||
... | ||
}: { | ||
imports = [ | ||
# TODO remove this when the minimal config is defined | ||
# Replace with the baseModules definition | ||
# UPDATE 26.07.2023: | ||
# This line breaks build of GUIVM. No investigations of a | ||
# root cause are done so far. | ||
#(modulesPath + "/profiles/minimal.nix") | ||
|
||
# TODO: Refactor this under virtualization/microvm/host/networking.nix | ||
./networking.nix | ||
# | ||
# Modules that should be only imported to host | ||
# | ||
{lib, ...}: { | ||
networking.hostName = lib.mkDefault "ghaf-host"; | ||
|
||
# Overlays should be only defined for host, because microvm.nix uses the | ||
# pkgs that already has overlays in place. Otherwise the overlay will be | ||
# applied twice. | ||
nixpkgs.overlays = [ | ||
(import ../../overlays/custom-packages) | ||
]; | ||
|
||
config = { | ||
networking.hostName = "ghaf-host"; | ||
system.stateVersion = lib.trivial.release; | ||
|
||
nixpkgs.overlays = [ | ||
(import ../../overlays/custom-packages) | ||
]; | ||
|
||
#### | ||
# temp means to reduce the image size | ||
# TODO remove this when the minimal config is defined | ||
appstream.enable = false; | ||
|
||
systemd.package = pkgs.systemd.override ({ | ||
withCryptsetup = false; | ||
withDocumentation = false; | ||
withFido2 = false; | ||
withHomed = false; | ||
withHwdb = false; | ||
withLibBPF = true; | ||
withLocaled = false; | ||
withPCRE2 = false; | ||
withPortabled = false; | ||
withTpm2Tss = false; | ||
withUserDb = false; | ||
} | ||
// lib.optionalAttrs (lib.hasAttr "withRepart" (lib.functionArgs pkgs.systemd.override)) { | ||
withRepart = false; | ||
}); | ||
|
||
boot.enableContainers = false; | ||
##### Remove to here | ||
}; | ||
} |
File renamed without changes.
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,8 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./nx-netvm-ethernet-pci-passthrough.nix | ||
./agx-netvm-wlan-pci-passthrough.nix | ||
]; | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,11 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# ghaf's integration to jetpack-nixos | ||
# | ||
{ | ||
imports = [ | ||
./profiles | ||
./nvidia-jetson-orin | ||
]; | ||
} |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,18 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: let | ||
cfg = config.ghaf.profiles.debug; | ||
in { | ||
config = lib.mkIf cfg.enable { | ||
# Enable default accounts and passwords | ||
ghaf.hardware.nvidia.orin.optee = { | ||
xtest = true; | ||
pkcs11-tool = true; | ||
}; | ||
}; | ||
} |
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,7 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{ | ||
imports = [ | ||
./debug.nix | ||
]; | ||
} |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.