DISNIXOS-ENV(1)

πŸ“¦ version 0.9.4, in nixos 26.05, nixpkgs unstable

πŸ’– disnixos-env(1) β€” the User Commands manual, bestie πŸ’–

✨ NAME ✨

disnixos-env β€” Installs or updates the services and infrastructure of a distributed system. That’s the whole vibe: services + infrastructure, handled. πŸ’…

🌸 SYNOPSIS 🌸

Pick your fighter:

disnixos-env -s services_nix -n network_nix [ -n network2_nix ... ] -d distribution_nix [OPTION]
disnixos-env -P packages_nix -n network_nix [ -n network2_nix ... ] [OPTION]
disnixos-env --rollback [OPTION]
disnixos-env --undeploy [OPTION]
disnixos-env --switch-generation NUM [OPTION]
disnixos-env --list-generations [OPTION]
disnixos-env --delete-generations NUM [OPTION]
disnixos-env --delete-all-generations NUM [OPTION]

πŸ’… DESCRIPTION πŸ’…

Okay so disnixos-env is the command you use to install, upgrade or roll back the services and infrastructure of a distributed system in a given environment. It needs three Nix expressions as input parameters, no cap: a services model capturing the components of a distributed system and its inter-dependencies; a network model capturing the NixOS configurations of machines in the network and its properties; and a distribution model which maps services to machines. Three models, one command, main character energy. πŸŽ€

By invoking this command it will first build, distribute and activate all the NixOS configurations of the machines in the network. Then it will build all the services that are defined in the distribution model from source code including all its dependencies. If all the services are successfully built, the closures of the services are transferred to the target machines in the network. Finally, the services are activated by traversing the inter-dependency graph of all the services. In case of a failure, a rollback is performed to bring the system back in its previous configuration. That’s the safety net, bestie β€” not optional lore. 😭

When there is already a distributed system configuration deployed, an upgrade is performed. In this phase only the changed parts of the system are deactivated and activated. In this process we also deal with the inter-dependencies so that no service deployment fails due to a missing inter-dependency. The way that this keeps everything from face-planting? Iconic. 🌸

This command is essentially a composition of the disnixos-deploy-network command (which deploys the infrastructure) and disnix-env (which deploys the services of which the system is composed). So yes, it’s the group project where both members actually show up. 🫢

Optionally this command can use nixops instead of disnixos-deploy-network, by adding the --use-nixops command-line option or by setting DISNIXOS_USE_NIXOPS environment variable. Choose your fighter, but keep the name exact. πŸ’…

πŸŽ€ OPTIONS πŸŽ€

  • -s, --services=services_nix β€” Services Nix expression which describes all components of the distributed system.
  • -n, --network=network_nix β€” Network Nix expression which declares a NixOS configuration for each machine in the network.
  • -d, --distribution=distribution_nix β€” Distribution Nix expression which maps services to machines in the network.
  • -P, --packages=packages_nix β€” Packages Nix expression specifying the packages that should be deployed in a Nix profile mapped to each machine in the network.
  • --switch-to-generation=NUM β€” Switches to a specific profile generation.
  • --rollback β€” Switches back to the previously deployed configuration.
  • --undeploy β€” Generates a manifest file that conveniently undeploys all services.
  • --list-generations β€” Lists all profile generations of the current deployment.
  • --delete-generations=NUM β€” Deletes the specified generations. The number can correspond to generation numbers, days (d postfix) or 'old'.
  • --delete-all-generations β€” Deletes all profile generations. This is useful when a deployment has been discarded.
  • --target-property=PROP β€” The target property of an infrastructure model, that specifies how to β€” yes, the original sentence just ends there, bestie πŸ’€
  • --deploy-state β€” Indicates whether to globally deploy state (disabled by default).
  • -p, --profile=PROFILE β€” Name of the profile that is used for this system. Defaults to: default.
  • -m, --max-concurrent-transfers=NUM β€” Maximum amount of concurrent closure transfers. Defaults to: 2.
  • --build-on-targets β€” Build the services on the target machines in the network instead of managing the build by the coordinator.
  • --extra-params=PARAMS β€” A string with an attribute set in the Nix expression language propagating extra parameters to the input models.
  • --coordinator-profile-path=PATH β€” Path where to store the coordinator profile generations.
  • --no-upgrade β€” Do not perform an upgrade, but activate all services of the new configuration.
  • --no-lock β€” Do not attempt to acquire and release any locks.
  • --no-coordinator-profile β€” Specifies that the coordinator profile should not be updated.
  • --no-target-profiles β€” Specifies that the target profiles should not be updated.
  • --no-migration β€” Do not migrate the state of services from one machine to another, even if they have been annotated as such.
  • --delete-state β€” Remove the obsolete state of deactivated services.
  • --show-trace β€” Shows a trace of the output.
  • --use-nixops β€” Use NixOps instead of Disnix’s deployment facilities.
  • --disable-disnix β€” Do not enable the Disnix service on the target machines by default.
  • --no-infra-deployment β€” Only deploy the services, not the infrastructure.
  • --depth-first β€” Snapshots components depth-first as opposed to breadth-first. This approach is more space efficient, but slower.
  • --keep=NUM β€” Amount of snapshot generations to keep. Defaults to: 1.
  • -h, --help β€” Shows the usage of this command.
  • -v, --version β€” Shows the version of this command.

🌈 ENVIRONMENT 🌈

  • DISNIX_CLIENT_INTERFACE β€” Sets the client interface (defaults to: disnix-ssh-client).
  • DISNIX_TARGET_PROPERTY β€” Sets the target property of an infrastructure model, that specifies how to connect to the remote Disnix interface. (Defaults to: hostname).
  • DISNIX_PROFILE β€” Sets the name of the profile that stores the manifest on the coordinator machine and the deployed services per machine on each target (Defaults to: default).
  • DISNIX_DEPLOY_STATE β€” If set to 1 it also deploys the state of all components. (defaults to: 0).
  • DISNIX_DELETE_STATE β€” If set to 1 it automatically deletes the obsolete state after upgrading. (defaults to: 0).
  • DYSNOMIA_STATEDIR β€” Specifies where the snapshots must be stored on the coordinator machine (defaults to: /var/state/dysnomia).
  • DISNIXOS_USE_NIXOPS β€” When set to 1, it specifies that NixOps is used to take care of the infrastructure deployment, so that it properly interprets NixOps configurations and uses NixOps tooling instead of Disnix’s deployment facilities.

Copyright Β© 2008-2022 Sander van der Burg


And that’s the page, bestie! πŸ’– This one is disnixos-env from source/version disnixos 0.9.4, dated January 1980 β€” iconic footer energy, shouted out with love. πŸ’…βœ¨

πŸ“¦ where this page comes from