treewide: move hardware into modules

This commit is contained in:
Anthony Rodriguez 2025-01-14 12:34:01 +01:00
parent 7d1baf7eb5
commit 07a9c5f510
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
14 changed files with 123 additions and 90 deletions

View file

@ -2,9 +2,6 @@
imports = [ imports = [
./nix ./nix
./hardware/printing.nix
./hardware/fwupd.nix
./network ./network
./programs ./programs

View file

@ -1,3 +0,0 @@
{
services.fprintd.enable = true;
}

View file

@ -1,3 +0,0 @@
{
services.fwupd.enable = true;
}

View file

@ -1,9 +0,0 @@
{
inputs,
pkgs,
...
}: {
services.udev.packages = [
inputs.self.packages.${pkgs.system}.mcuxpresso
];
}

View file

@ -1,28 +0,0 @@
{pkgs, ...}: {
services = {
# setup printing service
printing.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
printing.drivers = [
pkgs.gutenprint
pkgs.hplip
];
udev.packages = [
pkgs.sane-airscan
pkgs.utsushi
];
};
hardware.sane.enable = true; # enables support for SANE scanners
hardware.sane.extraBackends = [
pkgs.sane-airscan # generic
pkgs.hplip # HP
pkgs.utsushi # other printers
];
}

View file

@ -1,37 +0,0 @@
{pkgs, ...}: {
hardware.uni-sync = {
enable = true;
devices = [
{
device_id = "VID:3314/PID:41218/SN:6243168001";
sync_rgb = true;
channels = [
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
];
}
];
};
systemd.services.uni-sync = {
enable = true;
serviceConfig = {
ExecStart = "${pkgs.uni-sync}/bin/uni-sync";
};
wantedBy = ["multi-user.target"];
};
}

View file

@ -1,7 +0,0 @@
{pkgs, ...}: {
hardware.keyboard.qmk.enable = true;
environment.systemPackages = with pkgs; [
via
];
services.udev.packages = [pkgs.via];
}

View file

@ -1,5 +1,7 @@
{lib, ...}: { {lib, ...}: {
imports = [ imports = [
./hardware
./boot.nix ./boot.nix
./home-manager.nix ./home-manager.nix
./locales.nix ./locales.nix

View file

@ -0,0 +1,9 @@
{
imports = [
./fprintd.nix
./fwupd.nix
./printing.nix
./uni-sync.nix
./via.nix
];
}

View file

@ -0,0 +1,9 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.local.profiles.laptop.enable {
services.fprintd.enable = true;
};
}

View file

@ -0,0 +1,9 @@
{
lib,
config,
...
}: {
config = lib.mkIf config.local.profiles.desktop.enable {
services.fwupd.enable = true;
};
}

View file

@ -0,0 +1,36 @@
{
lib,
pkgs,
config,
...
}: {
config = lib.mkIf config.local.profiles.desktop.enable {
services = {
# setup printing service
printing.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
printing.drivers = [
pkgs.gutenprint
pkgs.hplip
];
udev.packages = [
pkgs.sane-airscan
pkgs.utsushi
];
};
hardware.sane.enable = true; # enables support for SANE scanners
hardware.sane.extraBackends = [
pkgs.sane-airscan # generic
pkgs.hplip # HP
pkgs.utsushi # other printers
];
};
}

View file

@ -0,0 +1,44 @@
{
lib,
pkgs,
config,
...
}: {
config = lib.mkIf config.local.profiles.gaming.enable {
hardware.uni-sync = {
enable = true;
devices = [
{
device_id = "VID:3314/PID:41218/SN:6243168001";
sync_rgb = true;
channels = [
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
{
mode = "Manual";
speed = 60;
}
];
}
];
};
systemd.services.uni-sync = {
enable = true;
serviceConfig = {
ExecStart = "${pkgs.uni-sync}/bin/uni-sync";
};
wantedBy = ["multi-user.target"];
};
};
}

View file

@ -0,0 +1,14 @@
{
lib,
pkgs,
config,
...
}: {
config = lib.mkIf config.local.profiles.gaming.enable {
hardware.keyboard.qmk.enable = true;
environment.systemPackages = with pkgs; [
via
];
services.udev.packages = [pkgs.via];
};
}