Skip to content

Commit

Permalink
system.startup.chime: init
Browse files Browse the repository at this point in the history
  • Loading branch information
Samasaur1 committed Mar 1, 2024
1 parent 0363c18 commit ee53e57
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
./system/nvram.nix
./system/patches.nix
./system/shells.nix
./system/startup.nix
./system/version.nix
./time
./networking
Expand Down
31 changes: 31 additions & 0 deletions modules/system/startup.nix
Original file line number Diff line number Diff line change
@@ -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");
};
}

0 comments on commit ee53e57

Please sign in to comment.