module.nix: init

This commit is contained in:
Oystein Kristoffer Tveit 2025-01-10 22:26:47 +01:00
parent 1fa1f91b85
commit 866889d577
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 43 additions and 0 deletions

View File

@ -26,6 +26,8 @@
};
});
nixosModules.default = ./module.nix;
packages = forAllSystems (system: pkgs: let
common = {
pname = "gergle";
@ -52,6 +54,13 @@
});
});
overlays.default = final: prev: {
gergle-desktop = self.packages.${final.system}.linux;
gergle-web = self.packages.${final.system}.web;
gergle-web-debug = self.packages.${final.system}.web-debug;
gergle-web-wasm = self.packages.${final.system}.web-wasm;
};
apps = forAllSystems (system: pkgs: {
default = self.apps.${system}.web;

34
module.nix Normal file
View File

@ -0,0 +1,34 @@
{ pkgs, lib, config, ... }:
let
cfg = config.services.gergle;
in
{
options.services.gergle = {
enable = lib.mkEnableOption "Enable the gergle service";
package = lib.mkPackageOption pkgs "gergle-web-wasm" {
example = "gergle-web-debug";
};
virtualHost = lib.mkOption {
type = lib.types.str;
example = "gergle.example.com";
description = "Virtual host to serve gergle on";
};
location = lib.mkOption {
type = lib.types.str;
default = "/";
description = "Location to serve gergle on";
};
};
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
virtualHosts."${cfg.virtualHost}" = {
locations.${cfg.location}.root = "${cfg.package}/";
};
};
};
}