infrastructure/machines/nixos/compute01/extranix/default.nix

113 lines
3.3 KiB
Nix

# SPDX-FileCopyrightText: 2024 Lubin Bailly <lubin.bailly@dgnum.eu>
#
# SPDX-License-Identifier: EUPL-1.2
{
lib,
sources,
...
}:
let
inherit (lib.extra) mkImports;
hive-root = ../../../..;
host = "search.infra.dgnum.eu";
in
{
services = {
nginx.virtualHosts.${host} = {
enableACME = true;
forceSSL = true;
};
extranix = {
enable = true;
modules = {
"netconf" = {
paths = mkImports hive-root [
"modules/netconf"
"modules/generic"
"lib/netconf-junos"
];
path-translations = [
{
base = hive-root;
url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/";
}
];
};
"DGNum Infrastructure" =
let
# prefer a non-patched nixpkgs
infra-nixpkgs = (import "${hive-root}/hive.nix").meta.nixpkgs { };
infra-modulesPath = "${infra-nixpkgs.path}/nixos/modules/";
in
{
paths = mkImports hive-root [
"modules/generic"
"modules/nixos"
];
ignored-modules = import "${infra-modulesPath}/module-list.nix" ++ [
"${sources.agenix}/modules/age.nix"
"${sources.arkheon}/module.nix"
"${sources."microvm.nix"}/nixos-modules/host"
"${sources.cgroup-exporter}/nix/module.nix"
{ system.stateVersion = "25.05"; }
];
specialArgs = {
inherit
sources
lib
;
modulesPath = infra-modulesPath;
pkgs = infra-nixpkgs;
name = "<nodeName>";
nodeMeta = {
nix-modules = [ ];
admins = [ ];
adminGroups = [ ];
};
meta = {
organization.groups.root = [ ];
};
};
path-translations = [
{
base = hive-root;
url = "https://git.dgnum.eu/DGNum/infrastructure/src/branch/main/";
}
{
base = sources.nix-modules;
url = "https://git.hubrecht.ovh/hubrecht/nix-modules/src/branch/main/";
}
{
base = infra-modulesPath;
url = "https://github.com/NixOS/nixpkgs/tree/master/nixos/modules";
}
];
};
};
static-data = ./static-data;
inherit host;
settings = {
baseUrl = "https://dgnum.eu/";
title = "DGNum module documentation";
languageCode = "en-us";
params = {
release_current_stable = "infra-DGNum";
logo = "images/dgnum.png";
footer_credits_line = ''
Based on <a href="https://github.com/mipmip/home-manager-option-search">Home Manager Option Search</a>
'';
footer_copyright_line = ''
Made by catvayor for the <a href="https://dgnum.eu">DGNum</a>.
'';
main_menu = [
{
name = ''<img src="images/forgejo.png" style="display:inline-block; height:2.5em; transform:translate(0, -0.7em)" /> Source'';
url = "https://git.dgnum.eu/DGNum/infrastructure/";
}
];
};
};
};
};
}