From 14305066667a59f8b809274182fe7ae120b099bf Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 26 Feb 2017 09:50:01 -0500 Subject: mcelog: init Machine Check Exception Logging Daemon service --- nixos/modules/hardware/mcelog.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 nixos/modules/hardware/mcelog.nix (limited to 'nixos/modules/hardware') diff --git a/nixos/modules/hardware/mcelog.nix b/nixos/modules/hardware/mcelog.nix new file mode 100644 index 0000000000000..e4ac7d39053fd --- /dev/null +++ b/nixos/modules/hardware/mcelog.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + meta.maintainers = [ maintainers.grahamc ]; + options = { + + hardware.mcelog = { + enable = mkOption { + type = types.bool; + default = false; + description = '' + Enable the Machine Check Exception logger. + ''; + }; + }; + + }; + + config = mkIf config.hardware.mcelog.enable { + systemd.services.mcelog = { + description = "Machine Check Exception Logging Daemon"; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = "${pkgs.mcelog}/bin/mcelog --daemon --foreground"; + SuccessExitStatus = [ 0 15 ]; + + ProtectHome = true; + PrivateNetwork = true; + PrivateTmp = true; + }; + }; + }; + +} -- cgit 1.4.1