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

Refactor: Imports structure #1085

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

mbssrc
Copy link
Collaborator

@mbssrc mbssrc commented Mar 19, 2025

Description of changes

Make more flake-modules, and various changes. To be discussed.

Checklist for things done

  • Summary of the proposed changes in the PR description
  • More detailed description in the commit message(s)
  • Commits are squashed into relevant entities - avoid a lot of minimal dev time commits in the PR
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • PR linked to architecture documentation and requirement(s) (ticket id)
  • Test procedure described (or includes tests). Select one or more:
    • Tested on Lenovo X1 x86_64
    • Tested on Jetson Orin NX or AGX aarch64
    • Tested on Polarfire riscv64
  • Author has run make-checks and it passes
  • All automatic Github Action checks pass - see actions
  • Author has added reviewers and removed PR draft status
  • Change requires full re-installation
  • Change can be updated with nixos-rebuild ... switch

Instructions for Testing

  • List all targets that this applies to:
    • AGX
    • NX
    • x86_64
  • Is this a new feature
    • List the test steps to verify:
  • If it is an improvement how does it impact existing functionality?

@mbssrc mbssrc temporarily deployed to internal-build-workflow March 19, 2025 14:34 — with GitHub Actions Inactive
inputs.self.nixosModules.hw-laptop
inputs.self.nixosModules.disko-debug-partition
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not add disko here it is not used in all laptop configurations only in the debug ones

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as of now (pre PR#1074), it is. same as current implementation with commonModules. also, the enable flag is now in reference profile, so it can be turned on/off in the settings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it cause issues if the disko module is not imported at all? Since the target in #1074 would not build properly, conflicting options with disko if imported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking here is that we sync the targets identifier and the conditional modules definition, i.e. target = hw + platform profile identifier, with platform profile {mvp, ...} + {debug, release, any-other}. This would allow to move towards a generic interface for a laptop-builder and target definition. Not quite sure if a disk layout configuration at this level is necessary? And could we not just make the namespaces not overlapping? Then, instead of relying on conditional imports we control it via config settings, e.g. using -debug/release or even additional flags

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a min of 3 levels of config that need to be supported.

  1. the hardware config (e.g. x1)
  2. the profile config (e.g. mvp)
  3. the target config ( with customizations available specific to this target definition)

The current laptop targets/laptop/flake-module.nix supports this.

@mbssrc mbssrc temporarily deployed to internal-build-workflow March 20, 2025 06:09 — with GitHub Actions Inactive
ghaf = {
# Enable disk partitioning
partitioning.disko.enable = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all targets would use disko especially with #1074, even the disko module shouldn't be included as that would conflict with certain options.

inputs.self.nixosModules.hw-laptop
inputs.self.nixosModules.disko-debug-partition
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it cause issues if the disko module is not imported at all? Since the target in #1074 would not build properly, conflicting options with disko if imported.

@mbssrc mbssrc temporarily deployed to internal-build-workflow March 26, 2025 21:06 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow March 26, 2025 21:06 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow March 31, 2025 21:39 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow March 31, 2025 21:39 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow March 31, 2025 21:45 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow March 31, 2025 21:45 — with GitHub Actions Inactive
mbssrc added 3 commits April 1, 2025 07:54
Create common and development flake module files.

Signed-off-by: Manuel Bluhm <[email protected]>
Add flake module for desktop.

Signed-off-by: Manuel Bluhm <[email protected]>
Unify and cleanup hardware modules, moving relevant imports to the
places where needed.

Signed-off-by: Manuel Bluhm <[email protected]>
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 03:54 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 03:55 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 03:57 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 03:58 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:12 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:12 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:16 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:16 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:21 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:21 — with GitHub Actions Inactive
- remove hardware definition dependencies
- move shm and mem manager
- initial reference flake module file

Signed-off-by: Manuel Bluhm <[email protected]>
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:33 — with GitHub Actions Inactive
@mbssrc mbssrc temporarily deployed to internal-build-workflow April 1, 2025 09:34 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants