dotfiles/nixos/common-hardware.nix

119 lines
2.6 KiB
Nix
Raw Normal View History

2024-04-27 11:33:38 +01:00
{
config,
pkgs,
nixpkgs-nixos-unstable-and-unfree,
lib,
...
}: {
boot.kernelModules = ["fuse"];
2020-03-20 13:09:39 +00:00
2019-07-18 22:17:36 +01:00
sound.enable = true;
2020-03-20 13:09:39 +00:00
2021-11-04 20:32:40 +00:00
networking.networkmanager = {
enable = true;
2024-04-27 11:33:38 +01:00
dispatcherScripts = [
{
source = pkgs.writeText "upHook" ''
enable_disable_wifi ()
{
result=$(nmcli dev | grep "ethernet" | grep -w "connected")
if [ -n "$result" ]; then
nmcli radio wifi off
else
nmcli radio wifi on
fi
}
if [ "$2" = "up" ]; then
enable_disable_wifi
fi
if [ "$2" = "down" ]; then
enable_disable_wifi
2023-08-13 17:00:41 +01:00
fi
2024-04-27 11:33:38 +01:00
'';
type = "basic";
}
];
};
2024-04-27 11:33:38 +01:00
security.rtkit.enable = true;
2024-03-27 19:34:34 +00:00
2024-04-27 11:33:38 +01:00
services = {
smartd.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
printing = {
enable = true;
drivers = with pkgs; [
epson-escpr
nixpkgs-nixos-unstable-and-unfree.samsung-unified-linux-driver
gutenprint
];
extraConf = ''
Option pdftops-renderer hybrid
2024-03-27 19:34:34 +00:00
'';
2024-04-27 11:33:38 +01:00
};
udev.packages = [];
2021-11-04 20:32:40 +00:00
};
2020-03-20 13:09:39 +00:00
2024-04-27 11:33:38 +01:00
environment.systemPackages = with pkgs; [ghostscript poppler];
2020-04-26 14:08:40 +01:00
2024-04-27 11:33:38 +01:00
hardware = {
enableRedistributableFirmware = true;
cpu.intel.updateMicrocode = true;
2024-04-27 11:33:38 +01:00
bluetooth = {
enable = true;
package = pkgs.bluez;
settings = {General = {Enable = "Source,Sink,Media,Socket";};};
2024-03-27 19:34:34 +00:00
};
2024-04-27 11:33:38 +01:00
pulseaudio.enable = false;
printers.ensurePrinters = [
{
description = "Epson XP-540 via bolty";
name = "epson_xp540_via_bolty";
deviceUri = "ipp://bolty:631/printers/epson_xp540";
model = "epson-inkjet-printer-escpr/Epson-XP-540_Series-epson-escpr-en.ppd";
ppdOptions = {
PageSize = "A4";
Duplex = "DuplexNoTumble";
};
}
{
description = "Samsung SCX-4623 Series";
name = "samsung-SCX-4623";
deviceUri = "usb://Samsung/SCX-4623%20Series?serial=Z2TYBFFZC01007W&interface=1";
model = "samsung/SCX-4623FW.ppd";
ppdOptions = {
PageSize = "A4";
Duplex = "DuplexNoTumble";
};
}
2022-03-08 12:50:16 +00:00
];
2020-04-26 13:23:27 +01:00
2024-04-27 11:33:38 +01:00
sane = {
enable = true;
snapshot = true;
extraBackends = with pkgs; [
nixpkgs-nixos-unstable-and-unfree.samsung-unified-linux-driver
sane-airscan
gawk
];
};
2020-04-26 14:08:40 +01:00
};
2021-11-12 22:36:04 +00:00
powerManagement = {
2022-05-02 09:59:47 +01:00
enable = lib.mkForce true;
2021-11-12 22:36:04 +00:00
resumeCommands = ''
${pkgs.autorandr}/bin/autorandr -c
'';
powertop.enable = true;
};
2019-07-18 22:17:36 +01:00
}