Skip to content

Commit 866889d

Browse files
committed
module.nix: init
1 parent 1fa1f91 commit 866889d

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

flake.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
};
2727
});
2828

29+
nixosModules.default = ./module.nix;
30+
2931
packages = forAllSystems (system: pkgs: let
3032
common = {
3133
pname = "gergle";
@@ -52,6 +54,13 @@
5254
});
5355
});
5456

57+
overlays.default = final: prev: {
58+
gergle-desktop = self.packages.${final.system}.linux;
59+
gergle-web = self.packages.${final.system}.web;
60+
gergle-web-debug = self.packages.${final.system}.web-debug;
61+
gergle-web-wasm = self.packages.${final.system}.web-wasm;
62+
};
63+
5564
apps = forAllSystems (system: pkgs: {
5665
default = self.apps.${system}.web;
5766

module.nix

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{ pkgs, lib, config, ... }:
2+
let
3+
cfg = config.services.gergle;
4+
in
5+
{
6+
options.services.gergle = {
7+
enable = lib.mkEnableOption "Enable the gergle service";
8+
9+
package = lib.mkPackageOption pkgs "gergle-web-wasm" {
10+
example = "gergle-web-debug";
11+
};
12+
13+
virtualHost = lib.mkOption {
14+
type = lib.types.str;
15+
example = "gergle.example.com";
16+
description = "Virtual host to serve gergle on";
17+
};
18+
19+
location = lib.mkOption {
20+
type = lib.types.str;
21+
default = "/";
22+
description = "Location to serve gergle on";
23+
};
24+
};
25+
26+
config = lib.mkIf cfg.enable {
27+
services.nginx = {
28+
enable = true;
29+
virtualHosts."${cfg.virtualHost}" = {
30+
locations.${cfg.location}.root = "${cfg.package}/";
31+
};
32+
};
33+
};
34+
}

0 commit comments

Comments
 (0)