mirror of
https://github.com/blahai/nyx.git
synced 2025-02-23 15:35:09 +00:00
Modules: add deploy-rs config
This commit is contained in:
parent
800286a7f2
commit
8a4c10140e
3 changed files with 45 additions and 9 deletions
|
@ -2,6 +2,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
./shell.nix
|
./shell.nix
|
||||||
./formatter.nix
|
./formatter.nix
|
||||||
# ./deploy.nix
|
./deploy.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
44
modules/flake/programs/deploy.nix
Normal file
44
modules/flake/programs/deploy.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
self,
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (builtins) elem mapAttrs attrNames;
|
||||||
|
inherit (lib.attrsets) filterAttrs;
|
||||||
|
|
||||||
|
# extract the names of the systems that we want to deploy
|
||||||
|
deployableSystems = attrNames (filterAttrs (_: attrs: attrs.deployable) config.easyHosts.hosts);
|
||||||
|
|
||||||
|
easyHostsFromDeployableSystems =
|
||||||
|
filterAttrs (
|
||||||
|
name: _: elem name deployableSystems
|
||||||
|
)
|
||||||
|
self.nixosConfigurations;
|
||||||
|
in {
|
||||||
|
flake = {
|
||||||
|
checks = {
|
||||||
|
x86_64-linux = inputs.deploy-rs.lib.x86_64-linux.deployChecks self.deploy;
|
||||||
|
# aarch64-linux = inputs.deploy-rs.lib.aarch64-linux.deployChecks self.deploy;
|
||||||
|
};
|
||||||
|
|
||||||
|
deploy = {
|
||||||
|
autoRollback = true;
|
||||||
|
magicRollback = true;
|
||||||
|
interactiveSudo = true;
|
||||||
|
|
||||||
|
# then create a list of nodes that we want to deploy that we can pass to the deploy configuration
|
||||||
|
nodes =
|
||||||
|
mapAttrs (name: node: {
|
||||||
|
hostname = name;
|
||||||
|
profiles.system = {
|
||||||
|
user = "root";
|
||||||
|
sshUser = node.config.olympus.system.mainUser or "root";
|
||||||
|
path = inputs.deploy-rs.lib.${config.easyHosts.hosts.${name}.system}.activate.nixos node;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
easyHostsFromDeployableSystems;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,8 +0,0 @@
|
||||||
let
|
|
||||||
pingu = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILPbmiNqoyeKXk/VopFm2cFfEnV4cKCFBhbhyYB69Fuu";
|
|
||||||
elissa = "";
|
|
||||||
users = [pingu elissa];
|
|
||||||
in {
|
|
||||||
"forgejo-runner-token.age".publicKeys = [pingu];
|
|
||||||
"vaultwarden-env.age".publicKeys = [pingu];
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue