move nixos-facter imports to clanCore
This commit is contained in:
@@ -63,37 +63,15 @@ let
|
||||
nixpkgs.lib.nixosSystem {
|
||||
modules =
|
||||
let
|
||||
settings = machineSettings name;
|
||||
facterJson = "${directory}/machines/${name}/facter.json";
|
||||
hwConfig = "${directory}/machines/${name}/hardware-configuration.nix";
|
||||
|
||||
facterModules = lib.optionals (builtins.pathExists facterJson) [
|
||||
{ config.facter.reportPath = facterJson; }
|
||||
];
|
||||
in
|
||||
(machineImports settings)
|
||||
++ facterModules
|
||||
++ [
|
||||
[
|
||||
{
|
||||
# Autoinclude configuration.nix and hardware-configuration.nix
|
||||
imports = builtins.filter builtins.pathExists [
|
||||
"${directory}/machines/${name}/configuration.nix"
|
||||
hwConfig
|
||||
];
|
||||
config.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}'.
|
||||
''
|
||||
];
|
||||
}
|
||||
settings
|
||||
clan-core.nixosModules.clanCore
|
||||
|
||||
@@ -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