Skip to content

Commit

Permalink
chore: fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmcgee authored and mergify[bot] committed Nov 4, 2024
1 parent 15b6531 commit f8f52fb
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pkgs.mkShellNoCC {

facterMarkdown = mkMarkdown "facter" eval.options.facter.detected;
otherMarkdown = lib.mapAttrsToList mkMarkdown (
lib.filterAttrs (n: v: n != "detected") eval.options.facter
lib.filterAttrs (n: _v: n != "detected") eval.options.facter
);

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

config.hardware.bluetooth.enable = lib.mkIf config.facter.detected.bluetooth.enable (lib.mkDefault true);
config.hardware.bluetooth.enable = lib.mkIf config.facter.detected.bluetooth.enable (
lib.mkDefault true
);
}
16 changes: 8 additions & 8 deletions modules/nixos/disk.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ in
options.facter.detected.boot.disk.kernelModules = lib.mkOption {
type = lib.types.listOf lib.types.str;
default = facterLib.stringSet (
facterLib.collectDrivers (
# A disk might be attached.
(report.hardware.firewire_controller or [ ])
# definitely important
++ (report.hardware.disk or [ ])
++ (report.hardware.storage_controller or [ ])
)
);
facterLib.collectDrivers (
# A disk might be attached.
(report.hardware.firewire_controller or [ ])
# definitely important
++ (report.hardware.disk or [ ])
++ (report.hardware.storage_controller or [ ])
)
);
description = ''
List of kernel modules that are needed to access the disk.
'';
Expand Down
6 changes: 5 additions & 1 deletion modules/nixos/facter.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
options.facter = with lib; {
report = mkOption {
type = types.raw;
default = if config.facter.reportPath == null then {} else builtins.fromJSON (builtins.readFile config.facter.reportPath);
default =
if config.facter.reportPath == null then
{ }
else
builtins.fromJSON (builtins.readFile config.facter.reportPath);
description = "An import for the reportPath.";
};

Expand Down
4 changes: 3 additions & 1 deletion modules/nixos/system.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
}:
{
nixpkgs = lib.mkIf (!options.nixpkgs.pkgs.isDefined) {
hostPlatform = lib.mkIf (config.facter.report.system or null != null) (lib.mkDefault config.facter.report.system);
hostPlatform = lib.mkIf (config.facter.report.system or null != null) (
lib.mkDefault config.facter.report.system
);
};
}
6 changes: 2 additions & 4 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"]
}

0 comments on commit f8f52fb

Please sign in to comment.