summaryrefslogtreecommitdiff
path: root/parts/lib/utils/deploy.nix
diff options
context:
space:
mode:
Diffstat (limited to 'parts/lib/utils/deploy.nix')
-rw-r--r--parts/lib/utils/deploy.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/parts/lib/utils/deploy.nix b/parts/lib/utils/deploy.nix
new file mode 100644
index 0000000..aaa01f1
--- /dev/null
+++ b/parts/lib/utils/deploy.nix
@@ -0,0 +1,29 @@
+{inputs, ...}: let
+ inherit (builtins) mapAttrs;
+ inherit (inputs) deploy-rs;
+in {
+ mkDeployNodes = mapAttrs (_: system: let
+ inherit (system) pkgs;
+ deployPkgs = import pkgs.path {
+ inherit (pkgs) system;
+ overlays = [
+ deploy-rs.overlay
+ (_: prev: {
+ deploy-rs = {
+ inherit (pkgs) deploy-rs;
+ inherit (prev.deploy-rs) lib;
+ };
+ })
+ ];
+ };
+
+ type =
+ if pkgs.stdenv.isLinux
+ then "nixos"
+ else "darwin";
+ in {
+ sshUser = "root";
+ hostname = system.config.networking.hostName;
+ profiles.system.path = deployPkgs.deploy-rs.lib.activate.${type} system;
+ });
+}