nixos-config/modules/services.nix

72 lines
1.4 KiB
Nix
Raw Normal View History

2020-02-05 04:30:49 +04:00
{ config, lib, pkgs, ... }:
let
device = config.devices.${config.device};
in {
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-02-05 04:30:49 +04:00
enable = device.ram < 12;
2019-08-27 23:41:02 +04:00
freeMemThreshold = 5;
2020-04-26 14:48:39 +04:00
freeSwapThreshold = 20;
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;
drivers = [ pkgs.gutenprint ];
};
programs.dconf.enable = true;
2020-08-05 19:30:05 +04:00
# programs.gnupg.agent.enable = true;
2019-08-27 23:41:02 +04:00
services.accounts-daemon.enable = true;
2019-09-18 22:08:30 +04:00
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;
2019-10-10 14:28:33 +04:00
services.gnome3.gnome-keyring.enable = true;
2020-03-22 01:07:54 +04:00
virtualisation.docker.enable = device.enableVirtualisation;
2020-02-05 04:30:49 +04:00
2020-04-26 14:48:39 +04:00
virtualisation.virtualbox.host = {
enable = device.enableVirtualisation;
# enableHardening = false;
enableExtensionPack = false;
};
2019-08-27 23:41:02 +04:00
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
}