module.nix: init
This commit is contained in:
parent
1fa1f91b85
commit
866889d577
@ -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
34
module.nix
Normal 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}/";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user