init commit
This commit is contained in:
commit
8f7a75814d
21 changed files with 1073 additions and 0 deletions
55
modules/flake/deploy.nix
Normal file
55
modules/flake/deploy.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ inputs, ... }:
|
||||
let
|
||||
inherit (inputs)
|
||||
self
|
||||
deploy-rs
|
||||
nixpkgs
|
||||
nixos-anywhere
|
||||
agenix
|
||||
;
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
genNode =
|
||||
hostName: nixosCfg:
|
||||
let
|
||||
# inherit (self.hosts.${hostName}) address hostPlatform remoteBuild;
|
||||
# inherit (deploy-rs.lib.${hostPlatform}) activate;
|
||||
system = self.nixosConfigurations."${hostName}".pkgs.system;
|
||||
in
|
||||
{
|
||||
hostname = hostName;
|
||||
profiles.system.path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.${hostName};
|
||||
};
|
||||
in
|
||||
{
|
||||
perSystem =
|
||||
{
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
apps = rec {
|
||||
default = deploy;
|
||||
secrets = {
|
||||
type = "app";
|
||||
program = "${agenix.packages.${system}.agenix}/bin/agenix";
|
||||
meta.description = "";
|
||||
};
|
||||
install = {
|
||||
type = "app";
|
||||
program = "${nixos-anywhere.packages.${system}.nixos-anywhere}/bin/nixos-anywhere";
|
||||
meta.description = "";
|
||||
};
|
||||
deploy = deploy-rs.apps.${system}.deploy-rs;
|
||||
};
|
||||
};
|
||||
flake = {
|
||||
deploy = {
|
||||
autoRollback = false;
|
||||
magicRollback = true;
|
||||
user = "root";
|
||||
remoteBuild = true;
|
||||
nodes = lib.mapAttrs genNode (self.nixosConfigurations or { });
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue