71 lines
2.1 KiB
Nix
71 lines
2.1 KiB
Nix
{
|
|
description = "Alo cluster";
|
|
|
|
inputs = {
|
|
deploy-rs.url = "github:serokell/deploy-rs";
|
|
deploy-rs.inputs.nixpkgs.follows = "nixpkgs";
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, nixpkgs-unstable, deploy-rs, ... }@inputs:
|
|
let
|
|
inherit (self);
|
|
system = "x86_64-linux";
|
|
|
|
overlay-unstable = final: prev: {
|
|
unstable = nixpkgs-unstable.legacyPackages.${prev.system};
|
|
};
|
|
|
|
mkNixos = modules: nixpkgs.lib.nixosSystem {
|
|
modules = [
|
|
({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; })
|
|
] ++ modules;
|
|
specialArgs = { inherit inputs self; };
|
|
};
|
|
in {
|
|
nixosConfigurations = {
|
|
c1 = mkNixos [ ./hosts/c1 ];
|
|
c2 = mkNixos [ ./hosts/c2 ];
|
|
c3 = mkNixos [ ./hosts/c3 ];
|
|
nix-dev = mkNixos [ ./hosts/nix-dev ];
|
|
};
|
|
|
|
deploy = {
|
|
nodes = {
|
|
c1 = {
|
|
hostname = "c1";
|
|
profiles.system = {
|
|
user = "root";
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.c1;
|
|
};
|
|
};
|
|
c2 = {
|
|
hostname = "c2";
|
|
profiles.system = {
|
|
user = "root";
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.c2;
|
|
};
|
|
};
|
|
c3 = {
|
|
hostname = "c3";
|
|
profiles.system = {
|
|
user = "root";
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.c3;
|
|
};
|
|
};
|
|
nix-dev = {
|
|
hostname = "nix-dev";
|
|
profiles.system = {
|
|
user = "root";
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.nix-dev;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
};
|
|
}
|