diff --git a/machines/durruti/host_config.nix b/machines/durruti/host_config.nix new file mode 100644 index 0000000..17ca421 --- /dev/null +++ b/machines/durruti/host_config.nix @@ -0,0 +1,42 @@ +{ config, lib, options, pkgs, ... }: + +with lib; + +let + cfg = config.services.malobeo; +{ + options = { + services.malobeo = { + enable = mkOption { + default = false; + type = types.bool; + description = lib.mdDoc "Enable malobeo infrastructure."; + }; + + host_ip = mkOption { + type = types.str; + default = ""; + description = lib.mdDoc "ip of nix container provided for malo"; + }; + }; + }; + + config = mkIf cfg.enable + { + assertions = [ + { + assertion = cfg.host_ip == ""; + message = '' + You need to specify host_ip of the nix container + ''; + } + ]; + + services.nginx.virtualHosts."tasklist.malobeo.org" = { + forceSSL = true; + enableACME= true; + locations."/".proxyPass = "http://10.233.1.2:8080" + }; + + }; +} diff --git a/outputs.nix b/outputs.nix index a2f2ef3..ef1f3ab 100644 --- a/outputs.nix +++ b/outputs.nix @@ -23,6 +23,8 @@ in (utils.lib.eachSystem (builtins.filter filter_system utils.lib.defaultSystems inherit inputs; }); + nixosModules.malobeo = import ./machines/durruti/host_config.nix; + images.rpi1_base_image = nixosConfigurations.rpi1_base_image.config.system.build.sdImage; packages.x86_64-linux = {