mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-26 18:16:13 +01:00
24 lines
472 B
Nix
24 lines
472 B
Nix
|
{ config, pkgs, lib, ... }:
|
||
|
with lib;
|
||
|
let
|
||
|
cfg = config.magic_rb.hardware;
|
||
|
in
|
||
|
{
|
||
|
options = {};
|
||
|
|
||
|
imports = [ ./heater.nix ./mark.nix ./omen.nix ];
|
||
|
|
||
|
config = {
|
||
|
assertions = [
|
||
|
{
|
||
|
assertion =
|
||
|
let
|
||
|
selection = mapAttrsToList (system: enabled: { inherit system enabled; }) cfg;
|
||
|
in
|
||
|
count (x: x.enabled) selection == 1;
|
||
|
message = "You must select exactly one hardware configuration";
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
}
|