-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- moved hardware from common to a flake-module - re-factored 'generation' as parameter to hardware definition - quick fixed network device required in desktop stack (hw definition not available in vm namespaces) - fix references to modules/common/hardware Signed-off-by: Manuel Bluhm <[email protected]>
- Loading branch information
1 parent
715eb1e
commit a4f747c
Showing
42 changed files
with
135 additions
and
90 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 |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
./common.nix | ||
./development | ||
./firewall | ||
./hardware | ||
./profiles | ||
./security | ||
./tpm2 | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -10,5 +10,6 @@ | |
./fonts.nix | ||
./window-manager.nix | ||
./boot.nix | ||
./hardware.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{lib, ...}: | ||
with lib; { | ||
options.ghaf.graphics.hardware = { | ||
networkDevice = mkOption { | ||
type = types.anything; | ||
default = {}; | ||
description = '' | ||
Network device interface for use with graphics stack. | ||
''; | ||
}; | ||
}; | ||
} |
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.
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,15 @@ | ||
# Copyright 2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
_: { | ||
flake.nixosModules = { | ||
hw-lenovo-x1.imports = [ | ||
./definition.nix | ||
./x86_64-generic | ||
./lenovo-x1 | ||
]; | ||
hw-x86_64-generic.imports = [ | ||
./definition.nix | ||
./x86_64-generic | ||
]; | ||
}; | ||
} |
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,69 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
{ | ||
config, | ||
lib, | ||
... | ||
}: let | ||
hwDefinition = import (./. + "/x1-${config.ghaf.hardware.generation}.nix"); | ||
in { | ||
imports = [ | ||
../../definition.nix | ||
]; | ||
|
||
options.ghaf.hardware.generation = lib.mkOption { | ||
description = "Generation of the hardware configuration"; | ||
type = lib.types.str; | ||
default = "gen11"; | ||
}; | ||
|
||
config = { | ||
ghaf.hardware.definition = { | ||
inherit (hwDefinition) mouse; | ||
inherit (hwDefinition) touchpad; | ||
inherit (hwDefinition) disks; | ||
inherit (hwDefinition) network; | ||
inherit (hwDefinition) gpu; | ||
|
||
virtioInputHostEvdevs = [ | ||
# Lenovo X1 touchpad and keyboard | ||
"/dev/input/by-path/platform-i8042-serio-0-event-kbd" | ||
"/dev/mouse" | ||
"/dev/touchpad" | ||
# Lenovo X1 trackpoint (red button/joystick) | ||
"/dev/input/by-path/platform-i8042-serio-1-event-mouse" | ||
]; | ||
}; | ||
|
||
disko.devices.disk = hwDefinition.disks; | ||
|
||
# Notes: | ||
# 1. This assembles udev rules for different hw configurations (i.e., different mice/touchpads) by adding | ||
# all of them to the configuration. This was chosen for simplicity to not have to provide hw identifier at build, | ||
# but is not ideal and should be changed. | ||
# 2. USB camera "passthrough" is handled by qemu and thus available on host. If peripheral VM is implemented, | ||
# the entire host controller should be passthrough'd using the PCI bus (14.0). In x1, bluetooth and fingerprint | ||
# reader are on this bus. | ||
services.udev.extraRules = let | ||
mapMouseRules = | ||
builtins.map (d: '' SUBSYSTEM=="input", ATTRS{name}=="${d}", KERNEL=="event*", GROUP="kvm", SYMLINK+="mouse" | ||
''); | ||
mapTouchpadRules = | ||
builtins.map (d: '' SUBSYSTEM=="input", ATTRS{name}=="${d}", KERNEL=="event*", GROUP="kvm", SYMLINK+="touchpad" | ||
''); | ||
in '' | ||
# Laptop keyboard | ||
SUBSYSTEM=="input", ATTRS{name}=="AT Translated Set 2 keyboard", GROUP="kvm" | ||
# Laptop TrackPoint | ||
SUBSYSTEM=="input", ATTRS{name}=="TPPS/2 Elan TrackPoint", GROUP="kvm" | ||
# Lenovo X1 integrated webcam | ||
KERNEL=="3-8", SUBSYSTEM=="usb", ATTR{busnum}=="3", ATTR{devnum}=="3", GROUP="kvm" | ||
# Lenovo X1 integrated fingerprint reader | ||
KERNEL=="3-6", SUBSYSTEM=="usb", ATTR{busnum}=="3", ATTR{devnum}=="2", GROUP="kvm" | ||
# Mouse and Touchpad | ||
${lib.strings.concatStrings (mapMouseRules hwDefinition.mouse)} | ||
${lib.strings.concatStrings (mapTouchpadRules hwDefinition.touchpad)} | ||
''; | ||
}; | ||
} |
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 |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
./kernel/hardening.nix | ||
./kernel/host | ||
./kernel/host/pkvm | ||
./x86_64-linux.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.
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
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