refactor: implement component-based architecture for enhanced maintainability
- Reorganize directory structure into core/, features/, and themes/ - Colocate application Nix logic, configs, scripts, and theme overrides - Implement 'Inversion of Control' for theming: apps now pull theme-specific layouts - Update flake.nix and shared library paths to match the new structure - Document the new Feature-Centric architecture in README.md
This commit is contained in:
68
core/system/hardware.nix
Normal file
68
core/system/hardware.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.nomarchy.hardware;
|
||||
in
|
||||
{
|
||||
options.nomarchy.hardware = {
|
||||
isXPS = mkEnableOption "Dell XPS specific hardware fixes";
|
||||
isT2Mac = mkEnableOption "Apple T2 MacBook specific hardware fixes";
|
||||
isFramework = mkEnableOption "Framework laptop specific hardware fixes";
|
||||
hasIPU7Camera = mkEnableOption "Intel IPU7 camera support";
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(mkIf cfg.isXPS {
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="pci", KERNEL=="0000:00:19.0", ATTR{power/control}="on"
|
||||
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="i2c_designware.0", ATTR{power/control}="on"
|
||||
'';
|
||||
|
||||
systemd.services.nomarchy-haptic-touchpad = {
|
||||
description = "Dell XPS haptic touchpad feedback";
|
||||
after = [ "systemd-udev-settle.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${config.home-manager.users.${config.services.displayManager.autoLogin.user}.home.homeDirectory}/.nix-profile/bin/nomarchy-haptic-touchpad";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "2";
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf cfg.isFramework {
|
||||
services.udev.extraRules = ''
|
||||
# Framework 16 QMK HID
|
||||
SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0012", MODE="0666", GROUP="users"
|
||||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.isT2Mac {
|
||||
boot.kernelParams = [ "intel_iommu=on" "iommu=pt" "pcie_ports=compat" ];
|
||||
boot.kernelModules = [ "apple-bce" ];
|
||||
boot.extraModprobeConfig = ''
|
||||
options brcmfmac feature_disable=0x82000
|
||||
'';
|
||||
})
|
||||
|
||||
# System Features
|
||||
(mkIf config.nomarchy.system.features.fingerprint {
|
||||
services.fprintd.enable = true;
|
||||
})
|
||||
|
||||
(mkIf config.nomarchy.system.features.fido2 {
|
||||
security.pam.u2f = {
|
||||
enable = true;
|
||||
control = "sufficient";
|
||||
cue = true;
|
||||
};
|
||||
})
|
||||
|
||||
(mkIf config.nomarchy.system.features.hybridGPU {
|
||||
services.supergfxd.enable = true;
|
||||
systemd.services.supergfxd.serviceConfig.ExecStartPre = "-${pkgs.coreutils}/bin/sleep 5";
|
||||
})
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user