You can call the import function within imports. But ideally, the nix files in your config are primarily package expressions or modules, so I’d suggest structuring your config to be more conducive to making your theme.nix a proper module that can be added to imports directly. Right now you’re fighting the module system by trying to import the same content in multiple places.
I don’t see how this helps in my case? How does changing the theme.nix to have the options support like your link help me to reference those values in the programs.nix file?
I think I could import the theme.nix from programs.nix but what I want to do is house multiple themes in the file and be able to change them later
for example, in my home.nix I have something like:
{ config, pkgs, ... }:
let
theme = (import ./theme.nix).dark;
in {
imports = [
./programs.nix
];
}
So I could easily switch dark to light at one location and have it affect all the different modules that want to use theme.