tlaternet-server/lib/default.nix

41 lines
949 B
Nix
Raw Normal View History

{
lib,
nixpkgs,
2022-10-21 20:48:14 +01:00
nixpkgs-unstable,
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)
2022-10-21 20:48:14 +01:00
{
nixpkgs.overlays = [
(self: super: {
matrix-conduit = nixpkgs-unstable.legacyPackages.${system}.matrix-conduit.override {
inherit (self) stdenv lib fetchFromGitLab rustPlatform pkg-config rocksdb;
};
2022-10-21 20:48:14 +01:00
})
];
}
]
++ extraModules;
};
}