mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
system.nvram
: init (internal)
This commit is contained in:
parent
6c06334f08
commit
0363c18c37
3 changed files with 42 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
|||
./system/etc.nix
|
||||
./system/keyboard.nix
|
||||
./system/launchd.nix
|
||||
./system/nvram.nix
|
||||
./system/patches.nix
|
||||
./system/shells.nix
|
||||
./system/version.nix
|
||||
|
|
|
@ -69,6 +69,7 @@ in
|
|||
${cfg.activationScripts.networking.text}
|
||||
${cfg.activationScripts.keyboard.text}
|
||||
${cfg.activationScripts.fonts.text}
|
||||
${cfg.activationScripts.nvram.text}
|
||||
|
||||
${cfg.activationScripts.postActivation.text}
|
||||
|
||||
|
|
40
modules/system/nvram.nix
Normal file
40
modules/system/nvram.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let
|
||||
cfg = config.system;
|
||||
|
||||
mkNvramVariables =
|
||||
lib.attrsets.mapAttrsToList
|
||||
(name: value: "nvram ${lib.escapeShellArg name}=${lib.escapeShellArg value}")
|
||||
cfg.nvram.variables;
|
||||
in
|
||||
|
||||
{
|
||||
meta.maintainers = [
|
||||
lib.maintainers.samasaur or "samasaur"
|
||||
];
|
||||
|
||||
options = {
|
||||
system.nvram.variables = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
default = {};
|
||||
internal = true;
|
||||
example = {
|
||||
"StartupMute" = "%01";
|
||||
};
|
||||
description = lib.mdDoc ''
|
||||
Non-volatile RAM variables to set. Removing a key-value pair from this
|
||||
list will **not** return the variable to its previous value, but will
|
||||
no longer set its value on system configuration activations.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
system.activationScripts.nvram.text = ''
|
||||
echo "setting nvram variables..." >&2
|
||||
|
||||
${builtins.concatStringsSep "\n" mkNvramVariables}
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue