tlaternet-server/lib/default.nix

31 lines
597 B
Nix

{
lib,
nixpkgs,
sops-nix,
tlaternet-webserver,
}: let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
in {
makeQemuNetOpts = portMapping:
concatStringsSep ","
(mapAttrsToList
(host: vm: "hostfwd=::${host}-:${vm}")
portMapping);
makeNixosSystem = {
system,
extraModules,
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
sops-nix.nixosModules.sops
tlaternet-webserver.nixosModules.default
(import ../configuration)
]
++ extraModules;
};
}