2019-07-18 22:17:36 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
2020-03-20 13:09:39 +00:00
|
|
|
boot.kernelModules = [ "fuse" ];
|
|
|
|
services.smartd.enable = true;
|
|
|
|
|
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;
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
type = "basic";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2020-03-20 13:09:39 +00:00
|
|
|
|
2019-07-18 22:17:36 +01:00
|
|
|
hardware.enableRedistributableFirmware = true;
|
|
|
|
hardware.cpu.intel.updateMicrocode = true;
|
|
|
|
hardware.pulseaudio = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.pulseaudioFull;
|
2019-08-08 21:23:29 +01:00
|
|
|
support32Bit = true;
|
2019-07-18 22:17:36 +01:00
|
|
|
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
2020-05-10 08:45:21 +01:00
|
|
|
daemon.config = {
|
2021-11-22 19:32:26 +00:00
|
|
|
nice-level = -15;
|
2020-05-10 08:45:21 +01:00
|
|
|
realtime-scheduling = "yes";
|
|
|
|
};
|
2019-07-18 22:17:36 +01:00
|
|
|
};
|
2020-04-26 14:08:40 +01:00
|
|
|
|
2019-07-18 22:17:36 +01:00
|
|
|
hardware.bluetooth = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.bluezFull;
|
2021-05-30 20:41:33 +01:00
|
|
|
settings = {
|
2020-05-09 11:02:36 +01:00
|
|
|
General = { Enable = "Source,Sink,Media,Socket"; };
|
|
|
|
};
|
2019-07-18 22:17:36 +01:00
|
|
|
};
|
2019-07-18 23:50:46 +01:00
|
|
|
|
2020-06-13 08:57:23 +01:00
|
|
|
services.blueman.enable = true;
|
|
|
|
|
2020-04-26 13:23:27 +01:00
|
|
|
services.printing = {
|
|
|
|
enable = true;
|
2021-09-22 22:11:32 +01:00
|
|
|
drivers = with pkgs; [ epson-escpr samsung-unified-linux-driver ];
|
2020-04-26 13:23:27 +01:00
|
|
|
};
|
|
|
|
|
2021-09-22 22:23:45 +01:00
|
|
|
hardware.printers.ensurePrinters = [
|
|
|
|
{
|
2021-10-01 10:22:46 +01:00
|
|
|
description = "Epson XP-540 via bolty";
|
|
|
|
name = "epson_xp540_via_bolty";
|
|
|
|
deviceUri = "ipp://bolty:631/printers/epson_xp540";
|
2021-09-22 22:23:45 +01:00
|
|
|
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"; };
|
|
|
|
}
|
|
|
|
];
|
2020-04-26 13:23:27 +01:00
|
|
|
|
2020-04-26 14:08:40 +01:00
|
|
|
hardware.sane = {
|
|
|
|
enable = true;
|
2021-09-22 22:11:32 +01:00
|
|
|
extraBackends = with pkgs; [ samsung-unified-linux-driver ];
|
2020-04-26 14:08:40 +01:00
|
|
|
};
|
|
|
|
|
2021-11-12 22:36:04 +00:00
|
|
|
powerManagement = {
|
|
|
|
enable = (lib.mkForce true);
|
|
|
|
resumeCommands = ''
|
|
|
|
${pkgs.autorandr}/bin/autorandr -c
|
|
|
|
'';
|
|
|
|
powertop.enable = true;
|
|
|
|
};
|
2019-07-18 22:17:36 +01:00
|
|
|
}
|