With a Nix expression divided among imported source files, can Nix “inline” them into a single Nix expression (as if they’d been written in a single file)?
{
imports = [
./foo.nix
./bar.nix
];
}
# foo.nix
{
services.openssh.enable = true;
}
# bar.nix
{
services.openssh.settings.PermitRootLogin = "no";
}
I know it’s typical to locally evaluate the expression to produce store derivations (i.e. instantiate) which can then be copied via closures to another machine and realized, but derivation files can be massive. And syncing a repo of source files can be burdensome too. Sometimes I’d like a way to just inline the expression itself, which could then be evaluated on a remote machine.
Anyone tried something similar? A way to ask Nix to just resolve imports, but don’t actually evaluate. Don’t touch the Nix Store. Don’t build anything. Just inline.
# merged
{
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "no";
}