From ee53e5785c437aa2e836c6ce3b9fbf3936bf511e Mon Sep 17 00:00:00 2001 From: Sam <30577766+Samasaur1@users.noreply.github.com> Date: Tue, 27 Feb 2024 17:22:41 -0800 Subject: `system.startup.chime`: init --- modules/system/startup.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 modules/system/startup.nix (limited to 'modules/system/startup.nix') diff --git a/modules/system/startup.nix b/modules/system/startup.nix new file mode 100644 index 0000000..ecbef46 --- /dev/null +++ b/modules/system/startup.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.system.startup; +in + +{ + meta.maintainers = [ + lib.maintainers.samasaur or "samasaur" + ]; + + options = { + system.startup.chime = lib.mkOption { + type = with lib.types; nullOr bool; + default = null; + example = false; + description = lib.mdDoc '' + Whether to enable the startup chime. + + By default, this option does not affect your system configuration in any way. + However, this means that after it has been set once, unsetting it will not + return to the old behavior. It will allow the setting to be controlled in + System Settings, though. + ''; + }; + }; + + config = { + system.nvram.variables."StartupMute" = lib.mkIf (cfg.chime != null) (if cfg.chime then "%00" else "%01"); + }; +} -- cgit v1.2.3