From 801030ec1bb893240db06802f686d621f117b6d4 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Sat, 13 Apr 2024 17:59:56 +0200 Subject: [PATCH] Add some more services --- system/services/default.nix | 4 ++++ system/services/fwupd.nix | 7 +++++++ system/services/logrotate.nix | 24 ++++++++++++++++++++++++ system/services/thermald.nix | 4 ++++ 4 files changed, 39 insertions(+) create mode 100644 system/services/fwupd.nix create mode 100644 system/services/logrotate.nix create mode 100644 system/services/thermald.nix diff --git a/system/services/default.nix b/system/services/default.nix index 53cf156..4a85a49 100644 --- a/system/services/default.nix +++ b/system/services/default.nix @@ -1,5 +1,9 @@ _: { imports = [ ./ssh.nix + ./fwupd.nix + ./logrotate.nix + ./oomd.nix + ./thermald.nix ]; } diff --git a/system/services/fwupd.nix b/system/services/fwupd.nix new file mode 100644 index 0000000..d4c6542 --- /dev/null +++ b/system/services/fwupd.nix @@ -0,0 +1,7 @@ +{config, ...}: { + # firmware updater for machine hardware + services.fwupd = { + enbale = true; + daemonSettings.EspLocation = config.boot.loader.efi.efiSysMountPoint; + }; +} diff --git a/system/services/logrotate.nix b/system/services/logrotate.nix new file mode 100644 index 0000000..c688e09 --- /dev/null +++ b/system/services/logrotate.nix @@ -0,0 +1,24 @@ +{ pkgs, lib, ... }: { + services.logrotate.settings.header = { + # general + global = true; + dateext = true; + dateformat = "-%Y-%m-%d"; + nomail = true; + missingok = true; + copytruncate = true; + + # rotation frequency + priority = 1; + frequency = "weekly"; + rotate = 7; # special value, means 7 days + minage = 7; # avoid rotating files that are less than 7 days old + + # compression + compress = true; # compress logs to save space + compresscmd = "${lib.getExe' pkgs.zstd "zstd"}"; + compressoptions = " -Xcompression-level 10"; + compressext = "zst"; + uncompresscmd = "${lib.getExe' pkgs.zstd "unzstd}"; + }; +} diff --git a/system/services/thermald.nix b/system/services/thermald.nix new file mode 100644 index 0000000..d804010 --- /dev/null +++ b/system/services/thermald.nix @@ -0,0 +1,4 @@ +{ + # monitor and control temperature + services.thermald.enable = true; +}