infra/flake.nix
Skyler Grey 1666065809
All checks were successful
buildbot/nix-eval Build done.
feat(axol): Add headscale module
Headscale is an open server for tailscale. Clicks, another group I work
on nix stuff with, has a module which makes it extremely easy to set up
a headscale server. I've spent a while over the past week making it safe
to import, and it's finally ready for Auxolotl to have!

We want to use headscale for internal communication between servers, so
it's OK to avoid setting up OIDC ... similarly, the only people who are
on the headscale should be relatively-well trusted. The expectation is
that to start with, this will be people who want to run buildbot workers
2024-08-08 22:36:01 +00:00

93 lines
2.4 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-unstable";
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";
};
};
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;
};
}