move nixos-facter imports to clanCore
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
./meta/interface.nix
|
||||
./metadata.nix
|
||||
./networking.nix
|
||||
./nixos-facter.nix
|
||||
./nix-settings.nix
|
||||
./options.nix
|
||||
./outputs.nix
|
||||
|
||||
24
nixosModules/clanCore/nixos-facter.nix
Normal file
24
nixosModules/clanCore/nixos-facter.nix
Normal file
@@ -0,0 +1,24 @@
|
||||
{ lib, config, ... }:
|
||||
let
|
||||
directory = config.clan.core.clanDir;
|
||||
inherit (config.clan.core) machineName;
|
||||
facterJson = "${directory}/machines/${machineName}/facter.json";
|
||||
hwConfig = "${directory}/machines/${machineName}/hardware-configuration.nix";
|
||||
in
|
||||
{
|
||||
facter.reportPath = lib.mkIf (builtins.pathExists facterJson) facterJson;
|
||||
warnings =
|
||||
lib.optionals
|
||||
(builtins.all builtins.pathExists [
|
||||
hwConfig
|
||||
facterJson
|
||||
])
|
||||
[
|
||||
''
|
||||
Duplicate hardware facts: '${hwConfig}' and '${facterJson}' exist.
|
||||
Using both is not recommended.
|
||||
|
||||
It is recommended to use the hardware facts from '${facterJson}', please remove '${hwConfig}'.
|
||||
''
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user