I have two systems, one is macOS and one nixos. I would like to share the configuration and make some imports based on the system.
For hostname specific import I am using
{ config, pkgs, lib, ... }:
let
sysconfig = (import <nixpkgs/nixos> {}).config;
in
let
fqdn = "${sysconfig.networking.hostName}";
in
{
imports = [
(./machines + ("/" + fqdn + ".nix") )
];
...
in my home.nix.
However I would like to perform similar imports based on the system type. What is the best way to do this?