Skip to content

Commit

Permalink
lib.kernel.unset: init
Browse files Browse the repository at this point in the history
Previously, there was no way to unset an option when overriding a
kernel, apart from writing out the attrset yourself.  Now it's
possible with lib.mkForce lib.kernel.unset.  It's important to be able
to do this, because setting an option in the override may cause other
options to become unused, which would fail the config build unless
they were overridden too.
  • Loading branch information
alyssais committed May 1, 2023
1 parent 7c61272 commit 12e08bd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/kernel.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ with lib;
option = x:
x // { optional = true; };

yes = { tristate = "y"; optional = false; };
no = { tristate = "n"; optional = false; };
module = { tristate = "m"; optional = false; };
yes = { tristate = "y"; optional = false; };
no = { tristate = "n"; optional = false; };
module = { tristate = "m"; optional = false; };
unset = { tristate = null; optional = false; };
freeform = x: { freeform = x; optional = false; };

/*
Expand Down

0 comments on commit 12e08bd

Please sign in to comment.