+++ title = "Redeploying existing host" taxonomies.categories = [ "nix" ] +++ Execute the following script from the root of the haccfiles directory on a NixOS-based host (otherwise initrd secrets and therefore the encrypted boot **will** break). ```sh nix build -f . deploy.$hostspec ./result $action ``` `$hostspec` can be replaced by any hostname or group name. To find out wich groups exist, evaluate the expression `lib.attrNames groups` in the context of the top-level default.nix. `$action` can be one of: - switch: make the configuration the boot default and activate now - boot: make the configuration the boot default - test: activate the configuration, but don't make it the boot default - dry-activate: show what would be done if this configuration were activated It is recommended to run a dry-activate first, and if any of the changes mentioned have a chance of interrupting access to the server, executing a test and only once that succeeds a switch.