2022-10-17 14:22:08 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
nixpkgs,
|
2022-10-21 20:48:14 +01:00
|
|
|
nixpkgs-unstable,
|
2022-10-17 14:22:08 +01:00
|
|
|
sops-nix,
|
|
|
|
tlaternet-webserver,
|
|
|
|
}: let
|
2022-10-13 00:03:32 +01:00
|
|
|
inherit (lib.attrsets) mapAttrsToList;
|
|
|
|
inherit (lib.strings) concatStringsSep;
|
|
|
|
in {
|
|
|
|
makeQemuNetOpts = portMapping:
|
|
|
|
concatStringsSep ","
|
|
|
|
(mapAttrsToList
|
|
|
|
(host: vm: "hostfwd=::${host}-:${vm}")
|
|
|
|
portMapping);
|
2022-10-17 14:22:08 +01:00
|
|
|
|
|
|
|
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: {
|
2022-10-31 16:06:31 +00:00
|
|
|
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
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|
2022-10-17 14:22:08 +01:00
|
|
|
]
|
|
|
|
++ extraModules;
|
|
|
|
};
|
2022-10-13 00:03:32 +01:00
|
|
|
}
|