users/services: remove script option

This commit is contained in:
Colin 2024-03-21 10:36:24 +00:00
parent 058c95bb2c
commit b13e7c38c7
3 changed files with 9 additions and 13 deletions

View File

@ -121,10 +121,8 @@ in
after = [ "graphical-session.target" ]; after = [ "graphical-session.target" ];
wantedBy = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ];
script = '' serviceConfig.ExecStart = "bonsaid -t ${cfg.config.configFile}";
${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai serviceConfig.ExecStopPost = "rm -f $XDG_RUNTIME_DIR/bonsai";
exec bonsaid -t ${cfg.config.configFile}
'';
}; };
}; };
} }

View File

@ -4,7 +4,7 @@
# #
# send a test notification with: # send a test notification with:
# - `ntfy pub "https://ntfy.uninsane.org/$(cat ~/.config/ntfy-sh/topic)" test` # - `ntfy pub "https://ntfy.uninsane.org/$(cat ~/.config/ntfy-sh/topic)" test`
{ config, lib, ... }: { config, lib, pkgs, ... }:
let let
cfg = config.sane.programs.ntfy-sh; cfg = config.sane.programs.ntfy-sh;
in in
@ -28,10 +28,12 @@ in
services.ntfy-sub = { services.ntfy-sub = {
description = "listen for push-notifications"; description = "listen for push-notifications";
wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ];
script = '' serviceConfig.ExecStart = let
topic=$(cat ~/.config/ntfy-sh/topic) sub = pkgs.writeShellScriptBin "ntfy-sub" ''
ntfy sub "https://ntfy.uninsane.org:2587/$topic" topic=$(cat ~/.config/ntfy-sh/topic)
''; exec ntfy sub "https://ntfy.uninsane.org:2587/$topic"
'';
in "${sub}/bin/ntfy-sub";
}; };
}; };
} }

View File

@ -37,10 +37,6 @@ let
type = types.listOf types.str; type = types.listOf types.str;
default = []; default = [];
}; };
script = mkOption {
type = types.nullOr types.lines;
default = null;
};
serviceConfig.ExecStart = mkOption { serviceConfig.ExecStart = mkOption {
type = types.nullOr (types.coercedTo types.package toString types.str); type = types.nullOr (types.coercedTo types.package toString types.str);