Commit 6e82177

HPCesia <me@hpcesia.com>
2026-08-18 18:01:36
deploy-rs: init
1 parent c74c654
Changed files (3)
modules/deploy-rs.nix
@@ -0,0 +1,49 @@
+{
+  den,
+  inputs,
+  self,
+  lib,
+  ...
+}: let
+  allHosts = lib.mergeAttrsList (lib.attrValues den.hosts);
+  deployableHosts =
+    lib.filterAttrs (_: host: host.settings.core.openssh.server.enable) allHosts;
+in {
+  flake-file.inputs.deploy-rs = {
+    url = "github:serokell/deploy-rs";
+    inputs.nixpkgs.follows = "nixpkgs";
+    inputs.flake-compat.follows = "flake-compat";
+  };
+
+  flake.deploy.nodes =
+    lib.mapAttrs (name: host: {
+      hostname = host.hostName;
+      profilesOrder = ["system"];
+      profiles.system = {
+        path =
+          inputs.deploy-rs.lib.${host.system}.activate.${host.class}
+          self."${host.class}Configurations".${name};
+        sshUser = "root";
+        user = "root";
+      };
+    })
+    deployableHosts;
+
+  flake.checks =
+    builtins.mapAttrs (
+      system: deployLib: deployLib.deployChecks self.deploy
+    )
+    inputs.deploy-rs.lib;
+
+  perSystem = {system, ...}: {
+    devshells.default = {
+      commands = [
+        {
+          name = "deploy";
+          package = inputs.deploy-rs.packages.${system}.deploy-rs;
+          help = "Deploy profiles to remote servers";
+        }
+      ];
+    };
+  };
+}
flake.lock
@@ -30,6 +30,30 @@
         "type": "github"
       }
     },
+    "deploy-rs": {
+      "inputs": {
+        "flake-compat": [
+          "flake-compat"
+        ],
+        "nixpkgs": [
+          "nixpkgs"
+        ],
+        "utils": "utils"
+      },
+      "locked": {
+        "lastModified": 1786361680,
+        "narHash": "sha256-IxaZkb9rCGEZ+yGndxKXONeIEcKMzoFUsvLTB5G/caw=",
+        "owner": "serokell",
+        "repo": "deploy-rs",
+        "rev": "16901271e5b30b591e56f7a84f25f186fb20f3e1",
+        "type": "github"
+      },
+      "original": {
+        "owner": "serokell",
+        "repo": "deploy-rs",
+        "type": "github"
+      }
+    },
     "devshell": {
       "inputs": {
         "nixpkgs": [
@@ -219,6 +243,7 @@
     "root": {
       "inputs": {
         "den": "den",
+        "deploy-rs": "deploy-rs",
         "devshell": "devshell",
         "flake-compat": "flake-compat",
         "flake-file": "flake-file",
@@ -230,6 +255,39 @@
         "vaultix": "vaultix"
       }
     },
+    "systems": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    },
+    "utils": {
+      "inputs": {
+        "systems": "systems"
+      },
+      "locked": {
+        "lastModified": 1731533236,
+        "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
     "vaultix": {
       "inputs": {
         "crane": "crane",
flake.nix
@@ -7,6 +7,13 @@
 
   inputs = {
     den.url = "github:denful/den";
+    deploy-rs = {
+      url = "github:serokell/deploy-rs";
+      inputs = {
+        flake-compat.follows = "flake-compat";
+        nixpkgs.follows = "nixpkgs";
+      };
+    };
     devshell = {
       url = "github:numtide/devshell";
       inputs.nixpkgs.follows = "nixpkgs";