fix(deploy): set up (magic) auto rollbacks on 'hecuba' using 'deploy-rs'
This commit is contained in:
+8
-1
@@ -6,7 +6,14 @@
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
utils = import ../utils { inherit lib; };
|
||||
hostnames = utils.dirNames ../hosts;
|
||||
# exclude hosts that need auto rollback (until `colmena` supports it) for
|
||||
# now, we use `deploy-rs` (which has magic rollback) for those (also see ./deploy-rs.nix)
|
||||
#
|
||||
# see <https://github.com/nix-community/colmena/issues/38>
|
||||
# <https://github.com/nix-community/colmena/issues/344>
|
||||
hostnames = lib.filter (
|
||||
hostname: !((utils.hostMeta ../hosts/${hostname}).deploy.autoRollback or false)
|
||||
) (utils.dirNames ../hosts);
|
||||
|
||||
mkNode =
|
||||
hostname:
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
self,
|
||||
inputs,
|
||||
}:
|
||||
|
||||
let
|
||||
inherit (inputs.nixpkgs) lib;
|
||||
utils = import ../utils { inherit lib; };
|
||||
|
||||
# only include hosts that need auto rollback (until `colmena` supports it)
|
||||
# `colmena` is used for other hosts (see ./colmena.nix)
|
||||
hostnames = lib.filter (
|
||||
hostname: (utils.hostMeta ../hosts/${hostname}).deploy.autoRollback or false
|
||||
) (utils.dirNames ../hosts);
|
||||
|
||||
mkNode =
|
||||
hostname:
|
||||
let
|
||||
meta = utils.hostMeta ../hosts/${hostname};
|
||||
in
|
||||
{
|
||||
inherit hostname;
|
||||
sshUser = meta.host.username;
|
||||
magicRollback = true;
|
||||
autoRollback = true;
|
||||
profiles.system = {
|
||||
user = "root";
|
||||
path = inputs.deploy-rs.lib.${meta.system}.activate.nixos self.nixosConfigurations.${hostname};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
nodes = lib.genAttrs hostnames mkNode;
|
||||
}
|
||||
Reference in New Issue
Block a user