整理 printer 设置

This commit is contained in:
陈浩南 2023-07-18 18:19:00 +08:00
parent 11e6287c26
commit 649c48ce09
3 changed files with 15 additions and 11 deletions

View File

@ -177,6 +177,7 @@
{ {
bluetooth.enable = true; bluetooth.enable = true;
joystick.enable = true; joystick.enable = true;
printer.enable = true;
}; };
packages = packages =
{ {
@ -192,7 +193,6 @@
./modules/sops.nix ./modules/sops.nix
./modules/boot/chn-PC.nix ./modules/boot/chn-PC.nix
[ ./modules/hardware/nvidia-prime.nix { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; } ] [ ./modules/hardware/nvidia-prime.nix { intelBusId = "PCI:0:2:0"; nvidiaBusId = "PCI:1:0:0"; } ]
./modules/hardware/printer.nix
./modules/hardware/sound.nix ./modules/hardware/sound.nix
./modules/hardware/chn-PC.nix ./modules/hardware/chn-PC.nix
./modules/networking/basic.nix ./modules/networking/basic.nix

View File

@ -4,7 +4,19 @@ inputs:
{ {
bluetooth.enable = mkOption { type = types.bool; default = false; }; bluetooth.enable = mkOption { type = types.bool; default = false; };
joystick.enable = mkOption { type = types.bool; default = false; }; joystick.enable = mkOption { type = types.bool; default = false; };
printer.enable = mkOption { type = types.bool; default = false; };
};
config =
{
hardware = {}
// (if inputs.config.nixos.hardware.bluetooth.enable then { bluetooth.enable = true; } else {})
// (if inputs.config.nixos.hardware.joystick.enable then { xone.enable = true; xpadneo.enable = true; } else {});
services = {}
// (if inputs.config.nixos.hardware.printer.enable then
{
printing = { enable = true; drivers = [ inputs.pkgs.cnijfilter2 ]; };
avahi = { enable = true; nssmdns = true; openFirewall = true; };
}
else {});
}; };
config.hardware = { bluetooth.enable = inputs.config.nixos.hardware.bluetooth.enable; }
// (if inputs.config.nixos.hardware.joystick.enable then { xone.enable = true; xpadneo.enable = true; } else {});
} }

View File

@ -1,8 +0,0 @@
inputs:
{
config.services =
{
printing = { enable = true; drivers = [ inputs.pkgs.cnijfilter2 ]; };
avahi = { enable = true; nssmdns = true; openFirewall = true; };
};
}