I am not very well versed in functional programming and it’s catching up to me now as I am attempting use a conditional in my configuration.nix. my goal is to let my config know which machine it is on by using the contents of /sys/devices/virtual/dmi/id/product_family as a key and then importing that key’s value in my nix config.
computers = {
"HP OMEN" = "/path/to/nix/config/devices/HPOmen.nix";
"Lenovo T470" = "/path/to/nix/config/devices/T470.nix";
};
I would then add result of the comparison to the imported files in the configuration.nix.
imports =
[
"/path/to/nix/config/hardware-configuration.nix"
computer_configuration
];
Any help would be appreciated!