You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to make NixOps machine definitions inspectable using nix repl?
To illustrate where I'm coming from here: suppose you have a flake with NixOS definitions, i.e. there is a nixosConfigurations output. If you arrange to create a repl file that binds self like this: self = builtins.getFlake (toString ${inputs.self.outPath});, then you can reach inside self.outputs all the way down to nixosConfigurations.<machine>.config, and inspect those configs.
No such luck with a NixOps flake though, as the nixopsConfigurations output does not contain anything interesting (stands to reason, since its fields do not result from a function application, unlike your usual nixosConfigurations). NixOS machine definitions are obviously created when you deploy, however, but I don't see any way at all to reflect on their configs conveniently?
The text was updated successfully, but these errors were encountered:
A NixOps network can not be evaluated without accessing or even creating some resources. Because of this, a normal nix repl will not be capable of doing this.
In this regard, nixopsConfigurations is more like nixosModules than nixosConfigurations.
NixOps itself can implement this feature by providing nix repl with the "physical" information of an existing deployment using the nix repl file argument and --argstr. (Not --expr for now because it doesn't support --argstrNixOS/nix#2678)
Is there any way to make NixOps machine definitions inspectable using
nix repl
?To illustrate where I'm coming from here: suppose you have a flake with NixOS definitions, i.e. there is a
nixosConfigurations
output. If you arrange to create a repl file that bindsself
like this:self = builtins.getFlake (toString ${inputs.self.outPath});
, then you can reach insideself.outputs
all the way down tonixosConfigurations.<machine>.config
, and inspect those configs.No such luck with a NixOps flake though, as the
nixopsConfigurations
output does not contain anything interesting (stands to reason, since its fields do not result from a function application, unlike your usualnixosConfigurations
). NixOS machine definitions are obviously created when you deploy, however, but I don't see any way at all to reflect on their configs conveniently?The text was updated successfully, but these errors were encountered: