mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
Massive refactoring in configurable modules
This commit is contained in:
commit
4319f5a3cc
14 changed files with 603 additions and 0 deletions
49
services.nix
Normal file
49
services.nix
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
{ 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.
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue