infra/flake.nix
Jake Hamilton bf781e7f9e
All checks were successful
buildbot/nix-eval Build done.
feat: add codex
2024-08-20 15:09:43 -07:00

94 lines
2.5 KiB
Nix

# SPDX-FileCopyrightText: 2024 Auxolotl Infrastructure Contributors
#
# SPDX-License-Identifier: GPL-3.0-only
{
description = "Auxolotl infrastructure.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix.url = "github:ryantm/agenix";
agenix-rekey = {
url = "github:oddlama/agenix-rekey";
inputs.nixpkgs.follows = "nixpkgs";
};
auxolotl-website = {
url = "git+https://git.auxolotl.org/auxolotl/website";
inputs.nixpkgs.follows = "nixpkgs";
};
buildbot-nix.url = "git+https://git.auxolotl.org/auxolotl/buildbot-nix.git";
# Do not override nixpkgs in buildbot-nix (see https://github.com/nix-community/buildbot-nix)
clicks = {
url = "git+https://git.clicks.codes/Infra/NixFiles.git";
inputs = {
deploy-rs.follows = "deploy-rs";
nixpkgs.follows = "nixpkgs";
snowfall-lib.follows = "snowfall-lib";
unstable.follows = "unstable";
};
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs: let
lib = inputs.snowfall-lib.mkLib {
inherit inputs;
src = ./.;
snowfall = {
namespace = "auxolotl";
};
};
in
lib.mkFlake {
overlays = [
inputs.auxolotl-website.overlays.default
inputs.agenix-rekey.overlays.default
];
systems.modules.nixos = [
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default
inputs.buildbot-nix.nixosModules.buildbot-master
inputs.buildbot-nix.nixosModules.buildbot-worker
] ++ (lib.attrsets.attrValues inputs.clicks.nixosModules);
deploy = lib.mkDeploy {
inherit (inputs) self;
overrides = {
axol.hostname = "137.184.177.239";
baxter.hostname = "209.38.149.197";
codex.hostname = "64.23.153.98";
};
};
agenix-rekey = inputs.agenix-rekey.configure {
userFlake = inputs.self // { outPath = lib.pipe "" [
lib.snowfall.fs.get-snowfall-file
(lib.strings.removeSuffix "/")
]; };
nodes = inputs.self.nixosConfigurations;
};
checks =
builtins.mapAttrs
(system: deploy-lib: deploy-lib.deployChecks inputs.self.deploy)
inputs.deploy-rs.lib;
};
}