refactor
This commit is contained in:
34
modules/services/workout-tracker.nix
Normal file
34
modules/services/workout-tracker.nix
Normal file
@@ -0,0 +1,34 @@
|
||||
{ pkgs, config, lib, inputs, ... }:
|
||||
let
|
||||
cfg = config.modules.services.workout-tracker;
|
||||
fqdn = "${cfg.subdomain}.${config.networking.domain}";
|
||||
port = cfg.port;
|
||||
in
|
||||
{
|
||||
options.modules.services.workout-tracker = {
|
||||
enable = lib.mkEnableOption "Enable Workout Tracker";
|
||||
version = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
subdomain = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
port = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 3322;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.workout-tracker = {
|
||||
enable = true;
|
||||
inherit port;
|
||||
package = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.workout-tracker;
|
||||
};
|
||||
|
||||
modules.services.webserver = {
|
||||
enable = lib.mkDefault true;
|
||||
vHosts.${fqdn}.locations."/".proxyPort = port;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user