mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
49 lines
1.5 KiB
Nix
49 lines
1.5 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
with lib;
|
|
let
|
|
cfg = config.aviallon.services;
|
|
desktopCfg = config.aviallon.desktop;
|
|
in {
|
|
options.aviallon.services = {
|
|
enable = mkOption {
|
|
default = true;
|
|
example = false;
|
|
type = types.bool;
|
|
description = "Enable aviallon's services configuration";
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
# Enable the OpenSSH daemon.
|
|
services.openssh.enable = true;
|
|
# services.openssh.permitRootLogin = "prohibit-password";
|
|
services.openssh.permitRootLogin = "yes";
|
|
networking.firewall.allowedTCPPorts = [ 22 ];
|
|
networking.firewall.allowedUDPPorts = [ 22 ];
|
|
|
|
services.rsyncd.enable = !desktopCfg.enable;
|
|
|
|
services.fstrim.enable = true;
|
|
|
|
services.haveged.enable = (builtins.compareVersions config.boot.kernelPackages.kernel.version "5.6" < 0);
|
|
|
|
services.irqbalance.enable = true;
|
|
|
|
services.printing.enable = desktopCfg.enable;
|
|
|
|
services.ananicy.enable = false;
|
|
services.ananicy.package = pkgs.ananicy-cpp;
|
|
services.ananicy.settings = {
|
|
loglevel = "info";
|
|
cgroup_realtime_workaround = false;
|
|
};
|
|
services.ananicy.extraRules = ''
|
|
{"name": "cp", "type": "BG_CPUIO"}
|
|
'';
|
|
|
|
services.avahi.enable = true; # .lan/.local resolution
|
|
services.avahi.nssmdns = true; # .lan/.local resolution
|
|
services.avahi.publish.enable = true;
|
|
services.avahi.publish.hinfo = true; # Whether to register a mDNS HINFO record which contains information about the local operating system and CPU.
|
|
};
|
|
}
|