Skip to content

Commit

Permalink
nixos/phoebus: add modules
Browse files Browse the repository at this point in the history
Add the possibility to enable phoebus in a nixos configuration
Add the possibility to edit java_opts
  • Loading branch information
Matthieu Daniel-Thomas committed Nov 7, 2024
1 parent 6f51365 commit da863ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
27 changes: 27 additions & 0 deletions nixos/modules/phoebus/client.nix
Original file line number Diff line number Diff line change
@@ -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];
};
}

0 comments on commit da863ca

Please sign in to comment.