Skip to content

Commit

Permalink
Merge pull request #32 from numtide/graphics
Browse files Browse the repository at this point in the history
add graphics module
  • Loading branch information
brianmcgee authored Sep 13, 2024
2 parents b637d08 + a8c74e6 commit d78cd60
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
17 changes: 2 additions & 15 deletions modules/nixos/bluetooth.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
{ lib, config, ... }:
let

cfg = config.facter.boot;
inherit (config.facter) report;
in
{
options.facter.bluetooth.enable = lib.mkEnableOption "Enable the Facter bluetooth module" // {
default =
let
bluetooth = report.hardware.bluetooth or [ ];
in
builtins.length bluetooth > 0;
default = builtins.length (config.facter.report.hardware.bluetooth or []) > 0;
};

config =
with lib;
mkIf cfg.enable {
hardware.bluetooth.enable = lib.mkIf config.facter.bluetooth.enable (lib.mkDefault true);
};
config.hardware.bluetooth.enable = lib.mkIf config.facter.bluetooth.enable (lib.mkDefault true);
}
7 changes: 4 additions & 3 deletions modules/nixos/facter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ let
in
{
imports = [
./bluetooth.nix
./boot.nix
./networking
./virtualisation.nix
./firmware.nix
./graphics.nix
./networking
./system.nix
./bluetooth.nix
./virtualisation.nix
];

options.facter = with lib; {
Expand Down
8 changes: 8 additions & 0 deletions modules/nixos/graphics.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{ lib, config, ... }:
{
options.facter.graphics.enable = lib.mkEnableOption "Enable the Graphics module" // {
default = builtins.length (config.facter.report.hardware.monitor or []) > 0;
};

config.hardware.graphics.enable = lib.mkIf config.facter.graphics.enable (lib.mkDefault true);
}

0 comments on commit d78cd60

Please sign in to comment.