aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--nixos.nix14
-rw-r--r--options.nix18
2 files changed, 27 insertions, 5 deletions
diff --git a/nixos.nix b/nixos.nix
index 8cb58721..ae555169 100644
--- a/nixos.nix
+++ b/nixos.nix
@@ -88,11 +88,15 @@ in
conf = {
inherit (app) id;
- path = pkgs.writeScript "${app.name}-start" ''
- #!${pkgs.zsh}${pkgs.zsh.shellPath}
- ${script}
- '';
- args = [ "${app.name}-start" ];
+ path =
+ if app.path == null then
+ pkgs.writeScript "${app.name}-start" ''
+ #!${pkgs.zsh}${pkgs.zsh.shellPath}
+ ${script}
+ ''
+ else
+ app.path;
+ args = if app.args == null then [ "${app.name}-start" ] else app.args;
confinement = {
app_id = aid;
diff --git a/options.nix b/options.nix
index 9e367732..e0bf5489 100644
--- a/options.nix
+++ b/options.nix
@@ -94,6 +94,24 @@ in
'';
};
+ path = mkOption {
+ type = nullOr str;
+ default = null;
+ description = ''
+ Custom executable path.
+ Setting this to null will default to the start script.
+ '';
+ };
+
+ args = mkOption {
+ type = nullOr (listOf str);
+ default = null;
+ description = ''
+ Custom args.
+ Setting this to null will default to script name.
+ '';
+ };
+
script = mkOption {
type = nullOr str;
default = null;