fix(lib): rename mkDeploy so it is scoped
Change-Id: I7f908ff6428cd39a99452dd6c22956524c115c83
Reviewed-on: https://git.clicks.codes/c/Infra/NixFiles/+/726
Reviewed-by: Samuel Shuert <coded@clicks.codes>
Tested-by: Samuel Shuert <coded@clicks.codes>
diff --git a/lib/deploy/default.nix b/lib/deploy/default.nix
index 1eaa186..8e512ac 100644
--- a/lib/deploy/default.nix
+++ b/lib/deploy/default.nix
@@ -7,7 +7,7 @@
let
inherit (inputs) deploy-rs;
in
-rec {
+{
## Create deployment configuration for use with deploy-rs.
##
## ```nix
@@ -20,41 +20,43 @@
## ```
##
#@ { self: Flake, overrides: Attrs ? {} } -> Attrs
- mkDeploy =
- {
- self,
- overrides ? { },
- }:
- let
- hosts = self.nixosConfigurations or { };
- names = builtins.attrNames hosts;
- nodes = lib.foldl (
- result: name:
- let
- host = hosts.${name};
- user = host.config.users.infra or null;
- inherit (host.pkgs) system;
- in
- result
- // {
- ${name} = (overrides.${name} or { }) // {
- hostname = overrides.${name}.hostname or "${name}";
- profiles = (overrides.${name}.profiles or { }) // {
- system =
- (overrides.${name}.profiles.system or { })
- // {
- path = deploy-rs.lib.${system}.activate.nixos host;
- }
- // {
- user = "root";
- }
- // lib.optionalAttrs host.config.clicks.security.doas.enable { sudo = "doas -u"; };
+ deploy = {
+ mkDeploy =
+ {
+ self,
+ overrides ? { },
+ }:
+ let
+ hosts = self.nixosConfigurations or { };
+ names = builtins.attrNames hosts;
+ nodes = lib.foldl (
+ result: name:
+ let
+ host = hosts.${name};
+ user = host.config.users.infra or null;
+ inherit (host.pkgs) system;
+ in
+ result
+ // {
+ ${name} = (overrides.${name} or { }) // {
+ hostname = overrides.${name}.hostname or "${name}";
+ profiles = (overrides.${name}.profiles or { }) // {
+ system =
+ (overrides.${name}.profiles.system or { })
+ // {
+ path = deploy-rs.lib.${system}.activate.nixos host;
+ }
+ // {
+ user = "root";
+ }
+ // lib.optionalAttrs host.config.clicks.security.doas.enable { sudo = "doas -u"; };
+ };
};
- };
- }
- ) { } names;
- in
- {
- inherit nodes;
- };
+ }
+ ) { } names;
+ in
+ {
+ inherit nodes;
+ };
+ };
}