nixos-option for NixOps deployed machine?

307 Views Asked by At

There is a command nixos-option which examines given system's option value. Under the hood it does something like:

$ nix-instantiate --eval -E '
  let nixos = import <nixpkgs/nixos> { };
      opt = nixos.config.networking.firewall.allowedTCPPorts;
  in builtins.deepSeq opt opt
  '

$-> [ 1194 22 8081 80 443 4949 ]

But that doesn't work for NixOps deployed machines (configuration isn't available there). Is there a way to get option value from NixOps deploment config, on deployer machine?

1

There are 1 best solutions below

0
On BEST ANSWER

Nixops has the solution! ;)

Command nixops show-option

Synopsis

nixops show-option [--xml] machine option

Description

This command prints the value of the specified NixOS configuration option for the specified machine.