diff --git a/nixos/module-list.nix b/nixos/module-list.nix index 399e1d0..607ec3d 100644 --- a/nixos/module-list.nix +++ b/nixos/module-list.nix @@ -5,6 +5,7 @@ ./modules/channel-finder/service.nix ./modules/phoebus/alarm-logger.nix ./modules/phoebus/alarm-server.nix + ./modules/phoebus/client.nix ./modules/phoebus/olog.nix ./modules/phoebus/save-and-restore.nix ] diff --git a/nixos/modules/phoebus/client.nix b/nixos/modules/phoebus/client.nix new file mode 100644 index 0000000..de7b683 --- /dev/null +++ b/nixos/modules/phoebus/client.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + epnix, + pkgs, + ... +}: let + cfg = config.programs.phoebus-client; + pkg = pkgs.epnix.phoebus.override {java_opts = cfg.java_opts;}; +in { + options.programs.phoebus-client = { + enable = lib.mkEnableOption ''Enable the Phoebus client''; + java_opts = lib.mkOption { + type = lib.types.str; + default = "-XX:MinHeapSize=128m -XX:MaxHeapSize=4g -XX:InitialHeapSize=1g -XX:MaxHeapFreeRatio=10 -XX:MinHeapFreeRatio=5 -XX:-ShrinkHeapInSteps -XX:NativeMemoryTracking=detail"; + example = "-XX:MinHeapSize=128m -XX:MaxHeapSize=4g -XX:InitialHeapSize=1g"; + description = '' + This wrapper for the `phoebus-unwrapped` executable sets the `JAVA_OPTS` + environment variable with the provided `java_opts` value. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + environment.systemPackages = [pkg]; + }; +}