forked from fediversity/fediversity
92 lines
2.9 KiB
Nix
92 lines
2.9 KiB
Nix
{
|
|
inputs = {
|
|
nixops4.follows = "nixops4-nixos/nixops4";
|
|
nixops4-nixos.url = "github:nixops4/nixops4-nixos";
|
|
};
|
|
|
|
outputs =
|
|
inputs:
|
|
{
|
|
nixConfig = {
|
|
extra-trusted-substituters = "https://cache.saumon.network/proxmox-nixos";
|
|
extra-trusted-public-keys = "proxmox-nixos:D9RYSWpQQC/msZUWphOY2I5RLH5Dd6yQcaHIuug7dWM=";
|
|
};
|
|
}
|
|
// import ./mkFlake.nix inputs (
|
|
{ inputs, sources, ... }:
|
|
{
|
|
imports = [
|
|
"${sources.git-hooks}/flake-module.nix"
|
|
inputs.nixops4.modules.flake.default
|
|
|
|
./deployment/flake-part.nix
|
|
./infra/flake-part.nix
|
|
./keys/flake-part.nix
|
|
./secrets/flake-part.nix
|
|
./services/tests/flake-part.nix
|
|
];
|
|
|
|
perSystem =
|
|
{
|
|
pkgs,
|
|
lib,
|
|
system,
|
|
...
|
|
}:
|
|
{
|
|
checks = {
|
|
panel = (import ./. { inherit sources system; }).tests.panel.basic;
|
|
};
|
|
formatter = pkgs.nixfmt-rfc-style;
|
|
|
|
pre-commit.settings.hooks =
|
|
let
|
|
## Add a directory here if pre-commit hooks shouldn't apply to it.
|
|
optout = [ "npins" ];
|
|
excludes = map (dir: "^${dir}/") optout;
|
|
addExcludes = lib.mapAttrs (_: c: c // { inherit excludes; });
|
|
in
|
|
addExcludes {
|
|
nixfmt-rfc-style.enable = true;
|
|
deadnix.enable = true;
|
|
trim-trailing-whitespace.enable = true;
|
|
shellcheck.enable = true;
|
|
};
|
|
apps =
|
|
let
|
|
default-configuration = builtins.fromJSON (
|
|
let
|
|
env = builtins.getEnv "DEPLOYMENT";
|
|
in
|
|
if env != "" then
|
|
env
|
|
else
|
|
builtins.trace "env var DEPLOYMENT not set, falling back to `deployment/configuration.sample.json`!" (
|
|
lib.readFile ./deployment/configuration.sample.json
|
|
)
|
|
);
|
|
host-mapping = {
|
|
pixelfed = "test04";
|
|
peertube = "test05";
|
|
mastodon = "test06";
|
|
};
|
|
inherit
|
|
(import ./deployment/fediversity {
|
|
inherit system host-mapping;
|
|
ancilliary.garage = "test01";
|
|
conf."default-configuration" = default-configuration // {
|
|
enable = true;
|
|
applications = lib.mapAttrs (_app: _: { enable = true; }) host-mapping;
|
|
};
|
|
})
|
|
ssh-hosts
|
|
;
|
|
in
|
|
lib.mapAttrs (_: program: {
|
|
type = "app";
|
|
inherit program;
|
|
}) ssh-hosts;
|
|
};
|
|
}
|
|
);
|
|
}
|