From e90821145c46eae0d144af6debf9afa5f9f608d9 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:13:22 +0200 Subject: [PATCH 01/10] ca-gateway: use meta.mainProgram and lib.getExe See #62 --- nixos/modules/ca-gateway.nix | 2 +- pkgs/epnix/tools/ca-gateway/default.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/ca-gateway.nix b/nixos/modules/ca-gateway.nix index 14e6541c..4716a3d1 100644 --- a/nixos/modules/ca-gateway.nix +++ b/nixos/modules/ca-gateway.nix @@ -182,7 +182,7 @@ in { after = ["network-online.target"]; serviceConfig = { - ExecStart = "${pkg}/bin/gateway ${commandLine}"; + ExecStart = "${lib.getExe pkg} ${commandLine}"; # ca-gateway doesn't always exit with a positive status code, # even on failure Restart = "always"; diff --git a/pkgs/epnix/tools/ca-gateway/default.nix b/pkgs/epnix/tools/ca-gateway/default.nix index 0cf9a31c..c4018f3a 100644 --- a/pkgs/epnix/tools/ca-gateway/default.nix +++ b/pkgs/epnix/tools/ca-gateway/default.nix @@ -26,6 +26,7 @@ mkEpicsPackage rec { meta = { description = "Channel Access PV gateway"; homepage = "https://epics.anl.gov/extensions/gateway/"; + mainProgram = "gateway"; license = epnixLib.licenses.epics; maintainers = with epnixLib.maintainers; [minijackson]; }; From 999b01b8cfa5fba60c78993faa98a8078093d7ca Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:14:38 +0200 Subject: [PATCH 02/10] nixos/phoebus-olog: use lib.getExe See #62 --- nixos/modules/phoebus/olog.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/phoebus/olog.nix b/nixos/modules/phoebus/olog.nix index 2b6dbb40..63740dc4 100644 --- a/nixos/modules/phoebus/olog.nix +++ b/nixos/modules/phoebus/olog.nix @@ -108,7 +108,7 @@ in { after = ["elasticsearch.service" "mongodb.service"]; serviceConfig = { - ExecStart = "${pkgs.epnix.phoebus-olog}/bin/phoebus-olog --spring.config.location=file://${configFile}"; + ExecStart = "${lib.getExe pkgs.epnix.phoebus-olog} --spring.config.location=file://${configFile}"; DynamicUser = true; # TODO: systemd hardening. Currently level 8.2 EXPOSED }; From f53a087180f99d07ce3b215a44373366c56fc51a Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:16:47 +0200 Subject: [PATCH 03/10] phoebus-save-and-restore: use meta.mainProgram and lib.getExe See #62 --- nixos/modules/phoebus/save-and-restore.nix | 2 +- pkgs/epnix/tools/phoebus/save-and-restore/default.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/phoebus/save-and-restore.nix b/nixos/modules/phoebus/save-and-restore.nix index c3ee1dd3..220ce101 100644 --- a/nixos/modules/phoebus/save-and-restore.nix +++ b/nixos/modules/phoebus/save-and-restore.nix @@ -84,7 +84,7 @@ in { after = lib.mkIf localElasticsearch ["elasticsearch.service"]; serviceConfig = { - ExecStart = "${pkgs.epnix.phoebus-save-and-restore}/bin/phoebus-save-and-restore --spring.config.location=file://${configFile}"; + ExecStart = "${lib.getExe pkgs.epnix.phoebus-save-and-restore} --spring.config.location=file://${configFile}"; Restart = "on-failure"; DynamicUser = true; diff --git a/pkgs/epnix/tools/phoebus/save-and-restore/default.nix b/pkgs/epnix/tools/phoebus/save-and-restore/default.nix index d0efab5e..bf805448 100644 --- a/pkgs/epnix/tools/phoebus/save-and-restore/default.nix +++ b/pkgs/epnix/tools/phoebus/save-and-restore/default.nix @@ -50,6 +50,7 @@ in meta = { description = "Implements the MASAR (MAchine Save And Restore) service as a REST API"; homepage = "https://control-system-studio.readthedocs.io/en/latest/services/save-and-restore/doc/index.html"; + mainProgram = "phoebus-save-and-restore"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms; From 92d806c87c6c0ef0eedcf481470ec6dd954a51a5 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:19:02 +0200 Subject: [PATCH 04/10] phoebus-alarm-logger: use meta.mainProgram and lib.getExe See #62 --- nixos/modules/phoebus/alarm-logger.nix | 2 +- pkgs/epnix/tools/phoebus/alarm-logger/default.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/nixos/modules/phoebus/alarm-logger.nix b/nixos/modules/phoebus/alarm-logger.nix index 47af9914..4cc6b4a6 100644 --- a/nixos/modules/phoebus/alarm-logger.nix +++ b/nixos/modules/phoebus/alarm-logger.nix @@ -146,7 +146,7 @@ in { "-noshell" "-properties ${configFile}" ]; - in "${pkgs.epnix.phoebus-alarm-logger}/bin/phoebus-alarm-logger ${lib.concatStringsSep " " args}"; + in "${lib.getExe pkgs.epnix.phoebus-alarm-logger} ${lib.concatStringsSep " " args}"; DynamicUser = true; StateDirectory = "phoebus-alarm-logger"; # TODO: systemd hardening diff --git a/pkgs/epnix/tools/phoebus/alarm-logger/default.nix b/pkgs/epnix/tools/phoebus/alarm-logger/default.nix index acdb223f..e093405f 100644 --- a/pkgs/epnix/tools/phoebus/alarm-logger/default.nix +++ b/pkgs/epnix/tools/phoebus/alarm-logger/default.nix @@ -50,6 +50,7 @@ in meta = { description = "Records all alarm messages to create an archive of all alarm state changes and the associated actions"; homepage = "https://control-system-studio.readthedocs.io/en/latest/services/alarm-logger/doc/index.html"; + mainProgram = "phoebus-alarm-logger"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms; From 93039e271903adb56a5556ea379ecd9e4d564f3a Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:34:59 +0200 Subject: [PATCH 05/10] procServe: use meta.mainProgram and lib.getExe See #62 --- ioc/modules/nixos-integration.nix | 2 +- pkgs/epnix/tools/procServ/default.nix | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ioc/modules/nixos-integration.nix b/ioc/modules/nixos-integration.nix index 0318ae2f..0282f197 100644 --- a/ioc/modules/nixos-integration.nix +++ b/ioc/modules/nixos-integration.nix @@ -103,7 +103,7 @@ in { serviceConfig = { ExecStart = let - procServ = "${pkgs.epnix.procServ}/bin/procServ"; + procServ = lib.getExe pkgs.epnix.procServ; arch = epnix.lib.toEpicsArch globalConfig.epnix.outputs.build.stdenv.hostPlatform; in '' ${procServ} ${lib.cli.toGNUCommandLineShell {} config.procServ.options} \ diff --git a/pkgs/epnix/tools/procServ/default.nix b/pkgs/epnix/tools/procServ/default.nix index f6cf65c2..4a6d35f9 100644 --- a/pkgs/epnix/tools/procServ/default.nix +++ b/pkgs/epnix/tools/procServ/default.nix @@ -27,6 +27,7 @@ stdenv.mkDerivation rec { meta = { description = "Wrapper to start arbitrary interactive commands in the background, with telnet or Unix domain socket access to stdin/stdout"; homepage = "https://github.com/ralphlange/procServ"; + mainProgram = "procServ"; license = lib.licenses.gpl3Plus; maintainers = with epnixLib.maintainers; [minijackson]; }; From c6335f76343435829b59401abbea4c56f6cd0d54 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:35:28 +0200 Subject: [PATCH 06/10] lewis: use meta.mainProgram See #62 --- pkgs/epnix/tools/lewis/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/epnix/tools/lewis/default.nix b/pkgs/epnix/tools/lewis/default.nix index 1a67da55..3d20404d 100644 --- a/pkgs/epnix/tools/lewis/default.nix +++ b/pkgs/epnix/tools/lewis/default.nix @@ -49,6 +49,7 @@ buildPythonPackage rec { meta = with lib; { description = "Let's write intricate simulators"; homepage = "https://github.com/ess-dmsc/lewis"; + mainProgram = "lewis"; license = licenses.gpl3Only; maintainers = with maintainers; [minijackson]; }; From c5aea19699e12924bfb575059c83334890f7ab17 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:35:48 +0200 Subject: [PATCH 07/10] phoebus-archive-engine: use meta.mainProgram See #62 --- pkgs/epnix/tools/phoebus/archive-engine/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/epnix/tools/phoebus/archive-engine/default.nix b/pkgs/epnix/tools/phoebus/archive-engine/default.nix index 413c7dbb..bf7a555a 100644 --- a/pkgs/epnix/tools/phoebus/archive-engine/default.nix +++ b/pkgs/epnix/tools/phoebus/archive-engine/default.nix @@ -50,6 +50,7 @@ in meta = { description = "Phoebus' RDB Archive Engine Service"; homepage = "https://control-system-studio.readthedocs.io/en/latest/services/archive-engine/doc/index.html"; + mainProgram = "phoebus-archive-engine"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms; From 3bd2ca9059770b7b0832f66f5adeb7374ae39bfa Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:35:55 +0200 Subject: [PATCH 08/10] phoebus-client: use meta.mainProgram See #62 --- pkgs/epnix/tools/phoebus/client/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/epnix/tools/phoebus/client/default.nix b/pkgs/epnix/tools/phoebus/client/default.nix index 631362df..5913b22c 100644 --- a/pkgs/epnix/tools/phoebus/client/default.nix +++ b/pkgs/epnix/tools/phoebus/client/default.nix @@ -104,6 +104,7 @@ in meta = { description = "Control System Studio's Phoebus client"; homepage = "https://control-system-studio.readthedocs.io/en/latest/index.html"; + mainProgram = "phoebus"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms; From 746ad8f9764ff1b147de528952732101d4de2b2e Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:36:09 +0200 Subject: [PATCH 09/10] phoebus-pva: use meta.mainProgram See #62 --- pkgs/epnix/tools/phoebus/pva/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/epnix/tools/phoebus/pva/default.nix b/pkgs/epnix/tools/phoebus/pva/default.nix index 939b100e..6857c9d8 100644 --- a/pkgs/epnix/tools/phoebus/pva/default.nix +++ b/pkgs/epnix/tools/phoebus/pva/default.nix @@ -50,6 +50,7 @@ in meta = { description = "Phoebus' PV Access client and server"; homepage = "https://github.com/ControlSystemStudio/phoebus/tree/master/core/pva"; + mainProgram = "phoebus-pva"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms; From 5dbbf2f48c5ed4b4c71ec406bc2ecc2782a12599 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 26 Jul 2024 13:36:17 +0200 Subject: [PATCH 10/10] phoebus-scan-server: use meta.mainProgram See #62 --- pkgs/epnix/tools/phoebus/scan-server/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/epnix/tools/phoebus/scan-server/default.nix b/pkgs/epnix/tools/phoebus/scan-server/default.nix index 8fa4e983..36d1508e 100644 --- a/pkgs/epnix/tools/phoebus/scan-server/default.nix +++ b/pkgs/epnix/tools/phoebus/scan-server/default.nix @@ -50,6 +50,7 @@ in meta = { description = "Simple, well tested, and robust set of predefined commands for use by Python users"; homepage = "https://epics.anl.gov/tech-talk/2022/msg01072.php"; + mainProgram = "phoebus-scan-server"; license = lib.licenses.epl10; maintainers = with epnixLib.maintainers; [minijackson]; inherit (jdk.meta) platforms;