Compare commits

..

2 Commits

4 changed files with 4 additions and 11 deletions

View File

@ -4,7 +4,6 @@
, rustPlatform
, makeWrapper
, mpv
, wrapped ? false
}:
rustPlatform.buildRustPackage rec {
@ -37,7 +36,7 @@ rustPlatform.buildRustPackage rec {
};
};
postInstall = lib.optionalString wrapped ''
postInstall = ''
wrapProgram $out/bin/greg-ng \
--prefix PATH : '${lib.makeBinPath [ mpv ]}'
'';

View File

@ -35,7 +35,7 @@
apps = forAllSystems (system: pkgs: _: {
default = self.apps.${system}.greg-ng;
greg-ng = let
package = self.packages.${system}.greg-ng-wrapped;
package = self.packages.${system}.greg-ng;
in {
type = "app";
program = lib.getExe package;
@ -63,9 +63,6 @@
packages = forAllSystems (system: pkgs: _: {
default = self.packages.${system}.greg-ng;
greg-ng = pkgs.callPackage ./default.nix { };
greg-ng-wrapped = pkgs.callPackage ./default.nix {
wrapped = true;
};
});
} // {
nixosModules.default = ./module.nix;

View File

@ -109,8 +109,7 @@ in
Restart = "always";
RestartSec = 3;
WatchdogSec = lib.mkDefault 15;
TimeoutStartSec = lib.mkDefault 30;
WatchdogSec = 15;
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
AmbientCapabilities = [ "" ];

View File

@ -89,8 +89,6 @@ async fn setup_systemd_watchdog_thread() -> anyhow::Result<()> {
async fn shutdown(mpv: Mpv, proc: Option<tokio::process::Child>) {
log::info!("Shutting down");
sd_notify::notify(false, &[sd_notify::NotifyState::Stopping])
.unwrap_or_else(|e| log::warn!("Failed to notify systemd that the service is stopping: {}", e));
mpv.disconnect()
.await
@ -169,7 +167,7 @@ async fn main() -> anyhow::Result<()> {
};
if systemd_mode {
match sd_notify::notify(false, &[sd_notify::NotifyState::Ready])
match sd_notify::notify(true, &[sd_notify::NotifyState::Ready])
.context("Failed to notify systemd that the service is ready")
{
Ok(_) => log::trace!("Notified systemd that the service is ready"),