aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix20
-rw-r--r--hosts/default.nix13
2 files changed, 27 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 817621b..8a51e87 100644
--- a/flake.nix
+++ b/flake.nix
@@ -4,6 +4,9 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05-small";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable-small";
+
+ deploy-rs.url = "github:serokell/deploy-rs";
+
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs = {
@@ -96,6 +99,7 @@
nixpkgs-unstable,
library,
treefmt-nix,
+ deploy-rs,
# modules
agenix,
turtle,
@@ -133,18 +137,20 @@
rocie.nixosModules.default
];
+ deployChecks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
tests = pkgs.lib.attrsets.filterAttrs (_: v: !(v ? meta && v.meta.broken)) (import ./tests {inherit pkgs specialArgs nixLib;});
vhackPackages = import ./pkgs {inherit pkgs nixLib pkgsUnstable;};
- hosts = import ./hosts {inherit pkgs nixLib nixpkgs specialArgs extraModules;};
+ hosts = import ./hosts {inherit self deploy-rs pkgs nixLib nixpkgs specialArgs extraModules;};
inherit (library) nixLib;
treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;};
in {
- checks."${system}" = nixLib.warnMerge tests {
- formatting =
- treefmtEval.config.build.check self;
- } "the flake checks and formatting";
+ checks."${system}" =
+ nixLib.warnMerge deployChecks."${system}" (nixLib.warnMerge tests {
+ formatting = treefmtEval.config.build.check self;
+ } "the flake checks and formatting")
+ "the flake checks and deploy rs checks";
packages."${system}" = vhackPackages;
formatter."${system}" = treefmtEval.config.build.wrapper;
@@ -154,6 +160,8 @@
packages = [
pkgs.git-bug
+ pkgs.deploy-rs
+
# Used to update the stalwart-mail spamfilter
pkgs.nix-update
@@ -166,6 +174,8 @@
};
};
+ deploy.nodes = hosts.nodes;
+
inherit (hosts) nixosConfigurations;
};
}
diff --git a/hosts/default.nix b/hosts/default.nix
index 651569d..dc3b45d 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -4,6 +4,8 @@
nixpkgs,
specialArgs,
extraModules,
+ deploy-rs,
+ self,
}: let
hosts = nixLib.mkByName {
useShards = false;
@@ -22,7 +24,16 @@
value
];
};
+ mkDeployHost = name: value: {
+ hostname = name;
+ profiles.system = {
+ user = "root";
+ path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."${name}";
+ };
+ };
+
nixosConfigurations = builtins.mapAttrs mkNixosConfiguration hosts;
+ nodes = builtins.mapAttrs mkDeployHost hosts;
in {
- inherit nixosConfigurations;
+ inherit nixosConfigurations nodes;
}