monorepo lab stuff, init zen

This commit is contained in:
iofq 2025-12-27 22:26:02 -06:00
parent cfc15bba89
commit 645e09f9dd
54 changed files with 67498 additions and 406 deletions

View file

@ -3,6 +3,7 @@
inputs = {
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
@ -45,6 +46,7 @@
{
self,
nixpkgs,
nixpkgs-stable,
systems,
...
}@inputs:
@ -61,6 +63,10 @@
(import ./pkgs/overlay.nix)
];
};
pkgs-stable = import nixpkgs-stable {
inherit system;
config.allowUnfree = true;
};
eachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (pkgs: inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
@ -69,6 +75,7 @@
inherit
inputs
pkgs
pkgs-stable
attrs
system
;
@ -83,54 +90,27 @@
};
};
};
deploy.nodes = {
consensus = {
hostname = "consensus";
sshUser = "root";
remoteBuild = true;
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.consensus;
};
};
oracle1 = {
hostname = "oracle1";
sshUser = "root";
sshOpts = [
"-p"
"2022"
];
remoteBuild = false;
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.oracle1;
};
};
oracle2 = {
hostname = "oracle2";
sshUser = "root";
sshOpts = [
"-p"
"2022"
];
remoteBuild = false;
profiles.system = {
user = "root";
path = inputs.deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.oracle2;
};
};
};
deploy.nodes = import ./fleet.nix { inherit inputs self system; };
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
devShells.${system}.default = pkgs.mkShell {
inherit (self.checks.pre-commit-check) shellHook;
buildInputs = [
pkgs.home-manager
pkgs.git
pkgs.ssh-to-age
pkgs.sops
pkgs.age
pkgs.deploy-rs
buildInputs = with pkgs; [
age
deploy-rs
git
home-manager
k9s
kubectl
kubeseal
sops
ssh-to-age
treefmtEval.${system}.config.build.wrapper
velero
(pkgs.writeShellScriptBin "deploy-k8s" ''
cd $(git rev-parse --show-toplevel)
kubectl config use-context lab
kubectl apply -k ./clusters/lab
'')
];
};
};