summary refs log tree commit diff stats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix53
1 files changed, 37 insertions, 16 deletions
diff --git a/flake.nix b/flake.nix
index 9378a15..df8d6c4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -13,6 +13,14 @@
         nixpkgs.follows = "nixpkgs";
       };
     };
+    deploy-rs = {
+      url = "github:serokell/deploy-rs";
+      inputs = {
+        flake-compat.follows = "flake-compat";
+        nixpkgs.follows = "nixpkgs";
+        utils.follows = "flake-utils";
+      };
+    };
 
     # inputs for following
     systems = {
@@ -84,6 +92,7 @@
     nixpkgs-unstable,
     library,
     treefmt-nix,
+    deploy-rs,
     # modules
     simple-nixos-mailserver,
     impermanence,
@@ -94,9 +103,23 @@
     ...
   } @ attrs: let
     system = "x86_64-linux";
-    pkgs = nixpkgs.legacyPackages.${system};
     nixos-lib = import (nixpkgs + "/nixos/lib") {};
+    pkgs = nixpkgs.legacyPackages.${system};
     pkgsUnstable = nixpkgs-unstable.legacyPackages.${system};
+    deployPackage =
+      (import nixpkgs {
+        inherit system;
+        overlays = [
+          deploy-rs.overlays.default
+          (self: super: {
+            deploy-rs = {
+              inherit (pkgs) deploy-rs;
+              inherit (super.deploy-rs) lib;
+            };
+          })
+        ];
+      })
+      .deploy-rs;
 
     specialArgs =
       attrs
@@ -114,24 +137,18 @@
     tests = import ./tests {inherit pkgs specialArgs nixLib;};
     vhackPackages = import ./pkgs {inherit pkgs nixLib;};
 
+    hosts = import ./hosts {inherit pkgs nixLib nixpkgs specialArgs extraModules deployPackage;};
+
     inherit (library) nixLib;
     treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
   in {
-    nixosConfigurations."server1" = nixpkgs.lib.nixosSystem {
-      system = "x86_64-linux";
-      inherit specialArgs;
-      modules =
-        extraModules
-        ++ [
-          ./modules
-          ./hosts/server1/configuration.nix
-        ];
-    };
-
-    checks."${system}" = nixLib.warnMerge tests {
-      formatting =
-        treefmtEval.config.build.check self;
-    } "the flake checks";
+    checks."${system}" =
+      nixLib.warnMerge (nixLib.warnMerge tests {
+        formatting =
+          treefmtEval.config.build.check self;
+      } "the flake checks and formatting")
+      (deployPackage.lib.deployChecks self.deploy)
+      "the flake checks and deploy-rs";
 
     packages."${system}" = vhackPackages;
     formatter."${system}" = treefmtEval.config.build.wrapper;
@@ -142,6 +159,8 @@
           # used for certificate generation in the taskserver setup
           gnutls
 
+          pkgs.deploy-rs
+
           git-bug
 
           cocogitto
@@ -149,5 +168,7 @@
         ];
       };
     };
+
+    inherit (hosts) nixosConfigurations deploy;
   };
 }