nixos-config/modules/services.nix

75 lines
1.5 KiB
Nix
Raw Normal View History

2020-02-05 04:30:49 +04:00
{ config, lib, pkgs, ... }:
2020-08-29 17:47:21 +04:00
with config.deviceSpecific; {
2019-08-27 23:41:02 +04:00
2020-02-10 20:06:45 +04:00
services.acpid.enable = true;
2020-02-05 04:30:49 +04:00
2019-09-20 01:15:52 +04:00
services.redshift = {
enable = true;
temperature.day = 5500;
temperature.night = 3000;
};
2019-08-27 23:41:02 +04:00
services.earlyoom = {
2020-09-26 03:33:55 +04:00
enable = ram < 16;
2019-08-27 23:41:02 +04:00
freeMemThreshold = 5;
2020-08-07 23:27:49 +04:00
freeSwapThreshold = 100;
2019-08-27 23:41:02 +04:00
};
2020-04-26 14:48:39 +04:00
# Enable zram, disable zswap
zramSwap = {
enable = true;
algorithm = "zstd";
memoryPercent = 60;
numDevices = 1;
};
boot.kernelParams = [ "zswap.enabled=0" ];
2019-08-27 23:41:02 +04:00
services.printing = {
enable = true;
2020-08-15 19:36:16 +04:00
drivers = [ pkgs.samsungUnifiedLinuxDriver pkgs.gutenprint ];
2019-08-27 23:41:02 +04:00
};
2020-08-15 19:36:16 +04:00
hardware.sane.enable = true;
2019-08-27 23:41:02 +04:00
programs.dconf.enable = true;
2020-02-05 04:30:49 +04:00
services.avahi = {
enable = true;
# ipv6 = true;
nssmdns = true;
publish = {
enable = true;
addresses = true;
domain = true;
};
};
2019-08-27 23:41:02 +04:00
systemd.services.systemd-udev-settle.enable = false;
services.upower.enable = true;
2020-08-29 17:47:21 +04:00
virtualisation.docker.enable = enableVirtualisation;
environment.systemPackages = lib.mkIf (enableVirtualisation) [ pkgs.docker-compose ];
2020-02-05 04:30:49 +04:00
2020-08-07 23:27:49 +04:00
virtualisation.libvirtd = {
2020-08-29 17:47:21 +04:00
enable = enableVirtualisation;
2020-04-26 14:48:39 +04:00
};
2019-08-27 23:41:02 +04:00
2020-08-29 17:47:21 +04:00
# virtualisation.anbox.enable = isGaming; # broken
2020-08-07 23:27:49 +04:00
# virtualisation.virtualbox.host = {
# enable = device.enableVirtualisation;
# # enableHardening = false;
# enableExtensionPack = false;
# };
2020-01-23 02:16:20 +04:00
# Install cdemu for some gaming purposes
2020-02-05 04:30:49 +04:00
# programs.cdemu = {
# enable = true;
# image-analyzer = false;
# gui = false;
# group = "cdrom";
# };
2020-01-23 02:16:20 +04:00
2019-08-27 23:41:02 +04:00
}