fix nixos module

This commit is contained in:
Jill 2023-04-30 20:35:40 +03:00
parent 307e3a913a
commit 093787d238
Signed by: oat
GPG Key ID: 33489AA58A955108
1 changed files with 49 additions and 47 deletions

View File

@ -37,8 +37,9 @@
};
defaultPackage = packages.cohost-blogger;
nixosModule = { config, lib, pkgs, ... }:
}) // {
nixosModules = {
cohost-blogger = { config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.cohost-blogger;
@ -57,7 +58,7 @@
};
package = mkOption {
type = types.package;
default = self.packages.${system}.default;
default = self.defaultPackage.${pkgs.system};
};
};
@ -66,7 +67,7 @@
wantedBy = [ "multi-user.target" ];
environment = {
PORT = cfg.port;
PORT = toString cfg.port;
};
serviceConfig = {
@ -82,16 +83,17 @@
};
};
services.nginx = mkIf cfg.domain {
services.nginx = mkIf (cfg.domain != null) {
virtualHosts."${cfg.domain}" = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${cfg.port}/";
proxyPass = "http://127.0.0.1:${toString cfg.port}/";
};
};
};
};
};
};
};
});
}