diff --git a/hosts/common/programs/bonsai.nix b/hosts/common/programs/bonsai.nix index bf4f7b00..a2e97ff1 100644 --- a/hosts/common/programs/bonsai.nix +++ b/hosts/common/programs/bonsai.nix @@ -121,10 +121,8 @@ in after = [ "graphical-session.target" ]; wantedBy = [ "graphical-session.target" ]; - script = '' - ${pkgs.coreutils}/bin/rm -f $XDG_RUNTIME_DIR/bonsai - exec bonsaid -t ${cfg.config.configFile} - ''; + serviceConfig.ExecStart = "bonsaid -t ${cfg.config.configFile}"; + serviceConfig.ExecStopPost = "rm -f $XDG_RUNTIME_DIR/bonsai"; }; }; } diff --git a/hosts/common/programs/ntfy-sh.nix b/hosts/common/programs/ntfy-sh.nix index 08a9ac13..8d0eacb2 100644 --- a/hosts/common/programs/ntfy-sh.nix +++ b/hosts/common/programs/ntfy-sh.nix @@ -4,7 +4,7 @@ # # send a test notification with: # - `ntfy pub "https://ntfy.uninsane.org/$(cat ~/.config/ntfy-sh/topic)" test` -{ config, lib, ... }: +{ config, lib, pkgs, ... }: let cfg = config.sane.programs.ntfy-sh; in @@ -28,10 +28,12 @@ in services.ntfy-sub = { description = "listen for push-notifications"; wantedBy = lib.mkIf cfg.config.autostart [ "default.target" ]; - script = '' - topic=$(cat ~/.config/ntfy-sh/topic) - ntfy sub "https://ntfy.uninsane.org:2587/$topic" - ''; + serviceConfig.ExecStart = let + sub = pkgs.writeShellScriptBin "ntfy-sub" '' + topic=$(cat ~/.config/ntfy-sh/topic) + exec ntfy sub "https://ntfy.uninsane.org:2587/$topic" + ''; + in "${sub}/bin/ntfy-sub"; }; }; } diff --git a/modules/users/default.nix b/modules/users/default.nix index fa8b2078..e18d4003 100644 --- a/modules/users/default.nix +++ b/modules/users/default.nix @@ -37,10 +37,6 @@ let type = types.listOf types.str; default = []; }; - script = mkOption { - type = types.nullOr types.lines; - default = null; - }; serviceConfig.ExecStart = mkOption { type = types.nullOr (types.coercedTo types.package toString types.str);